Skip to content
,

Best Claude Model for Coding (2026): Fable 5.2 vs Opus 5.5 vs Sonnet 5.5 vs Haiku 5.5

8–12 minutes
Worried woman with long braids in an orange jacket holding a card with the Claude logo, with the hook text Which Claude codes best?

Anthropic now offers four current Claude models: Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5. All four can write code, and all four have a 1 million token context window, so which one is actually best for coding?

The honest answer depends on the kind of coding you do, how much you want to spend, and whether you use the Claude apps, Claude Code or the API.

This guide compares every current Claude model for coding using Anthropic’s own documentation (checked November 14, 2026): prices, effort levels, defaults, and the jobs each model fits. You will also learn how to switch models in Claude Code, how effort levels change results, the opusplan trick that saves money, and fixes for common model errors.

TL;DR

  • Best all-round coding model: Claude Opus 5.5 ($4 / $20 per million tokens). Anthropic says to start with it for most workloads, and it is the default in Claude Code on paid plans.
  • Hardest problems: Claude Fable 5.2 ($8 / $40). For long, autonomous, multi-hour tasks, root-cause hunts and architecture work.
  • Best value for everyday coding: Claude Sonnet 5.5 ($2 / $10). Fast, strong, half the price of Opus.
  • Cheapest and fastest: Claude Haiku 5.5 (from $0.10 / $0.50). Great for simple edits, sub-agents and high-volume jobs.
  • Effort matters as much as the model. Medium is the default in Claude Code; use high for bug fixes, xhigh or max for very hard problems.
  • Money saver: /model opusplan plans with Opus and writes code with Sonnet.

All Current Claude Models Compared

From Anthropic’s models overview page:

Fable 5.2 Opus 5.5 Sonnet 5.5 Haiku 5.5
Anthropic’s description Demanding reasoning and long-horizon agentic work Long-running agentic coding and knowledge work Best combination of speed and intelligence High-volume, latency-sensitive tasks
Speed Moderate Moderate Fast Fastest
Input / output price (per 1M tokens) $8 / $40 $4 / $20 $2 / $10 From $0.10 / $0.50
API model ID claude-fable-5-2 claude-opus-5-5 claude-sonnet-5-5 claude-haiku-5-5
Context window 1M 1M 1M 1M
Max output 128K 128K 128K 128K
Thinking Adaptive (always on) Adaptive (always on) Adaptive Adaptive
API default effort high medium high medium
Knowledge cutoff June 2026 June 2026 June 2026 June 2026

Batch API requests are 50% off for all models, and prompt cache reads are heavily discounted (2.5% of input price on Fable 5.2, 5% on Opus 5.5 and Sonnet 5.5, 10% on others). Haiku 5.5 costs more per token once a prompt passes 100K tokens. Full rates are on our Claude Code pricing page.

Which Claude Model to Use for Each Coding Task

Task Best model Suggested effort
Building a new feature with a clear spec Opus 5.5 medium
Fixing a bug in an existing codebase Opus 5.5 high
Outage debugging, root-cause investigation Fable 5.2 high
Large refactor or migration across many files Fable 5.2 or Opus 5.5 high or xhigh
Architecture and design decisions Fable 5.2 high
Security review, finding vulnerabilities Opus 5.5 or Fable 5.2 max
Everyday edits, tests, small scripts Sonnet 5.5 medium
Renames, formatting, quick questions Haiku 5.5 or Sonnet 5.5 low
Sub-agents doing searches or test runs Haiku 5.5 or Sonnet 5.5 low or medium
Bulk code classification or extraction via API Haiku 5.5 low

Claude Opus 5.5: The Default Pick

Anthropic’s own advice is blunt: “If you’re unsure which model to use, start with Claude Opus 5.5.” It is also what the default setting picks in Claude Code on Pro, Max, Ultra, Team, Enterprise and Anthropic API accounts.

  • Why it is good for coding: built for long-running agentic coding, so it plans, edits many files, runs tests and recovers from errors well.
  • Effort: defaults to medium. Anthropic says Opus 5.5 at medium matches or beats Opus 5 at high on its coding evaluations, so do not carry over a higher level from older models.
  • Cost: $4 / $20, which is half of Fable 5.2.
  • Use it for: most real development work, from features to bug fixes.

