Claude Code caches are model-specific: switching models, compacting and idle time all bust the cache
shoumikgoswami · reddit · 2026-11-03
A detail easy to miss in Anthropic's docs: Claude Code resends full context (system prompt, project context, all prior messages and tool results) on every request, and only the exactly-matching prefix avoids reprocessing — so certain actions make the next turn slower and pricier.
Cache-breaking:
- Switching models: each model has its own cache, so identical content gets fully re-read; with the opusplan setting, entering/leaving plan mode counts as a model switch
- Compacting: history becomes a summary, so it must be re-cached — docs advise compacting at natural task boundaries, not mid-task
- Idle expiry: cache entries expire after 5 minutes or 1 hour depending on billing/login
Cache-safe: editing CLAUDE.md mid-session (takes effect only after /clear, /compact or restart), switching permission modes, rewinding turns.
The author notes this is one tool's documentation, not a universal rule, and asks whether teams design around caching (one model per run, stable prompt prefix, compacting at task boundaries) or just eat the cost.
More from coding & agent
- AI coding is 10–20x faster for the first 1–2 months, then complexity drags it back down — LadyAshBorg · 2026-11-03
- KAIST's ReTrace Demystifies Computer-Use Agent Recovery, Finds Reflection and Rollback Fragile — kaist-ai · 2026-11-03
- TypeGPU + three.js piano visualizer remake: dev says the slick API is agent-friendly — nptacek · 2026-11-03
- AI swarm of "neural bees" communicates in neuralese, showcasing agent ecologies — Sauers_ · 2026-11-03
- Human mops while their paid AI agent renders an After Effects project solo — ZeroStateReflex · 2026-11-03
- 9 GitHub skills repos that turn Claude into a real work assistant — nikola_mr64990 · 2026-11-03