29% of what our coding agent re-read was tool output. 1.2% was the conversation
In our last finding, 97.5% of our coding agent's tokens were cached context read back again. This time we asked what that context was made of. Across the same 107,597 Claude Code calls, tool output filled 29% of the 23.6 billion re-read tokens. What the person typed and what the agent wrote back filled 1.2%.
This is our own machine, totals only. Priberry makes Tare, an open-source tool that shows where a coding agent's tokens go.
What the re-read context was made of
Tool output, by kind
Shares of all re-read tokens.
What to take from it
Every call sends the whole context again, so a piece of context costs as many times as there are calls after it. Almost half of what our agent re-read was its own setup and reminders, and 34% was there before anyone typed a word. Of the part that grows during a session, tool output was about half, and shell command output alone was 15.7% of everything re-read. The conversation, the part people tend to think of as "the context", was about 1.2%.
This tells you where the bulk is. It does not tell you how much of it the agent didn't need, and we make no claim about that here.
Check your own
npx tarelab
It runs on your machine and uploads nothing. Priberry makes six free, open-source tools:
the leaks AI-built apps ship, checked in your code
npx launch-blockers checkusers who can raise their own role, checked in your supabase/ folder
npx rolelock@0.1.1 ./my-appwhat a stranger can see in your live app
npx greenlitlaba crash-test lab for AI coding agents
npx crumplelab attackwhere your coding agent's tokens go
npx tarelaban AI exec team on your own computer
markos.priberry.comHow we did it, and the limits
- Same logs, same window. These are the Claude Code logs from one of our machines, 28 October to 26 November 2026 (UTC), as in the earlier finding. Our script found the same 107,597 calls and the same 23,639,803,682 cache-read tokens.
- What is exact and what is estimated. The logs give each call's exact context size (input, cache write and cache read), but not how that context splits by message. The split is an estimate. We rebuilt each conversation chain, starting a new chain at every compaction and for every sub-agent (4,821 chain starts). We measured the size in bytes of every piece added between calls and fitted tokens per byte for each kind of piece, using the exact growth between consecutive calls (a least-squares fit over 106,153 call pairs, R² 0.85).
- How exact the split is. Each exact growth is shared out among the pieces added in that step, by their fitted sizes. Every call's total stays exact, and only the split inside a step is estimated. For a single step, the fitted sizes predicted the real growth to within 11% at the median and 33% at the 90th percentile. Fitted rates: shell output 0.39 tokens per byte (about 2.6 bytes per token), file reads 0.41, typed text 0.41. Earlier thinking came back at 1.01 tokens per thinking token, so thinking stays in the context.
- The error range. We redid the whole split four more ways: without the per-call overhead term, with one shared rate for every kind of text, and with tool output 25% cheaper or dearer per byte than fitted. Tool output stayed within 26.4–33.1% of re-read tokens and the conversation within 1.2–1.5%. Tool output outweighed the conversation by more than 17 to 1 in every version.
- Cache reads, in order. A cache read covers the start of a request. So each call's cache-read tokens were filled in the order the request has them: the agent's setup first, then the older context, then the newest part.
- The agent's own setup. This is the part of a chain's first call that its measured first message doesn't explain: the system prompt, tool definitions, project instructions and memory (median 71,180 tokens). It also includes reminders and tool definitions the agent adds mid-session.
- Left over. 8.3% of re-read tokens are a steady per-call overhead (about 275 tokens a step) that the fit couldn't tie to any logged piece. Content the agent dropped mid-chain (0.2% of re-read tokens) was taken out evenly. Cache reads larger than the rebuilt context (0.5%, mostly calls with several server-side steps) were spread over the whole context.
- Sub-agents. Task prompts and messages from the parent agent count as conversation. A sub-agent's final report, returned to its parent as a tool result, counts as tool output. Images are sized by a fitted per-image rate, not their encoded length.
- Trimmed already. This machine runs Tare, which trims long tool output before the model sees it, so the tool-output share is measured after trimming.
- A second script. We wrote it separately, in another language, sharing no code with the first. It re-read the raw logs, rebuilt the chains, refitted the rates and redid every split. Every share in every version matched to within 0.01 points, and the call and token totals matched exactly.
- Not a sample. This is one machine, one team and one agent, over 30 days of heavy use. Other setups, shorter sessions or other agents can give very different shares. Calls the agent doesn't log aren't counted.
- Nothing read out. The scripts count only sizes, block types, tool names and token usage. No prompt, code, file name, project name, session id or tool output is stored or shown, and connected tools are grouped together.
More studies: priberry.com/research · Launch Blockers, Rolelock, Greenlit, Crumple, Tare and MarkOS (priberry.com/#tools)