Claude Fable 5.2: For the Hardest Work

Fable is Anthropic’s most capable family. The Claude Code docs describe Fable models as suited to “tasks larger than a single sitting”: they sustain long autonomous sessions, investigate before acting and verify their own work more often.

  • Best for: ambiguous problems, outage debugging, deep root-cause analysis, architecture choices, and big tasks you would normally split into pieces.
  • How to prompt it: describe the outcome, not the steps, and skip “please test this” reminders. It checks its own work.
  • Cost: $8 / $40, double Opus 5.5. On some plans Fable usage bills to usage credits instead of your included limits; Claude Code shows “Requires usage credits” in the picker when it does.
  • Not the default anywhere. You have to choose it with /model fable.
  • Safety fallback: requests its classifiers flag, mostly in cybersecurity and biology, can automatically fall back to another model.

Anthropic suggests moving to Fable when your results on Opus 5.5 at higher effort still fall short.

Claude Sonnet 5.5: Best Value

Sonnet 5.5 is “the best combination of speed and intelligence” in Anthropic’s words, and it costs half as much as Opus.

  • Best for: day-to-day coding with a clear scope, writing tests, small features, explaining code, and the execution half of opusplan.
  • Speed: rated “Fast”, so it feels snappier in interactive sessions.
  • Cost: $2 / $10. For heavy API users this is often the sweet spot.
  • Note: needs Claude Code v2.1.284 or later.

Claude Haiku 5.5: Fast and Cheap

  • Best for: quick edits, renames, lint fixes, sub-agents that search files or run tests, and high-volume API jobs.
  • Cost: from $0.10 / $0.50, by far the cheapest. Prompts over 100K tokens cost more.
  • Context: full 1M window on every plan in Claude Code.
  • Use it with: /model claude-haiku-5-5 or claude --model claude-haiku-5-5 (Claude Code v2.1.293+).

Haiku is not the model to trust with a tricky architecture change, but for small, well-defined jobs it is excellent value.

Effort Levels: The Other Half of the Choice

Effort controls how much the model thinks before and between steps. All four current models support low, medium, high, xhigh and max. In Claude Code, all four default to medium.

Level When to use it (from Anthropic’s docs)
low Quick exchanges you review each time: brainstorming, a first sketch, a rename
medium Day-to-day engineering with a clear scope, such as a new feature
high Work where verification matters or edge cases are likely, such as bug fixes in existing code
xhigh Deeper reasoning at higher token spend
max Hard problems you want Claude to work through alone, like finding security holes. Can overthink, so test first

In Anthropic’s tests, higher effort meant Claude tested more edge cases and verified more of its work, while lower effort returned a starting point sooner. A smaller model at high effort can beat a bigger model at low effort on some tasks, so try both before upgrading.

Tip: type ultrathink anywhere in a prompt for one deeper turn without changing your session setting.

How to Switch Models in Claude Code

  1. Update first: claude update. Opus 5.5 needs v2.1.280+, Sonnet 5.5 v2.1.284+, Haiku 5.5 v2.1.293+ and Fable 5.2 v2.1.321+.
  2. Inside a session, run /model and pick from the list, or type an alias directly:
    /model opus      # Opus 5.5
    /model sonnet    # Sonnet 5.5
    /model haiku     # Haiku 5.5
    /model fable     # Fable 5.2
    /model opusplan  # Opus for planning, Sonnet for coding
  3. Set effort with /effort high (or pick it in the /model picker).
  4. To launch with a model for one session: claude --model sonnet --effort high.
  5. To pin an exact version (useful in teams), use the full ID such as claude-opus-5-5.
  6. Check what you are running with /model or the status line.

About opusplan: in plan mode it uses Opus for reasoning and architecture, then switches to Sonnet to write the code. You get Opus-quality plans at closer to Sonnet prices. New to Claude Code? Start with our install guide and set up a CLAUDE.md file so every model follows your project rules.

What Each Model Costs for a Real Task

