models · 8 min read · 2026-07-10

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

ModelInput / Output per M tokensContextCharacter
Haiku 4.5$1 / $5200KFast, cheap, obedient
Sonnet 5$3 / $151MThe workhorse: near-Opus coding at a third of the price
Opus 4.8$5 / $251MLong-horizon autonomy, hard debugging, architecture
Fable 5$10 / $501MThe 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:

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:

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)

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

SignalMove
Model's second attempt at the same bug failedUpshift
Task touches 3+ systems or has unclear requirementsUpshift
You're about to start a long unattended runUpshift
The diff is mechanical and reviewable at a glanceDownshift
You're rate-limited and it's a chore queueDownshift
Latency is annoying you more than qualityDownshift

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:

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