Why Claude Code sessions get expensive
Every Claude Code turn sends the whole session again: the system prompt, your memory files, the conversation and the tool results still in context. Prompt caching makes that repeated part cheaper per token, but never free, and it grows with every turn and every line added to memory. A session gets expensive when the repeated part gets big, not when you type a lot.
Updated 2026-10-21
Every turn sends everything again#
A model keeps nothing between requests. To carry a conversation forward, Claude Code sends the full history every time, and each tool call sends another request with its results attached. So a one-line question late in a long session still pays for the whole session behind it. Anthropic’s cost docs say the same.
Prompt caching softens this. The unchanged start of each request is stored and read back at a small fraction of the normal input price. A cache entry does expire, though: the first message after a long break misses the cache and pays to process the whole context again.
The four kinds of token#
- Fresh input: text the model has not seen in this session, at the full input price.
- Cache write: storing the start of a request for reuse. It costs more than fresh input, once.
- Cache read: reusing what was stored. A small fraction of the input price, paid again on every turn.
- Output: what the model writes, thinking included. The most expensive kind per token.
In a long session, cache reads are most of the tokens. Cache writes are fewer but cost more each. Both scale with how much is loaded at the start and kept in context.
Three things that make a session grow#
Context#
Every file read, command output and search result stays in the conversation until you clear or compact it, and it is sent again on every later turn.
Memory#
Your CLAUDE.md files, everything they import, and the start of Claude’s own MEMORY.md load at the start of every session. Each “remember this” adds lines that every future turn of every future session pays for. Memory files rarely shrink on their own.
Work you do not see#
Subagents, scheduled tasks and compaction each send requests of their own. A subagent starts with its own copy of your memory files.
A measured session, line by line#
We ran the same 27 coding tasks in Claude Code 2.1.292 on Claude Sonnet 5.5, three full sessions a side: once with a full-size test memory as it was, and once after MinniMemoryMCP sorted it.
| Before | After | Change | |
|---|---|---|---|
| Fresh input | 216 | 240 | +11.1% |
| Cache write | 626,130 | 391,988 | -37.4% |
| Cache read | 2,931,482 | 2,609,556 | -11.0% |
| Output | 16,181 | 17,752 | +9.7% |
| All tokens | 3,574,009 | 3,019,536 | -15.5% |
| Cost, three sessions | $2.31 | $1.68 | -27.4% |
What moved. Cache writes fell by more than a third, because less memory was loaded and stored at the start of each session. Cache reads fell too, because that smaller start was read back on every turn. Output rose a little. The cost fell further than the token count because a large share of the drop was cache writes, which cost far more per token than cache reads.
What it is. One measured setup: a full-size test memory and these 27 tasks. A blind grader marked 74 of 81 answers correct before and 72 of 81 after. A memory with less in it has less to move. The method is in the Evidence section.
What to watch#
/usage: cache read and cache write tokens for the session, and an estimated cost./context: what fills the context window right now.- The length of your CLAUDE.md files, what they import, and Claude’s MEMORY.md.
- How many turns since your last
/clear.
The fixes are in How to reduce Claude Code token usage. How to keep memory small is in Claude Code memory: CLAUDE.md vs MinniMemoryMCP.