Teardown · October 2026
What Claude Code and Codex actually send the model
over a long session.
We build a tool in this space, so read this with that in mind. Everything below comes from our own recorded sessions, our longest Claude Code and Codex ones, measured offline. No model was called to produce these numbers.
1. Every turn re-sends the whole session
Each request carries everything so far. Over a long session, what got sent added up to a median of about 340 times the largest context the session ever held for Claude Code, and about 170 times for Codex. Caching makes the repeats cheaper (about a tenth of the input price), but they are still most of the bill.
2. It's mostly tools, not conversation
Share of what was re-sent, weighted by how many later requests carried each piece again:
| Content | Claude Code | Codex |
|---|---|---|
| Command output | 26% | 30% |
| Tool calls the agent made (commands, args) | 20% | 18% |
| File contents read | 9% | 28% |
| Code written into files | 12% | <1% |
| Browser screenshots | 12% | – |
| Our messages | 9% | 19% |
| The agent's own replies | 10% | 3% |
Our Claude Code sessions use a lot of browser automation, so yours will differ. Codex reads files through shell commands, which is why its file share is higher.
3. About half of file reads were files already read
For both agents, about half of file-reading output was a file the session had already read. Sometimes the file had changed in between. Either way, the old copy stayed in context and went out again on every turn after.
What helped
- A new session per unrelated task. The biggest win, and free.
- Line ranges instead of whole files, and
| tail -50on test and build logs. - Compacting before the context peaks, not after.
- Being suspicious of tools that dump big output, such as screenshots and full JSON.
See your own mix
We turned the counting into a small offline script. It reads the session files already on your machine, prints this breakdown, and uploads nothing:
curl -fsSL https://densilo.com/tokens.py | python3 -
Read the source first at densilo.com/tokens.py, or see what it prints. If your mix looks different, especially without browser work, we'd like to hear about it: support@densilo.com.
How this was measured
From the session files Claude Code and Codex keep locally. Re-sent history comes from the token counts the provider recorded for each request. The breakdown by content weighs each piece by how many later requests carried it again, until a compaction cleared it. More detail: why Claude Code uses so many tokens and Codex token usage.