Claude Code cost anatomy: 160 real sessions, measured

Every number here comes from the usage fields and byte lengths in one machine's ~/.claude/projects logs, July to September 2026. No estimates, no sampling, no content read. Method at the bottom; the script is in the kit, and you can run the same analysis on your own logs in the browser.

3.04Bbilled context tokens across 160 sessions (11,153 assistant turns)
96%of billed context was cache reads: the same conversation re-sent every turn
67%of all tool-output volume came from 242 results over 20,000 characters (4.4% of tool calls)
−54%re-sent context volume if tool results had been capped at 8,000 characters

1. What the bill is made of

Token typeCountShare of billed context
Cache reads (context re-sent each turn)2,924,083,35296.2%
Cache creation (new context written)114,950,7733.8%
Uncached input130,2460.00%
Output15,349,386not context

Cache reads are cheaper per token than fresh input, but they are the volume: for every token typed, roughly 23,334 tokens of prior context were re-read.

2. Where the re-sent volume comes from

Tool resultsValue
Tool results in the corpus5,473
Total tool-output characters25,029,883
Results over 20,000 characters242 (4.4%)
Their share of tool-output volume66.6%
File reads that were re-reads of an unchanged file51 of 187

Every oversized result is paid for again on every later turn of that session. A 30,000-line seq, a full test log, one find over a monorepo: each becomes a fixed tax on the rest of the conversation.

3. Replay: cap tool results at 8,000 characters

All sessions replayed with every tool result truncated to 8,000 characters (head and tail kept, the rest saved to a file the agent can grep). Re-sent context volume is the sum, over assistant turns, of everything in context at that turn.

EffectValue
Re-sent context volume, all sessions−54.4%
Per-session change, median−3.1%
Per-session change, 75th percentile−27.4%
Per-session change, maximum−78.6%
Sessions cut by more than 30%34 of 160
Share of all billed context tokens held by those sessions49.6%

Most sessions barely change. The quota goes in a fifth of the sessions, and those are the ones a cap fixes. Claude Code already truncates single Bash outputs around 30 KB; the saving above is from the 8 to 30 KB band and from MCP results, which hooks cannot rewrite.

4. Tokens per day, briefly

Median active day: 14.2M billed context tokens; 90th percentile 273.0M; heaviest day 662.3M. Full distribution, per-session and per-turn figures on tokens per day.

The rest of the site: the market, measured the same way

The kit: measure your own sessions and the market, weekly

$39, one time. Regenerated weekly for a year; the download link you get keeps serving the newest build. MIT.

Get the kit, $39

Card checkout by Stripe on this site's own account; the download page opens the moment payment completes. Questions: riley@agentexchange.work.

Method

Corpus: every *.jsonl under ~/.claude/projects on one machine. Token counts are the usage fields Claude Code writes per assistant message. Tool-output volume is the byte length of tool_result content. The replay assigns each assistant turn the cumulative characters in context at that point and recomputes with each tool result capped at 8,000 characters. Nothing here is an estimate.

Pulled 2026-09-23