You type a one-line question to your coding agent. Before it deals with it, it rereads everything else.
Its instructions, the description of its tools, your memory files, the list of your skills. On my setup, that fixed load weighed about 74,000 tokens. On every turn.
TL;DR: the cost of a coding agent does not only come from what it writes. A large part comes from what it rereads on every call to the model. Across my Claude Code sessions from July to October 2026, the fixed load weighed about 74,000 tokens per turn. The cache makes that rereading cheaper, not free. Measure by source with
/contextand/usage, then cut in order: command output, duplicate skills, unused servers.
This article is for developers and tech leads who use a coding agent every day. No prior knowledge is needed. My numbers and commands come from Claude Code. The method works for any agent. Measure by source, then cut.
Your agent remembers nothing between two calls
The model keeps nothing from one request to the next. So Claude Code sends it everything again, every time. The system prompt, the project context, the conversation history, then your new message.
I call every request to the model a turn. One question from you can trigger several. Each time the agent uses a tool, it calls the model again with the result. And every call carries the fixed load.
The software that prepares this context is called the harness. I described it in the article on harnesses. Here, I measure what it costs.
Luckily, there is prompt caching. The API recognizes the start of a request it has already processed. It does not compute it again, and it bills it at a lower rate.
Here is the public API price list, as a multiple of the price of one input token:
- A cache read costs 0.1 times that price on most models. On Opus 5.5 and Sonnet 5.5, it is 0.05 times.
- A cache write costs 1.25 times that price if the cache lives 5 minutes. It costs 2 times that price if it lives one hour.
- An output token, written by the model, costs 5 times that price.
The cache expires after a break. On a subscription, within the plan's usage, Claude Code asks for a one-hour cache for your main conversation. Subagents only get 5 minutes.
A subagent is a secondary agent that the main agent starts, with its own context.
My measurement, July to October 2026
I am on a Claude Max subscription. In late October, I was no longer reaching my weekly quota. I wanted to know why.
So on 25 October, I measured my Claude Code transcripts from July to October. Transcripts are the history of my sessions, stored on my machine.
These tokens do not all cost the same. To compare them, I weighted them. An input token counts 1, a cache read 0.1, a cache write 2, an output token 5.
This weighting is a comparison convention, not a bill. It applies one rate to different models and cache lifetimes. In particular, it overestimates five-minute cache writes. The subscription may also count usage differently.
Here is the fixed-load breakdown observed in my setup. It is not a Claude Code constant:
Three more numbers from the same measurement matter for what follows.
- Cache reads make up 97 to 98% of all my raw tokens.
- The average cost of a prompt went from about 125,000 weighted tokens in July to about 1.8 million in October.
- The subagents' share of my usage went from about 5% in July to 50 to 60% in October.
I read these numbers simply. I delegate more to subagents, and each prompt carries more work.
And my quota? From 14 to 20 October, I used about 359 million weighted tokens. From 21 to 25 October, about 42 million. The periods have different lengths. That is 51.3 versus 8.4 million per day, a roughly 6.1-fold drop. These figures measure weighted consumption, not productivity or task count. Since July, I found no real block for hitting a limit.
The cache makes rereading cheaper, not free
Take my weighting again. Read from the cache, the 74,000 tokens count as 7,400 weighted tokens. That estimate applies to this context and weighting, before any new files are read.
After a break longer than the cache lifetime, the agent writes the whole context to the cache again. The 74,000 tokens then count as 148,000 with my weighting. And that is only the fixed load, without the history.
The cache makes rereading cheaper, not free. The 74,000 tokens of the fixed load, by source. Below, their weight with my weighting, read from the cache or rewritten after a break.
Subagents pay again too. Each subagent starts its own conversation, with its own system prompt and tools. Its first request does not read the main agent's cache. It builds its own.
Last, everything the agent reads stays in the history. A long test output is reread on every following turn, until a /clear or a /compact. The first command starts over with an empty conversation. The second replaces the history with a summary.
Measure yours before you cut
Separate three units: a human question, a model call and a token. One question can generate several calls, including subagent calls.
weighted = input_tokens
+ 0.1 * cache_read_input_tokens
+ 2.0 * cache_creation_input_tokens
+ 5.0 * output_tokens
Do not cut at random. Three sources are enough to see where the weight is.
-
/contextshows what fills your context, by category, at the moment you run it. It also lists the memory files that loaded. -
/usageshows the session's tokens: input, output, cache reads and cache writes. On a subscription, it splits your recent usage between skills, subagents, plugins and MCP servers. It also suggests fixes, such as trimming a heavy CLAUDE.md. - Your transcripts give the view over several months. Claude Code keeps them as
.jsonlfiles in~/.claude/projects.
Each model response there keeps its token counters. I added these counters up with a small Python script. It deduplicated lines by message ID and request ID, so the same response was not counted twice.
Also keep the main agent and the subagents apart. Otherwise, you will not see their share grow.
What I cut, in order
I start with what weighs a lot and is easy to remove. The agent's core comes last.
I did this cleanup on 25 October, right after the measurement. I have not measured again since, so I give no savings figure for these cuts.
1. Command output
This item does not show up in the fixed load. Yet every output the agent reads stays in the history and is reread on every later turn.
I use RTK, an open source proxy. A hook rewrites the agent's commands so they go through it. RTK filters their output before the model reads it.
As of 31 October 2026, rtk gain counts 43.1 million tokens saved over 67,883 commands. That is 27% of what those commands would have returned. On go test ./..., the filtered output is 99.8% shorter on average.
The Claude Code docs show the same idea with an example: a hook that keeps only the failing tests. You do not need one more tool to start.
2. Duplicate skills and commands
A skill is a file of instructions the agent loads when it needs it. Its content costs almost nothing until it is used. Its description, though, stays in the context on every turn.
I had about 150 skills listed, with many duplicates. A command is a saved prompt you start with a slash. On 25 October, I archived 34 duplicate or unused commands. Twenty-one remain.
I also moved 14 design skills out of the global level. They now load only in the two projects that do front-end work.
Two settings help here. A skill placed in a project's .claude/skills folder loads only in that project. And disable-model-invocation: true removes its description from the context:
---
name: deploy
description: "Deploy the application to production"
disable-model-invocation: true
---
You can still start it yourself. The agent will no longer pick it on its own.
Watch out for one trap. On my machine, desktop app sessions run in git worktrees. A new worktree starts with tracked files. Ignored local files are not copied. My skill links were not committed, so the agents no longer saw them.
For one of the projects, I committed the links. Then I checked that a fresh worktree had them.
3. MCP servers
An MCP server plugs external tools into the agent. Over my measurement period, these servers weighed 20,000 tokens per turn.
The current docs say MCP tool definitions are deferred by default. Only tool names and server instructions enter the context until first use. Check with /context what it looks like on your side.
Then disable the servers you do not use in /mcp. And when a command-line tool exists, like gh for GitHub, prefer it. It adds no tool list to the context.
4. Memory, then the core
The CLAUDE.md file holds your project instructions. It loads at the start of every session, like auto memory. On my setup, the memory line weighs only 4,000 tokens. The docs advise keeping CLAUDE.md under 200 lines.
The system prompt and the built-in tools weigh 40,000 tokens on my setup. That is the agent's core, and you have little control over it. Start with the rest.
5. Habits
One task, one session. Run /clear between unrelated topics, or the old history gets reread on every turn. On large repositories, keep CLAUDE.md up to date. The agent then does not need to explore everything again.
The checklist
Measure what your agent rereads before you cut anything.
- [ ] Run
/contextand write down the weight of each category - [ ] Open
/usageand look at the share of skills, subagents and MCP servers - [ ] Add up the counters in your transcripts, without counting the same response twice
- [ ] Weight each token type before comparing, and write your weighting down
- [ ] Filter command output before the agent reads it
- [ ] Archive duplicate skills and commands, scope the others to their project
- [ ] Disable unused MCP servers, prefer the command line when it exists
- [ ] Run
/clearbetween unrelated tasks - [ ] Commit your skill links if your sessions run in worktrees
What to remember
Your agent pays to reread before it answers. On my setup, that was about 74,000 tokens on every turn, before my question.
The cache lowers that price a lot. It does not cancel it, and it covers neither long breaks nor the first request of a subagent.
Measure by source, then cut where the weight is. For me, the quota is no longer the limit. The real bottleneck is the time I spend steering the agents.
Want to know what your team's agents reread, and where to cut first? Let's talk.
Sources: Anthropic, Manage costs effectively · Anthropic, How Claude Code uses prompt caching · Anthropic, Explore the context window · Anthropic, Prompt caching · Anthropic, Pricing · Anthropic, Skills · Anthropic, Memory · RTK

Top comments (0)