Claude Code

Opus vs Sonnet cost per task

Compare Opus and Sonnet on cost per completed task, not price per token. Includes the measurement method and where each model earns its premium.

Quick answer

Compare tokens per completed task, then apply rates. Sonnet is cheaper per token and usually wins on routine edits. Opus can be cheaper overall on hard debugging or architecture work because it needs fewer attempts. Never compare token prices alone.

Measure it

  1. Pick a task you repeat weekly.
  2. Run it in each model with a fresh session and the same prompt.
  3. Record input, cache read, cache write, and output.
  4. Record whether the first attempt completed the task.
  5. Multiply by current rates and divide by completed tasks.

Where each wins

TaskLikely winnerWhy
Rename or small editSonnetEnough reasoning, lower rate
Test fixDependsOpus may avoid retries
Multi-file refactorOpusFewer failed attempts
Code reviewSonnetOutput-bound, cheaper rate
ArchitectureOpusReasoning quality matters

Use both

Explore with Sonnet, then escalate the hard part to Opus. That pattern usually beats picking one model for everything.

UsageAtlas splits Claude Code usage by model, so the comparison uses your tasks rather than a benchmark.

When the stronger model pays

TaskCheaper modelStronger model
Rename a symbolUsually fineWasteful
Write a test suiteFine with a specBetter coverage
Debug a race conditionOften loopsSaves attempts
Explain unfamiliar codeFineBetter synthesis
Large refactorRiskyWorth the rate

The decision is not the rate per token but the number of attempts. A strong model that solves a hard bug in one pass is cheaper than three passes on a cheap model, and much cheaper than a bad fix you have to review.

UsageAtlas records the per-model split, so you can check whether the strong model is reserved for hard tasks. See Claude Code tokens by model.

Questions, answered

Is Opus always more expensive?

Per token yes. Per completed task, not always, because it may need fewer turns.

Can I switch models mid-session?

Yes. The context stays, and the new model's rate applies from that point.

Which model should be the default?

Sonnet for most work, with Opus reserved for tasks where a failed attempt is expensive.

Browse by topic