Claude Code Model Selection: Opus 5, Sonnet 5, Fable 5, and Haiku
The best Claude model for coding is Opus 5. When Sonnet 5 is enough, when Fable 5 earns its price, and how effort and weekly limits change it.
Agentic Orchestration Kit for Claude Code.
Claude Code model selection got cheaper on July 24, 2026. Opus 5 shipped at $5 per million input tokens and $25 per million output, unchanged from Opus 4.8, and it is now the default model on Claude Max and the strongest model available on Claude Pro. The rule this page used to give, default to Sonnet and escalate to Opus only when you must, was built on a price gap that has since collapsed.
The best Claude model for coding today is Opus 5, and on a subscription it costs you nothing extra to use it. On the API it runs $5/$25 against Sonnet 5's $3/$15 standard rate, a 1.67x gap rather than the 5x premium that used to justify rationing it.
Three things decide the answer now instead of one: which model you ask, how hard you tell it to think, and how much of your weekly allowance the choice burns. This guide covers all three.
The Current Claude Code Lineup
Four models are worth knowing by name. Everything else in the picker is a previous generation you can still pin.
| Model | API ID | Standard rate per 1M | Reach for it when |
|---|---|---|---|
| Opus 5 | claude-opus-5 | $5 in / $25 out | Default for agentic coding, long autonomous runs, architecture, and hard debugging |
| Sonnet 5 | claude-sonnet-5 | $3 in / $15 out | Volume work where price per call decides, and every sub-agent doing mechanical passes |
| Fable 5 | claude-fable-5 | $10 in / $50 out | A measured exception, not an upgrade path. Select with /model fable |
| Haiku 4.5 | claude-haiku-4-5 | $1 in / $5 out | File reads, formatting, routine lookups, background tasks |
Sonnet 5 runs an introductory $2/$10 through August 31, 2026, then moves to the standard $3/$15. Fable 5's $10/$50 is exactly double Opus 5 on both meters, which is the single most important number on this page.
Two things about the Haiku row are easy to miss. Anthropic's models overview lists Haiku 4.5 as the current Haiku, but the haiku alias itself is documented only as "the fast and efficient Haiku model," with no version guarantee, so pin claude-haiku-4-5 when the version matters. And Haiku 4.5 carries a 200K context window, not 1M, with a February 2025 knowledge cutoff and no effort-level support at all. It is a different shape of model from the other three, not just a cheaper one.
Model Aliases
Claude Code provides model aliases so you don't need to remember exact version numbers. These are the shortcuts you'll use daily:
| Alias | Behavior |
|---|---|
default | Clears any model override and reverts to the recommended model for your account type |
best | Uses Fable 5 where your organization has access to it, otherwise the latest Opus model |
fable | Uses Fable 5 for your hardest, longest-running tasks |
sonnet | Latest Sonnet model for daily coding tasks |
opus | Latest Opus model for complex reasoning tasks |
haiku | Fast and efficient Haiku model for simple tasks |
sonnet[1m] | Sonnet with a 1M-token context window |
opus[1m] | Opus with a 1M-token context window |
opusplan | Uses opus during plan mode, then switches to sonnet for execution |
best is the alias almost nobody uses and probably should. It resolves to Fable 5 where your organization has access to it and falls back to the latest Opus model otherwise, which makes it the one setting that stays correct across a mixed team where some seats have Fable access and some do not. Set it once instead of maintaining two configs.
default is not itself a model alias. It is a special value that clears an override and reverts to the recommended model for your account type, and what that resolves to varies more than most people expect:
| Account type | default resolves to |
|---|---|
| Max, Team Premium, Enterprise pay-as-you-go, Anthropic API | Opus 5 |
| Claude Platform on AWS, Amazon Bedrock, Google Cloud Agent Platform | Opus 5 |
| Pro, Team Standard, Enterprise subscription seats | Sonnet 5 |
| Microsoft Foundry | Sonnet 4.5 |
If an admin has set an organization default model, default resolves to that instead.
The Aliases Do Not Mean the Same Thing on Every Provider
This is the detail that quietly breaks routing advice copied between teams. opus and sonnet point at the newest model your provider offers, not the newest model Anthropic has shipped:
| Provider | opus | sonnet |
|---|---|---|
| Anthropic API | Opus 5 | Sonnet 5 |
| Claude Platform on AWS | Opus 5 | Sonnet 4.6 |
| Amazon Bedrock, Google Cloud Agent Platform | Opus 5 | Sonnet 4.5 |
| Microsoft Foundry | Opus 4.6 | Sonnet 4.5 |
So --model sonnet on Bedrock gets you Sonnet 4.5, two generations behind what the same flag gets you on the Anthropic API. Where an alias resolves to an older model, select the full model name explicitly or set ANTHROPIC_DEFAULT_OPUS_MODEL or ANTHROPIC_DEFAULT_SONNET_MODEL. Aliases update over time by design, so pin the full name whenever you need a specific version:
Fable 5 is not the default on any account type. You get it by choosing it, with /model fable, the model setting, or the best alias. On the Anthropic API the /model picker lists Fable 5 only once the server reports it available for your organization, but typing /model fable checks availability directly, so the selection can succeed before the picker shows the row. Under zero data retention the picker omits Fable 5 or shows it disabled.
Version floors matter here more than usual, because an out-of-date client silently hides models rather than erroring: Opus 5 needs Claude Code v2.1.219 or later, Sonnet 5 needs v2.1.197, and Fable 5 needs v2.1.170. Run claude update if a model you expect is missing from the picker.
The 1M-token context window is now standard rather than special. On the Anthropic API, Fable 5, Sonnet 5, and Opus 4.7 and later always run with the 1M window, and on Sonnet 5 there is no 200K variant and no [1m] suffix to select: the alias has no effect because the native window is already 1M. On Max, Team, and Enterprise plans Opus is automatically upgraded to 1M with no configuration, while Pro reaches it through usage credits. The window carries no pricing premium beyond 200K.
Every current model defaults to high effort in Claude Code, Opus 5 and Fable 5 included. The xhigh default belonged to Opus 4.7 alone and did not carry forward to later releases. Anthropic's guidance for Opus 5 is to start at xhigh for coding and agentic work, which now means opting in deliberately rather than inheriting it. The ultracode and effort ladder guide covers every rung, what each one costs, and why low and medium are worth more on Opus 5 than they were on earlier Opus models.
The Smart Model Strategy
Most developers still route by an old price ratio. Opus used to cost five times Sonnet, so rationing it made obvious sense. At $5/$25 against $3/$15, the ratio is 1.67x and the routing question changes shape: you are no longer buying reasoning depth at a steep premium, you are deciding where throughput and per-call price actually matter.
Opus 5: The Default, Not the Escalation
Best for: most real development work
Use Opus 5 for:
- Agentic coding sessions that run unattended for more than a few minutes
- Large-scale refactoring across multiple systems
- Complex debugging with intricate dependencies
- Architectural decisions requiring deep reasoning
- Advanced security reviews and code auditing
Why the default moved: Opus 5 scores 43.3 on Frontier-Bench v0.1 against Opus 4.8's 18.9, takes GDPval-AA v2, OSWorld 2.0, and AutomationBench outright, and posts 30.2 on ARC-AGI-3 where Opus 4.8 managed 1.5. It did that at the same price Opus 4.8 charged. On a Max plan it is simply the model you get, and on Pro it is the strongest model your subscription includes at no per-token cost.
Cost reality: $5/$25 is 1.67x Sonnet 5's standard $3/$15, and 2.5x during Sonnet 5's introductory window through August 31, 2026. That is a real gap on high-volume API pipelines and close to irrelevant on a subscription.
One behavior change matters for routing. Opus 5 verifies its own work unprompted and delegates to sub-agents more readily than earlier models. If your prompts still carry "include a final verification step" or "use a sub-agent to verify," remove them: they compound with behavior the model already has and cost tokens for no quality gain.
Sonnet 5: The Volume Play
Best for: work where price per call is the deciding variable
Perfect for:
- Mechanical passes: applying a spec verbatim, string swaps, config churn
- Sub-agents doing execution while a stronger model plans
- High-frequency automation and batch jobs
- Test writing, documentation, and routine feature work
Where it actually sits: Sonnet 5 scores 63.2% on SWE-bench Pro against Opus 4.8's 69.2%, and edges past Opus 4.8 on knowledge work. Anthropic has not published a Sonnet 5 versus Opus 5 head-to-head, and Opus 5 more than doubled Opus 4.8 on Frontier-Bench, so assume the gap to Opus 5 is wider than the six points Sonnet 5 gives up to Opus 4.8, not narrower. Sonnet 5 is the right model when that gap costs you less than the token bill does.
This is also the model that belongs on your sub-agents. Pairing a strong planner with cheaper workers is the highest-leverage routing decision most teams make, and the sub-agent best practices guide covers the CLAUDE_CODE_SUBAGENT_MODEL configuration that sets it.
Fable 5: The Measured Exception
Best for: workloads you have benchmarked and found Opus 5 short on
Fable 5 costs $10/$50, exactly double Opus 5, and it loses seven of the eight quantified head-to-head evals against it. What it keeps is narrow: CursorBench 3.2 by three tenths of a point at roughly twice the spend, the Mythos-class ceiling on offensive cyber and autonomous biology that its own classifiers block for most users, and a set of long-horizon partner evals from its June launch that Anthropic has not re-run against Opus 5.
Two operational details decide it more often than any score. Fable 5 carries mandatory 30-day data retention on all Mythos-class traffic, overriding zero-retention agreements your legal team already signed. And Anthropic expects Opus 5's cyber classifiers to intervene roughly 85% less often than Fable 5's, a gap that lands hardest on exactly the security-research and life-sciences work that justified paying double in the first place. The full breakdown is in Opus 5 vs Fable 5.
Treat Fable 5 as a workload-specific exception you have measured, not a general-purpose upgrade.
Haiku 4.5: The Speed Tier
When to downgrade: simple, repetitive tasks
Perfect for:
- Simple file reads and formatting
- Basic syntax validation
- Quick status checks
- Text transformations and background functionality
Warning: Don't use Haiku for actual development. It struggles with complex logic and multi-file projects. Its real job on a modern setup is background work and the ANTHROPIC_DEFAULT_HAIKU_MODEL slot, not your main thread.
Opusplan: Plan Expensive, Execute Cheap
When to use: sessions that mix heavy planning with mechanical implementation
How it works:
- In plan mode: uses Opus for complex reasoning and architecture decisions
- In execution mode: automatically switches to Sonnet for code generation and implementation
This is the model-tier split expressed as a single alias: the expensive model decides, the cheap model types. It is an excellent choice for refactoring sessions, feature planning, and any workflow where you use planning mode regularly, and it remains a strong cost optimization strategy because you only pay Opus rates during the planning phase.
The economics of that split are worth understanding before you apply it manually across sub-agents, because the coordination cost is real and not always worth paying. The usage optimization guide has the numbers.
Your Weekly Allowance Is Now Part of the Decision
In 2025, model selection was a pure quality-versus-price question. On a subscription in 2026 it has a quota dimension too, because one model in the lineup carries a ceiling the others don't.
On Max plans and premium seats on Team and seat-based Enterprise, Fable 5 is included up to 50% of your weekly usage limits, and it counts against the same bucket everything else draws from. A Fable session weighs roughly double an Opus session against that bucket. On Pro plans and standard seats, Fable 5 is not included at all: it runs on prepaid usage credits billed at API rates.
Three consequences follow, and they change how you route:
- Fable 5 can run out while Opus 5 still has headroom. Hitting the 50% cap does not end your week, it ends your Fable access. Switching to Opus 5 with
/model claude-opus-5is the recovery, not waiting for a reset. - Fable costs double on whichever meter you are actually billed by. On the API that is 2x the token rate. On a Max plan you are not billed per token at all, so the cost shows up as roughly 2x the weekly allowance per session, which means you reach the 50% cap in about half the sessions you would expect from the headline number.
- Opus 5 has no per-model ceiling. On Max it is the default, and it draws on your weekly allowance like any other model.
The Fable 5 pricing and usage-credits guide covers the credit mechanics, the exact terminal strings Claude Code shows when you hit the cap, and what to switch to. For the plan-level limits themselves, see higher usage limits.
Tactical Model Switching
The ClaudeFast approach: start on Opus 5, drop down for volume, and pin the tier that fits each phase of the work.
During Development Sessions
Cost Optimization Pattern
- Default: Opus 5, because on a subscription it is free to you and on the API it is 1.67x Sonnet, not 5x
- Hybrid: use
opusplanfor sessions that mix planning and implementation - Delegate: put Sonnet 5 on sub-agents doing execution while the main thread plans
- Downgrade: Haiku for file operations and background work
- Escalate: reach for Fable 5 only on workloads you have measured, and watch the 50% weekly cap
- Monitor: run
/statusand track which tier is actually consuming your allowance
The savings no longer come from avoiding Opus. They come from not running Opus on work a cheaper tier finishes identically, which is a routing problem rather than a rationing one.
Model Selection by Task Type
Reasoning Quality Rankings
- Fable 5: the Mythos-class ceiling, and the only tier above Opus 5 on published evals in a single narrow benchmark. See how to prompt Fable 5 once you have picked it.
- Opus 5: superior for complex multi-step problems, and the practical top of the lineup
- Sonnet 5: excellent for most development scenarios
- Haiku 4.5: basic reasoning only
Cost Efficiency Rankings
- Haiku 4.5: cheapest per task, limited capability
- Sonnet 5: best throughput per dollar on high-volume work
- Opus 5: best result per dollar on anything hard, and the reason the old ranking flipped
- Fable 5: double the rate and double the weekly weight for a narrow capability edge
Speed Rankings
- Haiku 4.5: instant but shallow
- Sonnet 5: fast with excellent depth
- Opus 5: slower per token, but Fundamental Labs reported it averaging a third fewer turns and tool calls than Opus 4.8 on their hardest financial-modeling tasks, which can make it faster end to end
Model Configuration
Claude Code gives you multiple ways to set your model, with a clear priority chain. Higher-priority settings override lower ones:
- During session -
/model <alias|name>switches models mid-session (highest priority) - At startup -
claude --model <alias|name>sets the model for that session - Environment variable -
ANTHROPIC_MODEL=<alias|name>persists across sessions - Settings file - The
modelfield in settings.json for permanent configuration (lowest priority)
For permanent model configuration, add the model field to your settings file:
This eliminates the need to pass --model every time you start Claude Code. ClaudeFast's Code Kit includes model routing configuration that applies these selection strategies automatically, so mechanical work lands on cheaper tiers and heavy work escalates without you deciding on every prompt.
Controlling Which Models Aliases Map To
If you need to override which actual model an alias points to (for example, to pin a specific version or use a Bedrock/Vertex deployment), use these environment variables:
| Environment Variable | Controls |
|---|---|
ANTHROPIC_DEFAULT_FABLE_MODEL | Model used for fable, and the ID recognized as Fable 5 for automatic fallback |
ANTHROPIC_DEFAULT_OPUS_MODEL | Model used for opus, and for opusplan during plan mode |
ANTHROPIC_DEFAULT_SONNET_MODEL | Model used for sonnet, and for opusplan during execution |
ANTHROPIC_DEFAULT_HAIKU_MODEL | Model used for haiku and background functionality |
CLAUDE_CODE_SUBAGENT_MODEL | Model used for all sub-agents, agent teams, and the agents a workflow runs |
The deprecated ANTHROPIC_SMALL_FAST_MODEL variable has been replaced by ANTHROPIC_DEFAULT_HAIKU_MODEL.
These are especially useful for Bedrock, Foundry, and Vertex users who need to specify inference profile ARNs, deployment names, or version names instead of standard Anthropic model IDs.
CLAUDE_CODE_SUBAGENT_MODEL is the one worth setting deliberately rather than leaving at its default, because it decides the tier for every delegated pass in your session. It accepts an alias or a full model name, it overrides both the per-invocation model parameter and a sub-agent definition's model frontmatter, and setting it to inherit returns to normal model resolution. That override precedence is the part that surprises people: a carefully tuned per-agent model choice loses to this variable. The sub-agent best practices guide covers how to pick the value and what it costs either way.
When Claude Code Switches Models on You
Two mechanisms move you off your chosen model, and neither is triggered by usage limits.
Content-based fallback. Fable 5 and Opus 5 run safety classifiers for cybersecurity and biology. On Fable 5, biology-flagged requests re-run on Opus 5 and cybersecurity-flagged requests re-run on Opus 4.8. On Opus 5, cybersecurity-flagged requests re-run on Opus 4.8, while biology-flagged requests end in a refusal because Opus 5 runs its own biology classifiers with no fallback target. After a fallback the session stays on the fallback model, so run /model to return.
Availability-based fallback chains. You can configure these yourself with --fallback-model sonnet,haiku or a fallbackModel array in settings, and they fire when the primary model is overloaded or unavailable. Authentication, billing, rate-limit, request-size, and transport errors explicitly never trigger a switch.
The practical consequence for routing: a repository containing security or biology material can trip the classifier on the first request of a session, before you type anything unusual, because that request carries your CLAUDE.md and git status. If a session keeps landing on a fallback model, claude --safe-mode disables customizations so you can tell whether your own config is the trigger.
Checking Your Current Model
You can see which model you're currently using in two ways:
- Run
/statusto display your current model and account information - Configure a StatusLine to show the model persistently in your terminal
Prompt Caching Configuration
Claude Code automatically uses prompt caching to optimize performance and reduce costs. If you need to disable it (for debugging, benchmarking, or specific API configurations), use these environment variables:
| Environment Variable | Effect |
|---|---|
DISABLE_PROMPT_CACHING | Disables caching for all models (overrides per-model) |
DISABLE_PROMPT_CACHING_HAIKU | Disables caching for Haiku models only |
DISABLE_PROMPT_CACHING_SONNET | Disables caching for Sonnet models only |
DISABLE_PROMPT_CACHING_OPUS | Disables caching for Opus models only |
DISABLE_PROMPT_CACHING_FABLE | Disables caching for Fable models only |
Set any of these to 1 to disable. The global DISABLE_PROMPT_CACHING takes precedence over per-model settings. Disabling prompt caching increases costs and latency, so only do this when you have a specific reason.
One Opus 5 detail is easy to miss here: the minimum cacheable prompt dropped to 512 tokens, down from 1,024 on Opus 4.8. Short system prompts that were previously too small to cache now create cache entries with no code changes on your side.
Common Model Selection Mistakes
Mistake 1: Routing by the old 5x price rule
- Problem: rationing Opus 5 as if it still cost five times Sonnet sends hard work to a weaker model for a 1.67x saving that a subscription does not even charge you
- Solution: default to Opus 5 and drop to Sonnet 5 where volume, not capability, is the constraint
Mistake 2: Treating Fable 5 as the upgrade path
- Problem: 2x the token rate, roughly 2x the weekly weight, and a loss on seven of eight published head-to-head evals
- Solution: benchmark your own workload first. If Opus 5 matches it, the answer is Opus 5
Mistake 3: Staying on Haiku too long
- Problem: poor code quality, missed issues
- Solution: upgrade to Sonnet 5 for any real development
Mistake 4: Leaving sub-agents on the same tier as your main thread
- Problem: every delegated pass bills at the expensive rate, including the mechanical ones
- Solution: set
CLAUDE_CODE_SUBAGENT_MODELso execution lands on Sonnet 5 while the main thread plans
Mistake 5: Not switching models mid-session
- Problem: using the wrong model for the current phase of the work
- Solution:
/model claude-opus-5and/model claude-sonnet-5switch instantly
Frequently Asked Questions
Which Claude model should I use in Claude Code?
Opus 5 for anything that requires judgment, Sonnet 5 for volume and for sub-agents doing execution, Haiku 4.5 for file operations and background work, and Fable 5 only for a workload you have benchmarked and found Opus 5 short on. On a Max plan Opus 5 is already your default, so for most people the answer is to leave it alone and drop down deliberately rather than escalate.
What is the best Claude model for coding?
Opus 5. It scores 43.3 on Frontier-Bench v0.1 against Opus 4.8's 18.9 at the same $5/$25 price, wins seven of the eight published head-to-head evals against the twice-as-expensive Fable 5, and is included at no per-token cost on both Max and Pro. The only model ahead of it on any published coding benchmark is Fable 5, by three tenths of a point on CursorBench 3.2, at double the rate.
How do I switch models in Claude Code?
Run /model claude-opus-5 mid-session, or claude --model claude-opus-5 at startup. To make it permanent, run claude config set model claude-opus-5 or set the model field in your settings file. Session-level choices always win over the settings file.
Does Claude Code pick a model automatically?
Partly. The default alias resolves to the recommended model for your account type, which is Opus 5 on Max and the Anthropic API and Sonnet 5 on Pro and Team Standard. The best alias resolves to Fable 5 where your org has access and the latest Opus otherwise. And opusplan automates a split rather than a choice: Opus during plan mode, Sonnet during execution. Claude Code will also move you off your model when a safety classifier flags a request, but never because you approached a usage limit. Everything else is your call, which is why setting CLAUDE_CODE_SUBAGENT_MODEL deliberately matters.
Is Opus 5 worth it over Sonnet 5?
On a subscription there is nothing to weigh: Opus 5 is the default on Max and the strongest model on Pro, at no extra usage cost. On the API it costs 1.67x Sonnet 5's standard rate, so the question is whether your workload is bounded by capability or by throughput. High-volume mechanical passes stay on Sonnet 5. Anything where a wrong answer costs more than the token difference goes to Opus 5.
Which model do sub-agents use?
Whatever CLAUDE_CODE_SUBAGENT_MODEL points at, which is the most under-set variable in most Claude Code configs. Leaving it at your main-thread tier means every delegated mechanical pass bills at the expensive rate. The sub-agent best practices guide covers how to choose the value.
What happens when I run out of Fable 5?
On Max and premium seats, Fable 5 is capped at 50% of your weekly usage limits. Hitting that cap does not end your week, it ends your Fable access, and Claude Code prompts you to switch models. Run /model claude-opus-5 and keep working. The Fable 5 pricing and usage-credits guide covers the exact messages and the credit path on Pro.
Quick Reference
| Task Type | Recommended Model | Why |
|---|---|---|
| Daily coding | Opus 5 | Default on Max, strongest on Pro, no per-token penalty |
| High-volume API pipelines | Sonnet 5 | $3/$15 standard, and $2/$10 through August 31, 2026 |
| Plan plus implement | opusplan | Opus reasoning for plans, Sonnet for code |
| Sub-agents doing execution | Sonnet 5 | Set via CLAUDE_CODE_SUBAGENT_MODEL |
| Complex architecture | Opus 5 | Maximum reasoning depth at the standard Opus rate |
| Simple file ops | Haiku 4.5 | Fast and cheap |
| A benchmarked Fable workload | Fable 5 | Only with the 50% weekly cap and 2x rate accounted for |
| Debugging | Opus 5, drop when it's easy | Progressive de-escalation beats progressive escalation now |
For beginners: start on Opus 5. It is what your plan gives you, and it makes fewer mistakes to learn from.
For daily development: Opus 5 on the main thread, Sonnet 5 on sub-agents.
For budget optimization: route by phase, not by fear. Mechanical passes go to Sonnet 5, decisions stay on Opus 5.
For learning: check our configuration guide to set up model defaults.
The model you pick decides who is answering. The effort level you set decides how long they work on it. Getting both right is worth more than getting either one perfect.
Next Action: set your default with claude config set model claude-opus-5, then set CLAUDE_CODE_SUBAGENT_MODEL to Sonnet 5 so delegated work stops billing at the top rate. The usage optimization guide covers what that split actually saves.
For detailed specs on every Claude model Anthropic has released, see the complete model timeline.
Related Guides:
- Claude Opus 5 - benchmarks, pricing, and the prompt changes it needs
- Opus 5 vs Fable 5 - the head-to-head, and whether Fable 5 still has a job
- Ultracode and the effort ladder - the other half of the routing decision
- Deep Thinking Techniques - when to use extended thinking
- Usage Optimization - track and reduce your costs
- Context Management - keep long sessions inside the window you're paying for
- Speed Optimization - what to tune once the model is right
- Efficiency Patterns - build frameworks for consistent output
Last updated on