Measuring Your Claude Code Spend
Updated June 2026
When I started tracking token usage across Claude Code sessions, I expected costs to spread roughly evenly across my projects. They didn’t. One project accounted for the bulk of the spend.
The tool I use is token-audit, a local CLI that reads directly from the session transcripts Claude Code writes to ~/.claude/projects/. No API key, no upload; it parses the JSONL files you already have.
What it measures
Four efficiency metrics matter more than raw token counts: cache hit rate, output yield, cost per turn, and cost per session. The two actionable ones day to day:
- Cache hit rate tells you whether your prompt prefix is actually stable. If this is near zero across repeated sessions, something in your system prompt is changing per request; timestamps are the usual culprit.
- Cost per session tells you whether sessions are accumulating stale context. Every turn re-sends the full history as input; a session that never gets cleared grows quadratically in cost.
The breakdown commands (by-project, by-model, by-day) let you slice the same data to find where concentration is happening.
Two habits the data validated
I change models based on the task: lighter models for quick lookups and classification, heavier ones for harder reasoning and longer agent runs. The by-model breakdown makes this visible: you can see what each tier actually cost and whether the routing held in practice rather than in theory.
I also use /clear frequently. This shows up directly in cost per session. Clearing is the manual version of what compaction does automatically, and the metric makes the difference concrete across real sessions rather than hypothetical ones.
What a dashboard doesn’t show
Provider usage pages show total spend. They don’t break it down by project directory, model tier, or day in a way that answers “which project is expensive and why.” The CLI format also lets you diff time ranges, pipe to JSON, or filter by date, in ways a web dashboard doesn’t support.
Running token-audit by-project once is usually enough to surface something you didn’t expect.