Stop Wiping Your Claude Code Cache: The Model-Switch Cost and a Four-Rule Setup
Each Claude model keeps its own prompt cache, so switching models mid-chat makes the next message re-read the whole conversation uncached. What the docs say, the four habits that keep the cache, a CLAUDE.md note, and how to check your hit rate
Claude Code re-sends your whole conversation on every message. Prompt caching lets the API reuse what it already processed and bill the re-read at the cached token rate. The docs say: "Each model has its own cache. Switching with /model means the next request reads the entire conversation history with no cache hits, even though the content is identical." That one slower, more expensive turn is the cost.
The four-rule setup (from the docs)
- Pick your model and effort level at the top of a session. The docs: "The fewer changes you make mid-task, the higher your cache hit rate."
- Do not run /model in the middle of a task. If Claude Code asks you to confirm a switch, that is because the cache is still warm and you would lose it.
- Save /compact for natural breaks between tasks, not the middle of one. Compaction replaces your history with a summary, so the cache for the old history is not reused.
- Check it with /usage. After the first response it shows a Prompt cache (main) line: your hit ratio, miss count, and whether the cache is warm right now.
ADD TO YOUR CLAUDE.md Prompt cache rule: stay on one model and one effort level for the whole task. Do not suggest switching models with /model or running /compact in the middle of a task; wait for a natural break between tasks and ask me first.
Keep reading
Free, for an email.
Unlocks 4 more sections, the document version, and every other guide on the site, for free. Enter your email once to keep reading.
45,000+ follow where these guides come from.No spam. Unsubscribe in one click.