← Blog

Which Claude Model Is Best for Coding?

September 13, 2026

AI Coding

Which Claude model is best for coding? As of September 2026, Anthropic answers that in its own docs, and the answer is two models, not one. Its guide to choosing a model points complex agentic coding at Claude Opus 5 and everyday coding at Claude Sonnet 5. Claude Fable 5.1 sits above both as the escalation.

The same guide adds the line that matters more than the menu:

Tuning effort is often a better lever than switching models.

So the practical question is which model and which effort level. Here's the short answer:

  • Opus 5 for long, autonomous coding work: multi-hour agents, large refactors, systems work. Start at its default high effort.
  • Sonnet 5 for day-to-day code generation and agentic tool use, where speed and cost count.
  • Fable 5.1 only when your evals on Opus 5 at xhigh or max effort still fall short.
  • Haiku 4.5 for small, well-scoped sub-tasks, not as the main agent.

The best Claude models for coding, side by side

ModelAnthropic's example usesContextPrice per MTok, in / outCoding role
Claude Fable 5.1Agent sessions that run for hours, deep research1M$10 / $50The escalation
Claude Opus 5Multihour autonomous coding agents, large-scale refactoring, complex systems engineering1M$5 / $25Hard, long-running work
Claude Sonnet 5Code generation, agentic tool use, data analysis1M$2 / $10The everyday default
Claude Haiku 4.5Real-time apps, sub-agent tasks200K$1 / $5Small scoped pieces

The example uses come from Anthropic's model selection matrix. Context windows and prices are from the models overview and pricing page, checked September 11, 2026.

A few things in that table are easy to misread:

Opus 5 is the "start here" model. The overview recommends Opus 5 for most workloads when you're unsure, and describes it as built "for complex agentic coding and enterprise work." Anthropic's Opus 5 launch post says it comes close to Fable 5's frontier intelligence at half the price.

Sonnet 5 isn't a budget afterthought. Anthropic's own matrix names it for everyday coding, and its launch post says its performance is close to Opus 4.8's at lower prices. Routine feature work and bug fixes sit squarely in the lane that matrix gives it.

Fable 5.1 is Anthropic's most capable widely released model, released September 1, 2026, so if you mean the best Claude model regardless of cost, it's this one. It's also the priciest in the lineup and slower. (A sibling model, Claude Mythos 5.1, is limited to Project Glasswing participants.)

Haiku 4.5 is the odd one out for agent loops. It has a 200K window where the others have 1M, no effort parameter, and isn't on the supported list for Anthropic's server-side compaction. A coding agent piles up file contents, test output, and stack traces fast, which makes the window the practical blocker for a main agent loop. As a sub-agent for narrow jobs it fits Anthropic's matrix fine. Claude Haiku vs Sonnet goes deeper on where that line falls.

What Claude Code picks for you

If you're asking from inside Claude Code rather than the API, the default model depends on your account. Per the Claude Code model configuration docs:

Accountdefault resolves to
Max, Team Premium, Enterprise, Anthropic APIOpus 5
Pro, Team StandardSonnet 5
Amazon Bedrock, Google Cloud's Agent PlatformOpus 5
Microsoft FoundrySonnet 4.5

You can switch with /model. The aliases are worth knowing: sonnet for daily coding tasks, opus for complex reasoning, fable for your hardest and longest-running tasks, and opusplan, which uses Opus in plan mode and switches to Sonnet to execute. Depending on your plan and seat tier, Fable usage can bill to usage credits instead of your plan's included limits. In interactive sessions Claude Code shows a consent prompt before that happens, except for Enterprise members on organization billing.

One trap: aliases resolve differently by provider. On the Anthropic API, sonnet means Sonnet 5. On Amazon Bedrock and Google Cloud's Agent Platform, the same alias currently resolves to Sonnet 4.5. If a teammate's "Sonnet" feels different from yours, check which provider each of you is on.

Context varies too. Claude Code on the Anthropic API runs Sonnet 5, Fable 5.1, and Opus 4.7 and later with the 1M window by default, but subscription plans differ: Pro users, for example, need usage credits for Opus at 1M. Claude Code's 1M context window lays out the plan-by-plan details.

Effort, and why it often beats model-swapping

The effort parameter trades intelligence for latency and cost within one model. The levels are low, medium, high, xhigh, and max, and Anthropic's per-model advice for coding is specific:

  • Opus 5: start at high. Step up to xhigh for demanding coding and agentic work, or max when a task justifies unconstrained token spend. Use low and medium freely wherever your evals show quality holds. If you carried effort settings over from an older model, run a fresh sweep instead of reusing them.
  • Sonnet 5: high by default for complex coding. xhigh for the hardest coding and agentic tasks.
  • Opus 4.8 and 4.7 (still available): start at xhigh for coding and agentic use.

The docs describe xhigh as the level for long-running agentic and coding tasks, meaning over 30 minutes, with token budgets in the millions. At xhigh or max on Opus 5, Anthropic suggests setting a large max_tokens, starting around 64K, so the model has room to think and act.

Effort often wins because it changes one thing. A new model changes everything at once: tool-calling habits, response length, formatting defaults, how your prompt lands. Effort holds all that steady. When a task fails, raising effort tells you whether the problem is thinking budget before you rebuild a prompt around a different model.

Put together, Anthropic's guidance gives you an escalation order:

  1. Opus 5 at default effort.
  2. Raise effort to xhigh or max and re-run your evals.
  3. Still short on demanding reasoning or long-horizon agentic work? Move to Fable 5.1.

Switching models is step three, not step one.

Speed is a separate dial. If Opus 5 is right but too slow, Anthropic offers fast mode on Opus 5 and Opus 4.8 as a research preview: up to 2.5× faster output at premium pricing, on the first-party Claude API only and not with the Batch API.

What decides quality more than the model

Coding output is dominated by things you control:

Context quality. The model only reasons about code it has seen. A maintained project instructions file, and pointing the agent at the right files, often does more than a model upgrade.

Session hygiene. Long sessions degrade as the window fills. Anthropic's compaction docs say as much: response quality falls as a conversation grows, which is why compaction swaps old content for a summary. Clearing context between unrelated tasks is cheap. What survives Claude Code's auto-compact covers what you lose when it doesn't happen.

A test loop. An agent that can run your tests is checking its work. One that can't is guessing. That's the whole premise of coding agents: a write-test-fix loop, not autocomplete.

Scoping. "Fix the failing test in this file" and "refactor the auth system" are different jobs. The second one struggles on any model if you hand it over in one sentence.

Where to start this week

  • Default to Opus 5 at high for serious agentic coding, and Sonnet 5 for everyday work, especially if you're on Pro, where Claude Code already defaults to it.
  • When a task fails, raise effort before you change models. Reach for Fable 5.1 only after xhigh or max on Opus 5 still falls short.
  • Keep Haiku 4.5 for sub-tasks, not the main loop.
  • Put caching on the stable parts of your context. Prompt caching cuts the cost of resending the same system prompt and project files every turn.

Once you've picked the model, the part worth keeping is the setup around it: the instructions, tools, test loop, and scoping habits that made a session productive. Taku is built for that, letting you mirror a coding setup someone has already got working into a desktop workspace and run it without rebuilding their environment first. Taku is in Beta, and the Mac app is available now.