Say a coding session sends 2 million input tokens (mostly repeated code context) and produces 200,000 output tokens. Ignoring caching:

Model Input cost Output cost Total
Fable 5.2 $16.00 $8.00 $24.00
Opus 5.5 $8.00 $4.00 $12.00
Sonnet 5.5 $4.00 $2.00 $6.00
Haiku 5.5 (base rate) $0.20 $0.10 $0.30

In practice Claude Code caches most repeated context, and cache reads cost a small fraction of the input price, so real bills are usually much lower. Thinking tokens count as output, which is why higher effort costs more. Haiku’s figure uses its starting rate; long prompts over 100K tokens are billed higher.

Which Plan Gives You Which Model

Where you use Claude Default coding model Notes
Claude Code on Pro, Max, Ultra, Team, Enterprise Opus 5.5 Fable 5.2 can bill to usage credits depending on plan and seat
Claude Code with an Anthropic API key Opus 5.5 Pay per token
Amazon Bedrock, Google Cloud, Claude Platform on AWS Opus 5.5 The sonnet and haiku aliases may point to older versions; pin full IDs
Microsoft Foundry Sonnet 4.5 Aliases lag; select newer models by name

For what each subscription includes, see Claude Free vs Pro vs Max vs Ultra. Comparing tools rather than models? Read Codex vs Claude Code.

Troubleshooting

Problem Fix
“Claude Code does not support this model” Your Claude Code is too old. Run claude update.
“Requires usage credits” on Fable Your plan bills Fable to usage credits. Add credits or stay on Opus 5.5.
Session switched model mid-task Automatic fallback after a safety classifier flag, or a usage-credit prompt was dismissed. Check /model.
sonnet runs an old Sonnet on Bedrock or Vertex Aliases lag on some providers. Set ANTHROPIC_DEFAULT_SONNET_MODEL or use the full model ID.
New session starts on a different model Project, managed or organisation settings override yours. Ask your admin or check settings files.
Answers feel rushed or shallow Raise effort to high or xhigh, or use ultrathink for one turn.
Costs too high Drop to Sonnet 5.5, use opusplan, lower effort, and send sub-agents to Haiku.
Want Claude Code on a local model instead See our guides to Claude Code Router and running Claude Code locally.

My Take

Use Opus 5.5 at medium as your everyday coding model and bump it to high for bug fixes. Reach for Fable 5.2 when a task is big, vague or has beaten Opus once already.

If you pay per token, Sonnet 5.5 or opusplan gives you most of the quality for half the cost, and Haiku 5.5 is perfect for sub-agents and small chores.

Before you upgrade models, try raising effort. It is often the cheaper fix.

FAQ

What is the best Claude model for coding in 2026?

Claude Opus 5.5 for most coding. Claude Fable 5.2 for the hardest, longest tasks. Sonnet 5.5 is the best value.

Is Opus or Sonnet better for coding?

Opus 5.5 is stronger for complex, multi-file and agentic work. Sonnet 5.5 is faster and half the price, and is great for everyday tasks with a clear scope.

Is Claude Fable worth it for coding?

For long autonomous sessions, debugging hard problems and architecture work, yes. For routine features, Opus 5.5 is usually enough at half the price.

Which Claude model does Claude Code use by default?

Opus 5.5 on Pro, Max, Ultra, Team, Enterprise, the Anthropic API, Bedrock, Google Cloud and Claude Platform on AWS. Microsoft Foundry defaults to Sonnet 4.5.

Is Haiku good enough for coding?

For small edits, scripts, renames and sub-agent work, yes. For big refactors or tricky bugs, use Opus or Sonnet.

What is opusplan in Claude Code?

A setting that uses Opus while planning and switches to Sonnet to write the code, balancing quality and cost.

Do all Claude models have a 1M context window?

Yes. Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5 all have 1M token context windows and 128K max output on the Claude API.

What effort level should I use for coding?

Medium for features, high for bug fixes, xhigh or max for very hard problems. Low for quick edits you review yourself.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Worried woman with long braids in an orange jacket holding a card with the Claude logo, with the hook text Which Claude codes best?