AutoMode / Prompt cache
Does switching models in Claude Code waste the prompt cache?
Yes, it can. Each model keeps its own prompt cache, so a switch in a warm chat writes the whole chat to the new model's cache. The effortless README reports about 5 times the cost of staying on a warm Opus in an 80k-token chat. A switch early in a chat costs far less.
When is a model switch cheap?
A switch is cheap when there is little cache to lose. That means at session start, after /clear, or after the cache has gone cold. A short chat is also cheap to rewrite. The risk grows with the size of the chat.
Does changing effort waste the cache?
It depends on the provider. Where the provider shares the cache across effort levels, effort can change on each prompt and the cache stays. Where the provider splits the cache by effort, an effort change has the same problem as a model switch. AutoMode checks this rule for each provider. Where the cache splits by effort, it keeps the warm effort until a low-penalty point.
How AutoMode checks each switch
AutoMode switches models by default, so it checks each switch first. The route holds unless the switch passes.
| Situation | Rule |
|---|---|
| Risk floor | A mandatory floor always switches, whatever it costs. Quality comes first |
| No warm cache | At session start, after /clear, or on a cold cache, a switch is allowed |
| Moving up | Needs two votes in a row, unless the chat is under 20k tokens |
| Moving down in a warm chat | No risk flagged, and judge confidence of at least 0.85 |
| Moving down in the same task | At least 8 requests since the last switch, and a passed check |
| Moving down in a chat of 20k tokens or more | The cautious estimate of the saving must exceed 1.5 times the cache rewrite |
| Too many switches | After 3 discretionary switches in one task, the route holds |
The check is in hooks/lib/policy.ts. These rules limit the cost of a switch. They do not prove that AutoMode saves money. The thresholds are defaults, not calibrated values.
What should I do without a router?
- Pick your model at the start of a chat.
- Change model after
/clear, not in the middle of a long chat. - Keep separate tasks in separate chats.
How do I keep my model and route only effort?
Run /plugin configure automode@automode and set Route models to off. AutoMode then routes effort and keeps the model you picked. Read how a route is decided.
Install AutoMode
Paste these into Claude Code, one at a time, then run /reload-plugins.
/plugin marketplace add mralexivy/AutoMode
/plugin install automode@automode
It is free. It needs no key and no server, and it starts on its own.