Track Claude Code token usage
Read directly from the session logs Claude Code already writes. Nothing to configure, and it works retroactively on history you've already accumulated.
Counting Claude Code in under a minute
- 01Run burnlog$ npx @sxnalabs/burnlog
It finds ~/.claude/projects, reads the JSONL session logs already on disk, and shows you your total before it asks for anything.
- 02Sign in with GitHub
Only once you've seen your own numbers. Signing in is what puts them on the public board under your handle.
- 03Let the hook keep it current
burnlog installs a session-end hook, so every future Claude Code session syncs itself. There is nothing to remember to run.
Where the numbers come from
Claude Code writes one JSONL line per assistant message into ~/.claude/projects/<project>/<session>.jsonl, and each of those lines carries a usage object. burnlog reads the four buckets Anthropic reports separately — input, output, cache creation, and cache read — and keeps them separate all the way to the leaderboard.
That separation is the whole reason a cost estimate can be trusted. Cache reads are an order of magnitude cheaper than fresh input tokens, so a tracker that adds the buckets together and multiplies by one flat rate will overstate a cache-heavy account severalfold. burnlog prices each bucket at its own rate.
Because it reads files that already exist, your first run counts history you accumulated before you had ever heard of burnlog.
What leaves your machine
Token counts, the model name, the fact that the source was Claude Code, an opaque dedupe id, and a timestamp. That is the whole payload.
The prompts, the completions, the file names, the file contents, the repo name, the working directory, and the session id are all read past and never uploaded — there is no column for any of them in the schema. The CLI is MIT-licensed, so this is checkable rather than promised.
What burnlog can't see
Put Claude Code on the board
One command. It scans, shows you your numbers, and only then asks for an account.