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.
1. What the bill is made of
| Token type | Count | Share of billed context |
|---|---|---|
| Cache reads (context re-sent each turn) | 2,924,083,352 | 96.2% |
| Cache creation (new context written) | 114,950,773 | 3.8% |
| Uncached input | 130,246 | 0.00% |
| Output | 15,349,386 | not 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 results | Value |
|---|---|
| Tool results in the corpus | 5,473 |
| Total tool-output characters | 25,029,883 |
| Results over 20,000 characters | 242 (4.4%) |
| Their share of tool-output volume | 66.6% |
| File reads that were re-reads of an unchanged file | 51 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.
| Effect | Value |
|---|---|
| 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 sessions | 49.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
- Claude Code tokens per day, per session, per turn: measured
- Claude Code plugin marketplace: what a listed plugin actually reaches
- MCP registry census: servers, growth per day, auth
- npm MCP servers: the downloads a solo publisher actually gets
- Show HN launches about Claude Code: points in the last 90 days
- Most-upvoted open issues: Claude Code vs Codex vs Gemini CLI
- Tools that cut Claude Code token usage: stars, dates, and a replay
- GitHub Trending, archived daily: today, streaks, new entrants
- quota-guard: a free Claude Code plugin that caps re-sent tool output
- Analyze your own Claude Code session cost, in the browser
- The measured data kit: two scripts and this week's datasets, $39
The kit: measure your own sessions and the market, weekly
- Session cost anatomy for your own logs (
quota_report.py): the exact report on this site, on your machine, one command; reads only usage fields and lengths. - Demand simulator (
demand_sim.py+ priors + calibration): live connectors for GitHub, npm, VS Code Marketplace, WordPress.org, Hacker News, Apify, MCP registry, Hugging Face; scores what a solo newcomer reached at each attach-point in the last 24 months, calibrated against six real product outcomes before it scores anything. - This week's datasets: every table on this site as JSON and TSV, the plugin marketplace catalog, the issue gap maps, the 50-candidate scoring run with every verdict and its deciding number.
$39, one time. Regenerated weekly for a year; the download link you get keeps serving the newest build. MIT.
Get the kit, $39Card 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