Guide
Switching models mid-session: why cheap-by-default beats picking one model for everything
Run the cheap model by default and escalate only for the genuinely hard parts — that is the right default, and Anthropic says so in its own cost docs: "Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning." The catch nobody tells you is that the escalation itself has a price. Every model switch in Claude Code invalidates the prompt cache, so the next turn re-reads your entire conversation history at full write rates. Escalate at task boundaries, not mid-thought — and for small detours, use a subagent instead of switching the session.
The cache is the whole story
Claude Code's prompt-caching docs put the model in the cache key, not just the prompt text: "Model: each model has its own cache. Switching models recomputes the entire request even when the content is identical." Anthropic's engineering blog on building Claude Code goes further and gives the counter-example that breaks naive downshifting: "if you're 100k tokens into a conversation with Opus and want to ask a question that is fairly easy to answer, it would actually be more expensive to switch to Haiku than to have Opus answer, because we would need to rebuild the prompt cache." The same post mentions that Anthropic runs alerts on its own cache hit rate and declares SEVs when it drops.
That claim checks out against list prices. At 100k tokens of history, staying on Opus 5 is a cache read at $0.50/MTok = $0.05; switching to Haiku 4.5 is a fresh five-minute cache write at $1.25/MTok = $0.125. Add a 500-token answer and you get $0.0625 on Opus versus $0.1275 on Haiku — the "cheap" model costs about 2x more for that turn.
List prices, per million tokens
| Model | Input | 5-min cache write | Cache hit | Output |
|---|---|---|---|---|
| Claude Fable 5 | $10 | $12.50 | $1 | $50 |
| Opus 5 / Opus 4.8 | $5 | $6.25 | $0.50 | $25 |
| Sonnet 5 / Sonnet 4.6 | $3 | $3.75 | $0.30 | $15 |
| Haiku 4.5 | $1 | $1.25 | $0.10 | $5 |
The multipliers are what matter for switching: a five-minute cache write is 1.25x base input, a one-hour write is 2x, and a cache read is 0.1x. Live rates for every vendor are in our AI model pricing tracker, and you can run your own numbers in the coding agent cost calculator.
What a mid-session escalation actually costs
Work it forward. You are 200k tokens deep on Sonnet 5, you hit a hard architectural call, and you escalate to Opus 5. That single turn's input side is 200,000 × $6.25/MTok = $1.25 in cache writes, against $0.06 for a cached Sonnet turn — roughly 21x. The escalation pays for itself only if the stronger model saves you more than about $1.19 of downstream rework, which for a real architectural decision it very often does. For "reformat this function", it does not.
| Scenario (200k history) | Input cost, one turn | Worth it when |
|---|---|---|
| Stay on Sonnet 5 (cache hit) | $0.06 | Default. Most coding tasks. |
| Escalate to Opus 5 (cache write) | $1.25 | Hard call, and you stay on Opus for several turns. |
| Escalate for one question, then switch back | $1.25 + another write to return | Almost never. Use a subagent. |
| Haiku subagent, parent untouched | Its own small cache; parent cache intact | Bounded lookups, greps, summaries. |
| Backgrind | Doesn't change the meter — it's the overlay around whichever CLI you run, so you can leave a long-lived session parked and get pinged when it needs a decision. | |
How /model behaves in Claude Code
The documented behaviour: /model switches the model and saves it as your default for
new sessions. With no argument it opens a picker, and pressing s on a row switches for
the current session only. The picker asks for confirmation when the conversation already has
output, precisely because the next response re-reads the full history without cached context. Once
confirmed, the change applies without waiting for the current response to finish. Non-interactive
-p use with a model argument landed in a recent Claude Code release and applies to
the current run only. If you want more of these, our
slash command reference covers the rest.
Two things people miss. First, effort level is cached separately from the model —
"each effort level has its own cache for the same model", and changing it mid-session recomputes
the whole request too. Second, Claude Code ships an automated version of this pattern:
opusplan uses Opus during plan mode and Sonnet for execution. The caching docs are
blunt that this is not free — each plan-mode toggle is a model switch and starts a fresh cache. The
same goes for automatic model fallback: when Claude Code moves you to another model on its own, the
cache resets exactly as it would if you had typed the command yourself.
If you flip between plan and build mode constantly,
you are paying for it.
What carries over, and what doesn't
- Conversation context carries over in Claude Code. The new model reads the same history; you are not starting fresh.
- The cache does not. One full-price write, then you are back to cheap reads until the next change.
- The token count may not even be the same. Claude 4.7 and later models use a newer tokenizer that produces roughly 30% more tokens for identical text; Sonnet 4.6 and earlier use the previous one. Moving a session between those generations changes the measured size of the same context.
- Cursor and Codex are undocumented here. Neither vendor states what happens to context or caching across a mid-conversation switch. Don't assume parity with Claude Code.
Cursor and Codex do it differently
Cursor's switch is UI-first: open the model selector in the chat or agent panel and pick, or press Cmd + / to cycle; the selection persists across conversations until you change it. Cursor also automates the decision entirely. Its Router post frames the problem the same way this article does — "Real routing happens across a conversation: which model to pick, and when to switch" — and reports Intelligence mode at $6.76 per commit against $12.69 for Fable and $7.34 for Opus 4.8, plus early-access enterprise customers saving 30–50% versus routing everything to Opus 4.8. Those are Cursor's own figures with no published methodology beyond user-satisfaction and keep-rate metrics; read them as vendor-reported, not as an independent benchmark.
Codex CLI exposes /model as an interactive picker for the active model and reasoning
effort — switching between gpt-5.4-mini and gpt-5.5 before running a task
— alongside /fast for a fast service tier and /compact to summarise the
visible chat. The OpenAI docs don't say whether context survives the switch. More on the
ergonomic differences in Claude Code vs Codex.
Failure modes, honestly
You will read that switching mid-task "confuses the plan" or degrades output quality. We could not find that documented by Anthropic, OpenAI, or Cursor — practitioners report it, but it is not a vendor claim, and we are not going to state it as fact. What is documented is the cost and latency cliff above, the separate effort-level cache, and the tokenizer discontinuity.
Anthropic's own guidance actually cuts against frequent switching: "Pick your model and effort
level at the top of a session, then save /compact for natural breaks between tasks.
The fewer changes you make mid-task, the higher your cache hit rate." Its cost page names the other
classic failure: unexpectedly high spend "usually traces back to long sessions that were never
cleared or to Opus left as the default model." For scale, Anthropic reports an average of about
$13 per developer per active day and $150–250 per month, with 90% of users under $30 per active
day. If you are on a subscription rather than the API, the same behaviour burns
your usage window instead of your card.
The pattern that survives the math
Cheap by default, escalate at boundaries, and route detours through subagents. Anthropic documents
the subagent as the cache-safe alternative: a subagent "starts its own conversation with its own
system prompt and tool set, separate from the parent's. It builds its own cache… The parent's cache
is unaffected." Models are set per agent via model frontmatter accepting
sonnet, opus, haiku, fable, a full model ID, or
inherit. The cost docs say it outright: "For simple subagent tasks, specify
model: haiku in your subagent configuration." Our
subagents explainer has the setup.
And when the question is which model to trust at all, benchmarks won't answer it — run them on your own codebase on five real tasks from your git history and score blind.
Frequently asked questions
Does switching models mid-session lose my conversation?
In Claude Code, no — the conversation continues and the new model reads the full history. What you lose is the prompt cache. Anthropic's docs are explicit that the model is part of the cache key: "Switching with /model means the next request reads the entire conversation history with no cache hits, even though the content is identical." So the context carries over, but you pay full write price for it once.
Is it cheaper to switch to a cheap model mid-session?
Not always, and Anthropic gives the counter-example itself: 100k tokens into an Opus conversation, switching to Haiku for an easy question costs more than letting Opus answer, because the cache has to be rebuilt. At list prices that turn works out to roughly $0.13 on Haiku versus $0.06 on Opus. The cheap model wins only if you are going to stay on it for a while.
What is opusplan and is it free?
opusplan is a Claude Code model setting that uses Opus during plan mode and switches to Sonnet for execution — the escalate/de-escalate pattern, automated. It is not free: Anthropic's caching docs note that each plan-mode toggle is a model switch and starts a fresh cache. It pays off when plan and execution phases are long, and costs you when you flip in and out repeatedly.
How do Cursor and Codex handle mid-session model switching?
Both use their own interactive pickers rather than a Claude-style slash alias with saved defaults. Cursor is UI-first: open the model selector in the chat or agent panel, or press Cmd + / to cycle, and your choice persists across conversations. Codex CLI documents /model to choose the active model and reasoning effort. Neither vendor documents what happens to conversation context or caching across a switch, so treat carry-over there as unverified.
Where Backgrind fits
Backgrind is not a model and not an agent — it's a desktop overlay for macOS and Windows that PTY-wraps the CLI you already pay for (Claude Code, Cursor, Codex) or a managed model endpoint we host (Grindy), stays on top of your other windows including borderless-fullscreen games, and pings you when the agent needs a decision or finishes. That matters for this topic in one specific way: the cache-friendly pattern is long, uninterrupted sessions, and long sessions are exactly the ones you'd otherwise sit and watch. Park the session, get a toast when it needs you, approve inline. In BYO-CLI mode agent content never touches our servers; Live mode (Plus and Pro) adds phone and browser control if you want to answer from another room. For the "which model" question itself, the Fusion council seats your own CLIs on one hard question and has a chairman judge the answers — your subscriptions pay those tokens, not ours.
Sources
Caching, cache keys, effort-level caching and the subagent alternative: Claude Code — prompt caching.
/model semantics: Claude Code — commands; opusplan and automatic fallback: model configuration.
Cheap-by-default guidance and spend baselines: Claude Code — costs.
Per-token rates, cache multipliers and the tokenizer change: Anthropic pricing.
The Opus→Haiku counter-example: Anthropic engineering — prompt caching is everything.
Cursor's picker and router figures (vendor-reported): Cursor — Router.
Codex CLI commands: OpenAI — developer commands.