CK claudekit / v1.0
shipped Apr 2026
Claude Code Content

Your debug session
isn't a write-off.
It's a thread.

ClaudeKit reads your ~/.claude/sessions directory and turns yesterday's four-hour bug hunt into a Twitter thread, blog post, or newsletter — for indie devs who already build in public.

input 2026-04-29.jsonl 1,247 msgs · 4h 12m
5 tweets · 4.1s thread.md output
047 user /users endpoint takes 3.2s in prod, ~80ms locally. same query, same data shape. wtf is going on
048 claude 3.2s vs 80ms with the same query usually means the same query is firing many more times in one environment. Can you log pg.totalCount per request in prod for 60s?
049 tool edit src/routes/users.ts · added pg.totalCount logger
051 user pg.totalCount = 412 on a single /users request. only 41 rows returned.
052 claude Classic N+1. You're loading 41 users, then firing one query per user — likely user.team in your serializer. Check UserSerializer#team.
053 tool read src/serializers/user.ts L18-L24
054 user yep. await db.team.findFirst(...) inline in the serializer.
055 claude Pull the team join into the original findMany with include: {'{ team: true }'}. That collapses 412 round-trips into 1.
056 tool edit src/routes/users.ts · added team include · bench: 3.2s → 94ms ✓
··· 1,191 more messages · written to ~/.claude/sessions/
thread.md · build-in-public · 5 tweets generated 14:22
1/5
/users took 3.2s in prod, 80ms locally.
same query, same data shape. spent the morning convinced it was a Postgres planner thing. it wasn't. quick thread on what it actually was →
184 / 280·thread.md:1
2/5
first move: count queries per request.
added pg.totalCount logging on the route. one request to /users → 412 queries. for 41 rows. there it is.
168 / 280·thread.md:14
3/5
classic N+1, hiding inside a serializer. UserSerializer#team was doing await db.team.findFirst(...) inline — once per user. invisible until you measure.
211 / 280·thread.md:24
4/5
fix: one line.
push the join up to the original findMany({'{ include: { team: true } }'}). 412 round-trips collapse into 1. 3.2s → 94ms.
178 / 280·thread.md:34
5/5
lesson I keep relearning:
"slow query" is almost never one slow query. log the count before you tune the plan. 80% of perf bugs in this app have been N+1 wearing a different costume.
194 / 280·thread.md:44
built by @[your-handle] · used by [N] indie devs in private beta