15 Billion Tokens in 30 Days: What My AI Coding Agents Actually Consume
I priced a month of Claude Code transcripts at API rates. 98% of the input came from cache, and cache reads were still most of the bill.
Thirty days of Claude Code calls: share of tokens vs share of cost at API list prices. Chart made with an AI assistant from my own transcripts.
In June, Gartner predicted that AI coding costs will overtake the average developer's salary by 2028, and listed "bloated context windows" among the common causes of overspending. This month, token-saving tools are trending on GitHub, and one trend report says performance is "now being defined by token economy".
I parsed the Claude Code transcripts on my laptop to see where my own tokens go. I wrote this story with help from an AI assistant. The data comes from my own transcripts.
Claude Code keeps transcripts for 30 days by default, so that is the window: 65,315 model calls across 179 sessions, 15 billion input tokens read from cache, 98% of all input served from cache, and 62% of the calls made by subagents rather than by the conversation I was typing into.
Every call sends the whole conversation again
The model keeps nothing between requests. Each call re-sends the system prompt, the tool definitions, the project instructions and the full history, and the cache only saves re-processing the part that hasn't changed.
The first call of a new session already carried about 52,000 tokens: system prompt, tools, my project instructions and memory notes, plus my first message. Mid-session it was much more. The median call from my main conversation carried 308,000 tokens of context. At a few hundred thousand tokens a call, 65,000 calls add up to 15 billion.
Where the money goes
I'm on a Claude subscription, so I don't pay per token. To see the weights anyway, I priced every recorded call at the API list price for its model. The same 30 days would have cost about $5,700, or roughly $218 per active day.
Cache reads were 59% of that, even though a cache hit is the cheapest token type: on Opus 5.5 it costs 5% of the normal input price. Cache writes took 32%. Output, meaning everything the model wrote including its thinking, was just under 10%. Uncached input rounded to zero.
Context size is the multiplier
Because every call pays for its full context, a session gets more expensive per call the longer it runs. Calls carrying more than 500,000 tokens were 28% of my main-conversation calls and 49% of its cost.
My sessions often ran until auto-compaction kicked in at around 967,000 tokens, and a few of them dominated: 10 of the 179 sessions produced 55% of all cache reads.
Walking away rewrites the cache
A cached prefix expires after a stretch without requests. On a subscription, Claude Code gives the main conversation a one-hour cache and subagents five minutes. Writing a one-hour cache costs twice the input price; reading it on Opus 5.5 costs 0.05 times. Rebuilding a context therefore costs about 40 times as much as reading it.
One real session, call by call: context size and the cost of each call at API list prices. Chart made with an AI assistant from my own transcripts.
The chart shows one real session. It grew from 52,000 to about 800,000 tokens in one evening, then stopped on a question for me. I answered 13 hours later, and the next call rewrote 777,000 tokens: $6.24 for a single call, when a normal call at that size cost about $0.20. After a weekend away, 44 hours, it happened again for $6.74. Those two calls were 18% of the session's $73.
Across the month there were 163 rebuilds after more than an hour idle, with a median of 378,000 tokens each. Together they cost about $560, 10% of the total.
Subagents: more calls, cheaper calls
Subagents made 62% of the calls but only 37% of the cost. Each one starts its own conversation with a small context, so its median call carried 123,000 tokens against 308,000 in the main thread, and cost $0.05 against $0.14.
They do pay more for caching, though. With a five-minute cache, writes were 35% of their cost. Judging by their task descriptions, about half of the 800 subagents were reviewers and verifiers checking other agents' work.
Main conversation vs subagents over the same 30 days. Chart made with an AI assistant from my own transcripts.
What barely moved the number
The effort setting changes how much the model writes. At xhigh, my main conversation produced about 40% more output per call than at high, but output was under 10% of the bill.
The model's price mattered more. Had the Opus 5.5 calls been billed at Opus 5 rates, where a cache read costs 10% of input and input itself costs more, the same month would have come to about $10,000.
Checklist
- Compact or clear before leaving a session for more than an hour. Compacting while the cache is warm reads the history from cache, so it costs a fraction of a cold rebuild. Newer Claude Code versions can do this for an idle terminal session.
- Compact at task boundaries instead of riding one session toward a million tokens.
- Hand large reads and reviews to subagents, which start small.
- Leave the effort level for last.
- Check the "Prompt cache (main)" line in
/usage, and raisecleanupPeriodDaysif you want more than a month of history to analyse.
Comments
No comments yet. Start the discussion.