Haiku vs Sonnet vs Opus: which model for which coding task
Running every task on the biggest model is like commuting in first gear: it works, it's just slow and expensive. Running everything on the cheapest model stalls on hills. This is a practical routing guide: what each Claude tier is actually for, what it costs, and how to use several tiers together without paying switching penalties.
The lineup at a glance
| Model | Input / Output per M tokens | Context | Character |
|---|---|---|---|
| Haiku 4.5 | $1 / $5 | 200K | Fast, cheap, obedient |
| Sonnet 5 | $3 / $15 | 1M | The workhorse: near-Opus coding at a third of the price |
| Opus 4.8 | $5 / $25 | 1M | Long-horizon autonomy, hard debugging, architecture |
| Fable 5 | $10 / $50 | 1M | The frontier tier for the hardest reasoning work |
Prices are Anthropic API list prices (see the official pricing page for current numbers). Subscription users don't pay per token, but the same hierarchy shows up as rate-limit consumption: heavier models burn your usage window faster.
What to give Haiku
Haiku is for work where the answer is obvious and the bottleneck is typing speed:
- Renames, moves, mechanical refactors across files
- Commit messages, changelogs, boilerplate, config tweaks
- Log spelunking and "where is this defined" questions
- First-pass test scaffolding
The economics are dramatic: at a fifth of Opus's input price and with much faster responses, a Haiku session is effectively free for chores. The failure mode is asking it to make judgment calls; it will confidently pick a lane, and on genuinely ambiguous problems that lane is sometimes wrong. Don't hand it architecture.
What to give Sonnet
Sonnet is the correct default for most people most of the day:
- Feature implementation with clear requirements
- Refactors that need taste but not deep design work
- Test suites, bug fixes with a known reproduction
- Code review passes
Current Sonnet models sit remarkably close to Opus on coding benchmarks at a third of the price, which is why it ships as the default in Claude Code. If you only ever use one model, use this one.
What to give Opus (and Fable)
- Debugging where the reproduction is unclear and the cause spans systems
- Architecture and design decisions with long-term consequences
- Long autonomous runs: multi-hour refactors, migration projects
- Work in unfamiliar or legacy codebases where context synthesis matters
The mental model: you're not paying for prettier code, you're paying for fewer wrong attempts. On a gnarly race condition, one correct Opus diagnosis at $0.50 beats four plausible-but-wrong Sonnet attempts at $0.15 each, because your time reviewing the wrong ones was the real cost. Fable-tier models extend the same logic to the hardest problems: worth it when correctness dominates, wasted on chores.
The signals to upshift or downshift
| Signal | Move |
|---|---|
| Model's second attempt at the same bug failed | Upshift |
| Task touches 3+ systems or has unclear requirements | Upshift |
| You're about to start a long unattended run | Upshift |
| The diff is mechanical and reviewable at a glance | Downshift |
| You're rate-limited and it's a chore queue | Downshift |
| Latency is annoying you more than quality | Downshift |
How to run several tiers without penalties
Here's the catch: acting on those signals with /model mid-session has a hidden
cost. Prompt caches are model-scoped, so each in-session switch re-processes your whole context
at full price on the new model.
On long sessions that's real
money and a visibly slow turn. The cache-safe patterns:
- Subagents: keep your session on one model, delegate sub-tasks to another model's subagent.
- One session per tier: a persistent Opus session, a persistent Haiku session, and you route tasks by choosing where to type. Every session keeps its own warm cache, so upshifting is instant and free.
The second pattern is what Model Shift turns into a physical gesture: models mapped to gears, one live cache-safe tab per gear, and a stick shift to move between them. The routing table above stops being advice and becomes muscle memory: chores in 1st, building in 2nd, hard problems in 4th.
Route tasks like gears
Haiku for chores, Sonnet for building, Opus for the hard stuff. One lever, every cache warm.
Get Model Shift for Mac ⇣Further reading: The /model command, completely explained · A cache-safe multi-model workflow