All postsLONG-FORM4 min read
Where Do Claude Code Tokens Actually Go? I Measured 6.5 Billion
I read a week of my own Claude Code logs: 6.5 billion tokens, 95% of them cache re-reads. Here's where the tokens went, what list prices say about which ones weigh most, and the fixes I'd do first.
My AI agents used about 6.5 billion tokens in one week, and 95% of them were the same words read back again. I run Claude Code all day on one Mac (my Shorts pipeline, the nightly job that builds these episodes, and my own sessions), which is a lot heavier than most setups. Claude Code keeps a local log of every request, so I read a full week of mine and sorted every token by where it went.
The receipt
October 30 to November 5, 2026 (UTC): about 28,700 requests and 6,486,769,539 tokens. Split four ways:
| Kind of token | Share of tokens |
|---|---|
| Cache reads | 95.4% |
| Cache writes | 4.3% |
| Output (what Claude wrote) | 0.3% |
| Uncached input | ~0% |
Why so many re-reads? Anthropic's prompt caching docs put it plainly: "The model doesn't remember anything between requests, so Claude Code re-sends the full context: the system prompt, your project context, every prior message and tool result, and your new message." The cache makes that repeated part cheap, but it's still read and still counted. The typical request on my Mac carried about 178,000 tokens of context; the typical answer was about 330 tokens.
Which tokens weigh the most
I'm on a flat plan, so this isn't my bill. Priced at Anthropic's API list prices (96.7% of the tokens ran on Claude Opus 5.5), the week comes to about $3,100, and the split flips: cache reads are 39% of that price, cache writes 49%, output 12%. On Opus 5.5 a cache read costs one twentieth of normal input, while saving into the cache costs more than normal input.
So the expensive moment is a cache rebuild: the first request of a session, a break longer than the cache lifetime, a compaction, or a model switch (each model has its own cache). On a subscription, Claude Code asks for a one-hour cache on the main conversation; subagents and compaction get five minutes.
Before you type a word
The first request of a new session (176 sessions started that week) carried a median of about 51,000 tokens: built-in instructions, tool descriptions, instruction files, the skills list and the task. My global instruction file plus one project's memory index are only about 2,700 of those (a rough characters-divided-by-4 estimate). Anthropic's own advice: keep CLAUDE.md under 200 lines, move workflow instructions into skills, switch off MCP servers you don't use (/mcp), and run /context to see what's taking space.
The long-session tax
529 conversation threads ran that week, counting subagents. The longest 10% (52 threads, each with 98 or more requests) used 74% of all the tokens. Every request re-reads everything before it, so a session open all day pays for its whole history on every step. The docs say /clear costs nothing, while /compact reads the whole conversation to write its summary. My agents compacted 60 times that week.
My rule now (opinion): one task per session, clear when the task changes, compact only when you need the history to keep going, at a natural break.
The shell-output trick
Every tool result that week (shell, file reads, web pages, MCP) added up to roughly 13 million tokens of new text, about 0.2% of the total. But results stay in the conversation and get re-read on later steps. Counting the later steps for each result up to the next compaction, those 13 million came back as roughly 914 million tokens of re-reading, about 68 times their size and 14% of the week. That's a rough estimate: it assumes nothing got cleared (pushes it up), and the four-characters-per-token rule probably undercounts on newer Claude models (pushes it down).
RTK, a free CLI that trims shell output before the agent reads it, is a reasonable tool for this. One caution about its counter: it logged about 372,000 commands that week, with bursts over 1,000 a minute, and about 89 million tokens saved. My Claude Code logs show about 17,600 shell calls and 9 million tokens of shell output. My guess for the gap is scripts. RTK's own docs say "The percentage is reliable" and "The absolute token counts are approximate."
Less code
Output was a tiny slice of my tokens (0.3%), but it's the part you wait for and review. Ponytail is a free skill that tells the agent to write the smallest change that works. Its author's benchmark (October 7, 2026, Opus 5.5, 39 tasks, 5 runs each) measured about half the lines (-53%), 41% less time and 22% fewer turns, with hidden checks at 86/90 without the skill and 87/90 with it. It's the author's own benchmark, with the shell switched off for every agent. Fewer turns is the number I care about most, since every turn re-reads the conversation.
The order I'd do it in
My opinion, from one heavy Mac's data:
- Short sessions: one task, then
/clear. - Keep big output out of long sessions: a filtering hook, RTK, or a subagent for noisy work (give simple subagents a smaller model).
- Keep the cache warm mid-task: avoid long breaks and model switches; compact at a natural break between tasks.
- Trim the starting block: short CLAUDE.md, skills for the rest, unused MCP servers off.
- Smaller output, with a skill like Ponytail.
Then measure your own. /usage in Claude Code shows what's eating your plan, and since October (version 2.1.305) you can press f to apply its suggested fixes. OpenAI says that starting in December, usage on its Plus, Pro and Business plans, shared across ChatGPT and Codex, will be measured in tokens too.
How I measured
Read-only Python over ~/.claude/projects/**/*.jsonl on my Mac: each API response deduped by message id, its usage fields summed (input, cache creation, cache read, output); tool-result sizes as characters divided by 4. Only aggregates were printed, no prompts or project names. The list price uses Anthropic's published rates. Timestamps are UTC.
Daily email
Get each breakdown in your inbox.
One email each evening, right after the Short goes live: the AI tool it covers, the full write-up with sources, and how to get paid for it. Free, and you can unsubscribe anytime.
Sources
- Claude Code docs, prompt caching: https://code.claude.com/docs/en/prompt-caching.md
- Claude Code docs, manage costs: https://code.claude.com/docs/en/costs.md
- Anthropic pricing: https://platform.claude.com/docs/en/about-claude/pricing
- Anthropic glossary (tokens): https://platform.claude.com/docs/en/about-claude/glossary
- RTK, how savings work: https://github.com/rtk-ai/rtk/blob/master/docs/guide/resources/savings-explained.md
- Ponytail agentic benchmark, Oct 7 2026: https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/results/2026-10-07-agentic.md
- OpenAI, ChatGPT and Codex usage limits: https://help.openai.com/en/articles/20001625-understanding-chatgpt-and-codex-usage-limits