Opus vs Sonnet for coding: which Claude model to use

Use Sonnet for well-scoped coding work, such as a bug fix, a feature with a clear spec or tests, and Opus for work that is long, ambiguous or spread across the codebase. As of 22 October 2026 Opus 5.5 costs twice Sonnet 5.5 per token, but what counts is the cost of the finished task.

Contents

Opus vs Sonnet for coding comes down to the task. Use Sonnet for well-scoped work (a bug fix, a feature with a clear spec, tests) and Opus for work that is long, ambiguous or spread across the codebase (a migration, an audit, a design you haven't settled). As of 22 October 2026, Opus 5.5 costs twice Sonnet 5.5 per token, but what counts is the cost of the finished task.

Anthropic's own cost page for Claude Code puts the line in roughly the same place, in two sentences: "Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning" (Claude Code docs).

Opus vs Sonnet and the rest: the current models#

Sonnet 5.5 Opus 5.5 Haiku 5.5 Fable 5.1
Anthropic's one-line description "The best combination of speed and intelligence" "For long-running agentic coding and knowledge work" "For high-volume, latency-sensitive tasks" "For demanding reasoning and long-horizon agentic work"
Input / output, per million tokens (USD) $2 / $10 $4 / $20 from $0.10 / $0.50 $10 / $50
Cache read, per million tokens $0.10 $0.20 $0.01 $0.25
Speed Fast Moderate Fastest Slower
Context window 1M tokens 1M tokens 1M tokens 1M tokens
Claude Code alias sonnet opus haiku fable

The table comes from the models overview, the pricing page and Claude Code model configuration, all read on 22 October 2026. Haiku 5.5 says "from" because its price rises for prompts over 100,000 tokens. For the benchmark scores we track and what a session costs on each model, see Opus 5.5 vs Sonnet 5.5.

If you never ran /model, you're on Opus. Claude Code's docs say Pro, Max, Team, Enterprise and the Anthropic API all default to Opus 5.5 (Claude Code docs). Opus 5.5 needs Claude Code v2.1.280 or later and Sonnet 5.5 needs v2.1.284; on an older build claude update fixes a request that fails.

When Sonnet is the right call#

Anthropic's launch post says Sonnet 5.5 "is strongest at well-scoped everyday tasks, fixing bugs" and calls it "a faster, lower-cost complement to Claude Opus 5.5" (Anthropic). Put into a working session, Sonnet fits when:

  • you can write the task in a sentence or two and know what done looks like;
  • you can name the handful of files the change touches;
  • there are tests to run, or the result is easy to check by eye;
  • you'll stay at the keyboard and steer, so speed counts: Anthropic labels Sonnet "Fast" and Opus "Moderate".

When Opus earns its price#

The same post gives Opus the harder half: "Opus 5.5 remains clearly stronger at complex, open-ended work requiring sustained judgment" (Anthropic). The Opus 5.5 announcement names the jobs: it is "particularly good at long and sprawling jobs like codebase-wide migrations and audits" (Anthropic).

Reach for Opus when:

  • you can't yet say exactly what the change is, and want the model to work it out;
  • the job runs for a long time on its own, across many files;
  • a wrong turn is expensive, because you'd throw away an hour of work;
  • Sonnet has tried twice and is circling.

Cost per task beats cost per token#

A token price is half the sum. The other half is how many tokens the task takes, and thinking is a big share of those. Claude Code's docs say "Thinking tokens are billed as output tokens", and on Opus 5.5 and Sonnet 5.5 thinking can't be turned off (Claude Code docs). The dial you have is effort: /effort low, medium, high, xhigh or max. Opus 5.5 and Sonnet 5.5 both start at medium in Claude Code (Claude Code docs).

Take one request at list prices, with 100,000 tokens of context (90,000 of them read from cache) and 5,000 tokens written, thinking included. Cache writes are left out.

One request Sonnet 5.5 Opus 5.5
10,000 new input tokens $0.02 $0.04
90,000 cache-read tokens $0.009 $0.018
5,000 output tokens $0.05 $0.10
Total about $0.08 about $0.16

That's arithmetic, not a measurement. If Sonnet needs twice as many requests to finish the same job, the two bills come out even, and a model that gets there in one pass can be the less expensive one per task. Anthropic says as much about its own models: Sonnet 5.5 "complements Opus 5.5 best when running at lower effort settings, where it costs less per task" (Anthropic), and Opus 5.5 at default settings costs "40% less than Opus 5 on typical workloads" (Anthropic).

On a subscription you don't pay per token, but the same tokens fill your 5-hour and weekly bars. Why Claude Code burns tokens lists what else goes into the count, from CLAUDE.md to tool output; API key or subscription? works out whether paying per token suits you at all.

Switch at the start of a task, not in the middle#

Each model has its own prompt cache. Claude Code's docs: "Switching with /model means the next request reads the entire conversation history with no cache hits, even though the content is identical" (Claude Code docs). At the terminal, /model asks you to confirm while the cache is still warm; once the cache has expired, it switches without asking. On a long session, that one uncached turn can cost more than the switch saves.

So pick the model before the first prompt of a task. Three ways to do it in Claude Code:

  • claude --model sonnet starts the session on Sonnet.
  • /model opus switches inside a session. In the picker, Enter switches and saves the choice as your default (the model field in your user settings), and s switches for this session only.
  • opusplan uses Opus in plan mode and Sonnet to carry the plan out. Each toggle in or out of plan mode is a model switch, so plan once and let it run.

Effort is the dial that doesn't cost a cache. On Opus 5.5 and Sonnet 5.5 with an API key or a Claude subscription, changing effort keeps the cache (Claude Code docs).

There is one good reason to switch mid-task: a model limit. Claude Code can show You've hit your Opus limit or You've hit your Sonnet limit, and those cover only that family, so /model to the other one keeps you working. You've hit your session limit and You've hit your weekly limit cover every model, and switching won't help there (Claude Code docs). The limits themselves moved several times this year: every Claude usage limit change in 2026 has the dates.

How Shuriken fits in#

Shuriken runs Claude Code with the model you pick in the chat and doesn't pick one for you. The Analytics page prices your chats' tokens at API rates and can split every day's bar by model, project or agent, so a week where you leaned on Opus shows up in your own numbers next to the Sonnet weeks. Spend by account sits on the same page.

When an account reaches its switch point (99% by default, adjustable from 50% to 100%), your chat moves to another of your accounts and keeps its model, and a "Switched to …" card in the chat names the account. An account that has hit its limit for that model isn't picked; when that limit is the reason for a move, the card says "Model limit reached". Like a model switch, the move usually costs one uncached turn, because the prompt cache is kept per organization and a personal Claude account is one of its own (Claude Code docs). Only add accounts you own and are entitled to use.

If you're still choosing a plan, Claude Pro vs Max for Claude Code puts the plans side by side. Download Shuriken.

Sources

  1. Claude docs: Models overview (accessed 22 October 2026)
  2. Claude docs: Pricing (accessed 22 October 2026)
  3. Anthropic: Claude Opus 5.5 (accessed 22 October 2026)
  4. Anthropic: Claude Sonnet 5.5 (accessed 22 October 2026)
  5. Claude Code docs: Model configuration (accessed 22 October 2026)
  6. Claude Code docs: Manage costs effectively (accessed 22 October 2026)
  7. Claude Code docs: How Claude Code uses prompt caching (accessed 22 October 2026)

Frequently asked questions

Is Opus worth it for coding?

For long, ambiguous or sprawling jobs, usually yes: Anthropic says Opus 5.5 "remains clearly stronger at complex, open-ended work". For a bug fix or a feature with a clear spec, Sonnet 5.5 does the job for half the token price, $2 / $10 per million tokens against $4 / $20.

Which model does Claude Code use by default?

As of 22 October 2026, Claude Code's docs say Pro, Max, Team, Enterprise and the Anthropic API default to Opus 5.5. Change it with claude --model sonnet at launch, or /model, where Enter saves the pick as your default and s keeps it to this session.

Does switching model mid-session cost more?

Yes, once. Each model has its own prompt cache, so the first request after /model re-reads the whole conversation with no cache hits, and Claude Code asks you to confirm while the cache is warm. Pick the model at the start of a task where you can.

What is opusplan in Claude Code?

A model setting that uses Opus in plan mode and Sonnet when it carries the plan out. Each move in or out of plan mode is a model switch, so it starts a fresh cache.

Free tools