Choosing Your Model
Level: 🌱 Beginner Source: Model Config, Fast Mode
← Back to Automating Your Workflows
Claude Code lets you switch between models at any time. Each model has different strengths in speed, cost, and reasoning depth. Additionally, Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6 support effort levels that control how much thinking the model does before responding.
The Models at a Glance
| Model | Speed | Reasoning | Cost | Best for |
|---|---|---|---|---|
| Haiku | Fastest | Good | Lowest | Quick lookups, simple edits, exploratory searches, sub agents doing basic research |
| Sonnet 4.6 | Fast | Strong | Medium | Daily coding — writing features, fixing bugs, refactoring, test generation |
| Opus 4.8 | Slower | Deepest | Highest | Complex architecture, subtle bugs, multi-file reasoning, nuanced code review |
| Fable 5 | Slowest | Deepest | Highest | The most capable model — long autonomous sessions and tasks larger than a single sitting; investigates before acting and verifies its own work. Select with /model fable |
How to Switch Models
- During a session:
/model sonnet,/model opus,/model haiku,/model fable - At startup:
claude --model opus - Keyboard shortcut:
Option+P(macOS) orAlt+P(Windows/Linux) - Permanently: Set
"model": "opus"in your settings file
Effort Levels (Adaptive Reasoning)
Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6 support effort levels that control how deeply the model thinks before responding. This is the primary knob for tuning the speed-vs-quality tradeoff. The default is high on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and xhigh on Opus 4.7.
| Effort | Thinking depth | Speed | When to use |
|---|---|---|---|
| Low | Minimal reasoning | Fastest | Straightforward tasks: rename a variable, add a log line, simple questions |
| Medium | Balanced reasoning | Moderate | Cost-sensitive work that can trade off some intelligence |
| High (default) | Deep reasoning | Slower | Most daily work and hard problems: features, architectural design, subtle bugs, complex multi-file changes |
| XHigh | Deeper reasoning, higher token spend | Slowest | Hard problems needing deeper analysis. Default on Opus 4.7; also on Fable 5 and Opus 4.8 |
| Max | Deepest reasoning, no token constraint | Slowest | The hardest problems: complex architecture across many files, novel algorithm design. Session-only unless set via env var. |
Note: The
maxeffort level is available on all effort-supporting models (Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 4.6). It applies to the current session only, except when set through theCLAUDE_CODE_EFFORT_LEVELenvironment variable.xhighis available on Fable 5, Opus 4.8, and Opus 4.7; on models that don’t support a level, Claude Code falls back to the highest supported level below it.
How to set effort level
- In /model: use left/right arrow keys to adjust the effort slider
- Environment variable:
export CLAUDE_CODE_EFFORT_LEVEL=low|medium|high|xhigh|max - Settings file: set
"effortLevel": "high"in your settings (maxis session-only and not accepted here) - Slash command:
/effort low,/effort medium,/effort high,/effort xhigh, or/effort max(or/effort autoto reset to the model default) - One-off deep thinking: type “ultrathink” anywhere in your prompt to request deeper reasoning for that single turn
When to Use Each Model
Use Haiku when…
- You need a quick answer and don’t need deep reasoning
- You’re doing exploratory searches across a large codebase
- You want a fast, cheap sub agent for file discovery and code search
- You’re running many parallel non-interactive queries in scripts
- The task is simple: “what does this function return?”, “find files matching X”
Example: Claude’s built-in Explore sub agent uses Haiku because it only needs to search and read files — it doesn’t need to reason deeply.
Use Sonnet 4.6 when…
- You’re doing daily coding work: writing features, fixing bugs, refactoring
- You want a good balance of speed and quality
- You’re running tests and iterating on fixes
- You need to generate boilerplate or write documentation
- You’re working on a focused task with a clear scope
Example: Most developers use Sonnet as their default model. It handles the majority of coding tasks well and responds fast enough to keep you in flow.
Use Opus 4.8 when…
- You’re working on a hard problem that requires deep reasoning
- You need to understand complex relationships across many files
- You’re designing architecture or making decisions with many tradeoffs
- You’re debugging a subtle issue where the root cause isn’t obvious
- You’re reviewing code for security vulnerabilities or correctness
- You need Claude to self-correct and catch its own mistakes
Example: When planning a multi-service migration, Opus can reason through dependencies, ordering constraints, and rollback strategies that Sonnet might miss.
Use the opusplan alias when…
- You want the best of both worlds: deep reasoning for planning, fast execution for coding
- You’re following the “explore → plan → implement” workflow
- You want Opus quality during Plan Mode, then automatic switch to Sonnet for implementation
How it works: In Plan Mode, opusplan uses Opus. When you switch to Normal Mode and start implementing, it automatically switches to Sonnet.
claude --model opusplan
Thinking About Effort + Model Together
Here’s how to think about combining model choice and effort level:
| Scenario | Recommended setup | Why |
|---|---|---|
| Quick file lookup | Haiku | Fast and cheap; no deep reasoning needed |
| Rename a variable across files | Sonnet + low effort | Simple task, Sonnet is plenty capable |
| Implement a new API endpoint | Sonnet + medium effort | Standard feature work |
| Debug a race condition | Opus + medium effort | Needs deeper reasoning to trace concurrent paths |
| Design a caching strategy | Opus + high effort | Complex tradeoffs, needs thorough analysis |
| Review code for security issues | Opus + high effort | Subtle issues require careful examination |
| Novel algorithm design or architecture from scratch | Opus + max effort | Deepest possible reasoning with no token constraint |
| Generate test boilerplate | Sonnet + low effort | Repetitive, well-defined task |
| Understand unfamiliar codebase | Sonnet + medium effort (or Haiku sub agent) | Balances thoroughness with speed |
Practical Tips
Start with Sonnet, escalate to Opus. Most tasks don’t need Opus. If Sonnet struggles — produces incorrect code, misses edge cases, or can’t reason through the problem — switch to Opus for that task, then switch back.
Use effort levels before switching models. Before jumping from Sonnet to Opus, try increasing Sonnet’s effort level to high first. It might be enough, and it’s faster and cheaper than Opus.
Use “ultrathink” for one-off hard prompts. If you have a single complex question in an otherwise routine session, type “ultrathink” in your prompt instead of changing your model or effort settings permanently.
Match model to sub agent purpose. When creating custom sub agents, consider their purpose:
- Explorers and searchers →
model: haiku - Code writers and fixers →
model: sonnetormodel: inherit - Reviewers and architects →
model: opus
Extended context (1M tokens). For very long sessions with large codebases, Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window. Use sonnet[1m] or opus[1m] aliases.
Default Model Behavior by Plan
Your default model depends on your subscription:
| Plan | Default model |
|---|---|
| Max / Team Premium | Opus 4.8 |
| Pro / Team Standard | Sonnet 4.6 |
| Enterprise | Opus 4.8 available, not default |
| API / Pay-as-you-go | You choose |
Claude Code may automatically fall back to Sonnet if you hit an Opus usage threshold.
Next Steps
- Run
/modelto see available models and adjust effort levels - Try
opusplanfor your next planning session - See the official model configuration docs for environment variables and enterprise settings
- Read Starting to Work for how to choose your permission mode