Quick Answer
Claude Code ships with three models. Default to Sonnet 4.6 for everything. Switch to Opus 4.6 when you need deep architectural reasoning or hit a problem Sonnet can't solve. Use Haiku 4.5 for simple cleanup tasks where speed matters more than intelligence.
70% of developers prefer Sonnet 4.6 over the previous flagship Sonnet 4.5. 59% prefer it over Opus 4.5. The newer Sonnet delivers what used to require the top-tier model.
The short version
Sonnet 4.6 handles 80-90% of coding tasks at Opus-level quality for 60% less cost. The hybrid approach (Sonnet default, Opus escalation) is now standard across production teams. Use /model to switch mid-session.
Benchmark Comparison
SWE-bench Verified tests whether a model can resolve real GitHub issues across production codebases. It is the closest proxy we have for real-world coding ability. Here is how the Claude models compare, alongside competitors:
| Model | SWE-bench Verified | Terminal-Bench 2.0 | HumanEval |
|---|---|---|---|
| Claude Opus 4.6 | 80.8% | 65.4% | ~96% |
| Claude Sonnet 4.6 | 79.6% | ~60% | ~95% |
| Claude Haiku 4.5 | ~40% | N/A | 88.1% |
| GPT-5.3-Codex | ~80.2% | ~62% | ~95% |
| Gemini 3.1 Pro | ~79.8% | ~58% | ~94% |
The top three frontier models (Opus, GPT-5.3-Codex, Gemini 3.1 Pro) now cluster within 1 point of each other on SWE-bench. The benchmark alone no longer differentiates them. Cost, speed, and tool integration matter more.
Where Opus does separate itself: Terminal-Bench 2.0 (65.4% vs Opus 4.5's 59.8%) and OSWorld for agentic computer use (72.7% vs 66.3%). Both measure multi-step agentic reasoning, exactly the scenario where Opus's extra inference cost pays off.
Pricing Per Model
You access Claude Code models through either a subscription plan or API key. Subscription costs are fixed monthly. API costs scale with token usage.
API Pricing (per million tokens)
| Model | Input | Output | Batch (50% off) |
|---|---|---|---|
| Opus 4.6 | $5.00 | $25.00 | $2.50 / $12.50 |
| Opus 4.6 (fast mode) | $30.00 | $150.00 | N/A |
| Sonnet 4.6 | $3.00 | $15.00 | $1.50 / $7.50 |
| Haiku 4.5 | $1.00 | $5.00 | $0.50 / $2.50 |
Subscription Plans
| Plan | Monthly Cost | Models Included | Usage Level |
|---|---|---|---|
| Pro | $20/month | Sonnet 4.6, Haiku 4.5 | Standard Claude Code access |
| Max 5x | $100/month | Sonnet 4.6, Opus 4.6, Haiku 4.5 | 5x Pro usage |
| Max 20x | $200/month | Sonnet 4.6, Opus 4.6, Haiku 4.5 | 20x Pro usage, 1M context (beta), agent teams |
| Team | $125/seat/month | All models | Higher limits, admin controls |
| Enterprise | Custom | All models | SSO, SCIM, audit logs, SLA |
The Pro plan at $20/month is the entry point. It includes Sonnet and Haiku but not Opus. To use Opus in Claude Code, you need Max ($100 or $200/month) or an API key with direct billing.
Cost math
A typical Sonnet coding session uses 20,000-50,000 input tokens and 5,000-15,000 output tokens. At API rates, that is $0.14-$0.37 per session. An Opus session of the same size costs $0.23-$0.63. Over 20 working days, daily Sonnet use costs $2.80-$7.40/month at API rates, well below the $20 Pro plan. The subscription makes sense if you code more than 3-4 sessions per day.
Speed Comparison
Output speed determines how long you wait for Claude Code to finish generating. In an agentic workflow where the model makes multiple tool calls per task, a 2x speed difference compounds across 10-20 steps.
| Model | Output Speed (tok/s) | TTFT | Best Provider |
|---|---|---|---|
| Haiku 4.5 | ~80-100 | ~0.3s | Anthropic API |
| Sonnet 4.6 | 48-73 | ~0.5s | Amazon Bedrock (73 tok/s) |
| Opus 4.6 | ~30-40 | ~0.8s | Anthropic API |
| Opus 4.6 (fast) | ~60-80 | ~0.4s | Anthropic API (6x cost) |
Sonnet is 1.5-2x faster than Opus at standard pricing. Haiku is roughly 2x faster than Sonnet. For a 20-step agentic task where each step generates 500 tokens, the total wait time difference between Sonnet (~140s) and Opus (~250s) is nearly two minutes. That adds up across a workday.
When to Use Opus 4.6
Opus costs 67% more than Sonnet per token and runs 1.5-2x slower. It earns that premium in specific scenarios:
- Multi-file architectural refactors spanning 10+ files where the model needs to hold the entire dependency graph in working memory
- Complex debugging involving concurrency, race conditions, or subtle state management bugs that require reasoning across multiple execution paths
- First-attempt correctness on tasks where iteration is expensive (production deployments, database migrations)
- Layered architectural decisions where the model needs to surface tradeoffs before writing code (modular auth systems, backward-compatible API changes)
- Agent orchestration tasks where Opus coordinates multiple sub-agents or manages multi-step plans with branching logic
One developer put it well: "Opus catches rebuild issues, missing disposes, and async bugs that Sonnet completely skips. When you are close to shipping, Opus is worth the wait."
When to Use Sonnet 4.6
Sonnet 4.6 is the daily driver. It handles the work that used to require Opus 4.5:
- Feature development: REST endpoints, frontend components, database schemas, utility functions
- Code review and refactoring within a single module or 2-5 files
- Writing tests: unit, integration, and e2e test generation
- Bug fixes with clear reproduction steps
- Documentation generation from code
- Iterative development where you plan to review and refine the output over multiple rounds
Sonnet 4.6 is widely praised for frontend work. Multiple developers report it generates "pixel-perfect layouts" and handles state management, API integration, and component composition without needing Opus-level reasoning.
When to Use Haiku 4.5
Haiku costs 80% less than Sonnet and runs 2x faster. Its coding ability is limited (88.1% HumanEval vs Sonnet's 95%), but it excels at tasks that are well-defined and repetitive:
- Generating boilerplate code from templates
- Formatting and linting operations
- Simple file operations (rename, move, create from pattern)
- Writing test stubs with obvious assertions
- Commit message generation
- Quick explanations of code snippets
Do not use Haiku for multi-file reasoning, complex debugging, or tasks where the model needs to infer intent from ambiguous instructions. It will produce output quickly, but that output will often miss edge cases or architectural concerns that Sonnet catches.
How to Switch Models in Claude Code
Four ways to set your model, in order of priority (highest first):
1. Mid-session: /model command
Switch model during a session
# Type in the Claude Code prompt:
/model
# Or specify directly:
/model opus
/model sonnet
/model haiku2. At launch: CLI flag
Start with a specific model
claude --model opus
claude --model sonnet
claude --model haiku3. Environment variable
Set default model via env
export ANTHROPIC_MODEL=claude-opus-4-6
# Or for a specific session:
ANTHROPIC_MODEL=claude-opus-4-6 claude4. Settings file
Add "model": "claude-opus-4-6" to your Claude Code settings file for a permanent default. The /model command and CLI flag override this.
Model aliases
Aliases like opus, sonnet, and haiku always point to the latest version. To pin to a specific release, use the full model ID: claude-opus-4-6, claude-sonnet-4-6, or claude-haiku-4-5-20251001.
The Hybrid Workflow
The most cost-effective approach is not picking one model. It is switching between them based on task complexity. This workflow is now standard across production teams:
Phase 1: Explore with Sonnet
Start every task with Sonnet 4.6. Read code, understand the problem, draft an initial approach. Sonnet handles this at full speed for 60% less.
Phase 2: Escalate to Opus
When you hit a complex architectural decision or a bug Sonnet can't crack, type /model opus. Let Opus reason through the hard part.
Phase 3: Clean up with Haiku
Formatting, boilerplate, simple file ops. Switch to /model haiku for the mechanical cleanup work where speed beats intelligence.
The opusplan alias
Claude Code includes a built-in version of this workflow. The opusplan alias uses Opus for planning and reasoning during plan mode, then automatically switches to Sonnet for code generation. Activate it with:
Activate opusplan
/model opusplanThis gives you Opus-level architectural thinking during the planning phase while keeping generation costs at Sonnet rates. Teams using this pattern report 60-80% cost savings compared to running Opus for everything, with minimal quality loss on the implementation step.
Using Non-Anthropic Models with Claude Code
Claude Code is not locked to Anthropic models. You can route it through OpenRouter or Claude Code Router to use any model.
OpenRouter setup
Route Claude Code through OpenRouter
export ANTHROPIC_BASE_URL=https://openrouter.ai/api
export ANTHROPIC_API_KEY=your-openrouter-key
# Override specific model slots:
export ANTHROPIC_DEFAULT_SONNET_MODEL=openai/gpt-5.3-codex
export ANTHROPIC_DEFAULT_OPUS_MODEL=google/gemini-3.1-pro
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek/deepseek-v4This gives you Claude Code's agentic workflow (tool use, file editing, terminal commands) powered by any of OpenRouter's 320+ models. Useful when a specific model handles your language or framework better, or when you want to compare providers.
Claude Code Router (open-source proxy)
For local models (Ollama, LM Studio, llama.cpp) or direct provider access without OpenRouter as intermediary, the open-source Claude Code Router project supports 8+ providers including DeepSeek, Gemini, VolcEngine, and SiliconFlow. It adds dynamic model switching with /model provider,model_name syntax and context-based routing.
Performance caveat
Claude Code's tool-use protocol is optimized for Anthropic models. Non-Anthropic models work, but you may see reduced tool-call accuracy, especially with complex multi-step operations. Test thoroughly before relying on non-Anthropic models for production workflows.
What Developers Actually Say
Benchmark scores tell one story. Developer experience tells another. Here is what the community reports:
"Default to Sonnet for everything. Escalate to Opus only when you need the deepest reasoning or multi-agent coordination."
"Opus found rebuild issues, missing disposes, and async bugs that Haiku and Sonnet completely skipped. When close to release, Opus is worth the wait."
"Sonnet 4.6 generates pixel-perfect layouts. For frontend work, I never touch Opus anymore."
"The hybrid approach works. Sonnet handles 80-90% of my daily coding. Opus steps in for the hard 10%. My monthly bill dropped from $200 to about $60."
"Haiku is the sprinter, Sonnet is the steady builder, Opus is the careful reviewer. Use all three."
The consistent pattern: developers who initially used Opus for everything switched to the hybrid model once they saw Sonnet 4.6's quality. The 1.2-point SWE-bench gap does not justify a 67% cost premium for most tasks.
Frequently Asked Questions
What is the best model for Claude Code in 2026?
Sonnet 4.6 is the best default for most developers. It scores 79.6% on SWE-bench Verified (1.2 points below Opus 4.6's 80.8%) at 60% lower cost. Escalate to Opus 4.6 for multi-file architectural refactors, deep debugging, or tasks requiring layered reasoning across large codebases.
How do I switch models in Claude Code?
Type /model in the Claude Code prompt to open an interactive model selector. You can also launch with claude --model opus or claude --model sonnet, set the ANTHROPIC_MODEL environment variable, or configure it permanently in your settings file. Changes take effect immediately, no restart needed.
Can Claude Code use non-Anthropic models?
Yes. Set ANTHROPIC_BASE_URL to https://openrouter.ai/api and pass your OpenRouter API key as ANTHROPIC_API_KEY. This routes Claude Code through OpenRouter, giving access to 320+ models including GPT-5.3, Gemini 3.1 Pro, and DeepSeek V4. You can also use Claude Code Router, an open-source proxy, for providers like Ollama or DeepSeek directly.
Is Claude Opus 4.6 worth the extra cost for coding?
For most tasks, no. Sonnet 4.6 handles 80-90% of coding work at Opus-level quality. Opus is worth it for complex multi-step reasoning, architectural decisions spanning 10+ files, debugging concurrency issues, and tasks where the first attempt must be correct. Teams using the hybrid approach (Sonnet by default, Opus for hard problems) report 60-80% cost savings with minimal quality loss.
What Claude model does the Max $200/month plan include?
The Max $200/month plan includes 20x Pro usage limits, access to Claude Opus 4.6, the 1M token context window (beta), and agent teams for multi-agent collaboration. The Max $100/month plan offers 5x Pro usage. The Pro plan at $20/month is the entry point for Claude Code with standard Sonnet access.
How fast is each Claude model in Claude Code?
Haiku 4.5 is the fastest at roughly 80-100 tokens per second. Sonnet 4.6 generates around 48-73 tokens per second depending on provider (fastest on Amazon Bedrock at 73 tok/s). Opus 4.6 is the slowest at approximately 30-40 tokens per second, though it offers a fast mode at 6x API pricing for latency-sensitive workloads.
What is the opusplan mode in Claude Code?
The opusplan alias uses Opus for planning and reasoning during plan mode, then automatically switches to Sonnet for code generation and implementation. This gives you Opus-level architectural thinking for the planning phase while keeping generation costs at Sonnet rates. Activate it with /model opusplan.
Does Claude Haiku 4.5 work well for coding in Claude Code?
Haiku 4.5 works for simple, well-defined tasks: generating boilerplate, formatting code, running straightforward file operations, and writing test stubs. It scores 88.1% on HumanEval. It struggles with multi-file reasoning, complex debugging, and tasks requiring deep architectural understanding. Use it for cleanup work, not feature development.
What SWE-bench scores do the Claude models get?
Opus 4.6 scores 80.8% on SWE-bench Verified. Sonnet 4.6 scores 79.6%. For context, GPT-5.3-Codex scores approximately 80.2% and Gemini 3.1 Pro scores approximately 79.8%. All frontier models now cluster within 1-2 points of each other on this benchmark, making cost and speed the main differentiators.
Should I use the Claude API or a subscription plan for Claude Code?
Claude Code requires a subscription (Pro at $20/month minimum) or API key. With an API key, you pay per token: Opus at $5/$25 per million tokens, Sonnet at $3/$15, Haiku at $1/$5. If you use Claude Code fewer than 15-20 hours per month, the API may be cheaper. Heavy daily users benefit from the Pro or Max plans where usage is included.
Building on top of Claude Code? Morph applies edits at 10,500 tok/s.
If you are building a coding agent or editor that uses Claude as the brain, Morph handles the code-edit application layer. One API call, sub-50ms latency, works with any model output.