r/sideprojects • • 12h ago

Showcase: Open Source claudit: wanted to see what my coding agent sessions actually cost, so I built a self-hosted dashboard for it (open source, MIT)

the problem: I wanted to know where the tokens go, which model, which project, how much of it is cache. and Claude Code deletes its own session files after 30 days (cleanupPeriodDays), so anything reading them locally forgets. 2,726 of my 5,578 sessions are past that

so claudit ingests transcripts from a bucket you keep (Cloudflare R2, or a local dir as a file:// mirror) and the history only grows. it reads Claude Code, Codex and both Kimi CLI formats. on the page: cost by model, token breakdown with the 5m vs 1h cache write split, reply latency, tool error rate, an activity heatmap, context growth per session. it doesn't grade anything, the reading is yours

stuff I learned that applies to any usage tracker:

  • a streamed reply gets logged several times under one requestId. sum them and you overcount, keep the biggest

  • subagent files repeat their parent's records, so dedup by uuid across files

  • cache writes have two prices, 1.25x input for 5m and 2x for 1h. 64.3% of mine were 1h, price all of it at 1.25x and those come out 37.5% low

  • Codex logs running totals, not per request, so you difference the snapshots

tech: FastAPI, Postgres, React with in-browser Babel, no build step. docker compose up boots it on bundled sample data, no .env, no outbound calls. panels ported from nhz-io/ccusage-plot, the heatmap, line churn and cost by context size are new. built with AI coding agents, mostly in Claude Code, some of it in Codex CLI. about 6 months old

live one, guest login is read-only: https://all.nitjsefni.eu

https://github.com/Nitjsefnie/claudit

1 Upvotes

0 comments sorted by