Claude Code has a built-in file clerk, and on Opus 5.5 it bills like a senior engineer.
It's called Explore. When Claude says it's exploring your codebase, this helper opens and reads your files. It can't edit anything, and it runs on the same model as your chat, so on Opus it reads on Opus and eats the same limit.
Opus 5.5 costs $4 per million tokens in. Haiku 5.5 costs $0.10. In my own logs, Opus just reading files and pages came to $723 in 3 months.
Anthropic's docs give the fix. Make your own helper named Explore, and it replaces the built-in one, model included:
1. copy the file from the reply
2. tell Claude Code "save this as ~/.claude/agents/Explore.md"
3. restart Claude Code
4. next time it explores, type /tasks. The Explore row names the model, it should say Haiku
One trap: there's also a setting that moves every helper to Haiku at once. Skip it, because it moves your planner to Haiku too. Move only the clerk.
Do it before your next long session.
Compaction is a mistake.
When an agent's context fills up, tools like Codex and Claude Code compact it:
1. The model prefills the entire session again
2. It writes a summary of everything so far
3. A new session starts from that summary
I measured this on a real ~400k-token session with Opus 5.5:
→ 38 s and $1.99 when the prompt cache has expired
→ 29 s and $0.17 when it hasn't
And the summary is lossy. The exact error message, the file path, the one number you needed is often gone.
So I do something new for Mainplane
Context retrieval works the other way around. Mainplane keeps the full record of every session as a file. When the context fills up, a new session starts right away with one instruction: "You are continuing session X. Retrieve key context from it as you go."
The agent searches the old session and copies the exact lines it needs, when it needs them.
Same session, same model: 15 s and $0.10 to get back to work. It does not depend on a cache hit, and nothing is paraphrased.
This is the bitter lesson applied to agent memory. Don't hand-design what the model should remember. Give it the full record and good tools, and let it decide.
Mainplane is open source (MIT). Link in the first comment.
Compaction is a mistake.
When an agent's context fills up, tools like Codex and Claude Code compact it:
1. The model prefills the entire session again
2. It writes a summary of everything so far
3. A new session starts from that summary
I measured this on a real ~400k-token session with Opus 5.5:
��� 38 s and $1.99 when the prompt cache has expired
→ 29 s and $0.17 when it hasn't
And the summary is lossy. The exact error message, the file path, the one number you needed is often gone.
So I do something new for Mainplane
Context retrieval works the other way around. Mainplane keeps the full record of every session as a file. When the context fills up, a new session starts right away with one instruction: "You are continuing session X. Retrieve key context from it as you go."
The agent searches the old session and copies the exact lines it needs, when it needs them.
Same session, same model: 15 s and $0.10 to get back to work. It does not depend on a cache hit, and nothing is paraphrased.
This is the bitter lesson applied to agent memory. Don't hand-design what the model should remember. Give it the full record and good tools, and let it decide.
Mainplane is open source (MIT). Link in the first comment.