Claude Code Cache Misses are Expensive
coolreddy · reddit · 2026-07-12
The author reviews their caching costs during long conversations in Claude Code, finding that "resuming an interrupted session" forces a cache rewrite. This significantly increases consumption, potentially eating up about 30% of the total usage.
They detail the specific pricing and mechanics: input is $10/M tokens, cache reads are 10% of the input price, while cache writes are about $12.5/M for a 5-minute window and $20/M for a 1-hour window. For a session with a 400k token context, a normal read costs about $0.40, but if the cache expires, rewriting it once equates to roughly $8 in API costs.
They summarize several operations that silently break the cache:
- Leaving a session idle for over 1 hour; the first turn after expiration requires rewriting the entire history
- Loading a new tool or MCP server mid-session changes the prefix and invalidates the cache
- Switching between different models rebuilds the cache separately for each model
- Frequently toggling between effort/fast mode also triggers extra rewrites
- Updating the Claude Code version mid-session similarly affects all continued chats
Finally, they share a workaround: sending a lightweight ping at the 55-minute mark for idle sessions exceeding 200k tokens, ensuring it only triggers a cache read instead of a costly rewrite after expiration.
More from coding & agent
- Mirendil debuts Fern, its first model with a 10M-token context window — shayan_ · 2026-10-27
- SF 'Code Engineering' event picks up where 1,000-person harness engineering meetup left off — LangChain · 2026-10-27
- Prompt turns Claude Code into an iPhone backup forensics tool exposing 30-day 'deleted' photo copies — alex_verem · 2026-10-27
- Prompt turns Claude Code into a forensics tool finding deleted iPhone photos in backups — alex_verem · 2026-10-27
- Phones won't be mobile IDEs but control planes for agent fleets, argues Yuchen Jin — Yuchenj_UW · 2026-10-27
- FrontierCS 2 launches on Kaggle: 48 tasks make agents beat published CS papers — MeganRisdal · 2026-10-27