Claude Code /model: Opus vs Sonnet vs Haiku Guide
Table of Contents
- What is /model
- How to Use It
- Check Current Model
- Switch Models
- Available Models
- When to Use Which Model
- Opus: Complex Tasks
- Sonnet: Everyday Tasks
- Haiku: Simple Tasks
- Practical Tips
- Tip 1: Switch by Task Phase
- Tip 2: Context is Preserved
- Tip 3: Set a Default with —model
- Tip 4: Use /cost to Monitor Spending
- /model vs —model
- Final Thoughts
What is /model
When coding with Claude Code, you might run into situations like:
- A simple rename refactor where using the most powerful model feels wasteful
- A complex architecture decision where the current model doesn’t feel capable enough
- Wanting to quickly compare how different models respond to the same question
That’s where the /model command comes in.
/model is a slash command in Claude Code that lets you switch to a different Claude model mid-conversation, without restarting.
How to Use It
Check Current Model
In Claude Code’s interactive mode, simply type:
/model
A model selection list will appear, with your currently active model highlighted.
Switch Models
Select the model you want from the list. The switch takes effect immediately, and your conversation context is fully preserved.
You can also specify a default model when launching Claude Code with the --model flag:
claude --model claude-opus-4-6
Available Models
Claude Code currently supports these models:
| Model | Model ID | Characteristics |
|---|---|---|
| Claude Opus 4.6 | claude-opus-4-6 | Most powerful, ideal for complex reasoning and architecture |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | Balanced choice, good speed and capability |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | Fastest and cheapest, great for simple tasks |
The default model is Sonnet — for most everyday coding tasks, it offers the best balance of cost and performance.
When to Use Which Model
Opus: Complex Tasks
Opus is the most capable model in the Claude family, best for scenarios requiring deep thinking:
- Architecture design — designing new systems, planning module structure, choosing tech approaches
- Complex debugging — tracing tricky bugs across multiple files, understanding complex call chains
- Large-scale refactoring — code refactoring involving multiple files and modules
- Code review — reviews requiring deep understanding of business logic
Sonnet: Everyday Tasks
Sonnet is the default choice, covering the vast majority of daily development:
- New features — implementing new components, APIs, or pages
- Bug fixes — routine bug fixes
- Writing tests — adding unit tests for existing code
- Small refactors — renaming variables, extracting functions, restructuring
Haiku: Simple Tasks
Haiku is the fastest and cheapest, perfect for tasks that don’t need much reasoning:
- Code formatting — adjusting indentation, adding comments
- Quick lookups — checking API usage, looking up config options
- Boilerplate code — creating config files, writing repetitive code
- Quick explanations — explaining what a piece of code does
Practical Tips
Tip 1: Switch by Task Phase
A typical development workflow can mix models like this:
- Planning phase → Switch to Opus for architecture and approach discussions
- Coding phase → Switch back to Sonnet for implementation
- Finishing phase → Switch to Haiku for formatting, comments, and cleanup
Tip 2: Context is Preserved
Switching models doesn’t clear your conversation history. You can write code with Sonnet, switch to Opus to review it, then switch back to Sonnet to continue. The entire conversation context carries over seamlessly.
Tip 3: Set a Default with —model
If you mainly do architecture work, set Opus as your default:
claude --model claude-opus-4-6
Or if speed is your priority, default to Haiku:
claude --model claude-haiku-4-5-20251001
Tip 4: Use /cost to Monitor Spending
After switching models, use the /cost command to check token usage and costs for the current session, helping you understand the cost differences between models.
/model vs —model
| /model (in-session switch) | —model (launch-time flag) | |
|---|---|---|
| Timing | Switch anytime during conversation | Specified when launching Claude Code |
| Persistence | Current session only | Current session only |
| Flexibility | Can switch back and forth multiple times | Can still be overridden by /model |
| Best for | Dynamically adjusting based on task complexity | Using a fixed model preference |
They work together. Set a default with --model, then use /model to switch on the fly when needed.
Final Thoughts
/model is a simple but powerful command. Its core value is: letting you choose the right model for the actual task, instead of a one-size-fits-all approach.
Opus for hard problems, Sonnet for daily development, Haiku for quick tasks — smart model switching not only improves efficiency but also saves costs.
Next time you’re in Claude Code, try switching to Haiku for a simple task and feel the blazing-fast response. When you hit a tough problem, switch to Opus and let the most powerful model help you break it down. Flexible switching is how you get the most out of Claude Code.
Related Articles
Claude Code Agent Loop: Dissecting the Heart of an AI Coding Assistant
How does Claude Code understand your requests, invoke tools, and self-recover step by step? A source-code deep dive into the Agent Loop's core architecture — streaming responses, parallel tool execution, auto-compaction, and error recovery.
Claude Code settings.json Explained (1): Where Config Files Live and Who Wins
A complete guide to Claude Code's configuration file system — five config sources, their file paths, priority rules, array merging vs value overriding, and enterprise managed settings delivery.
Claude Code settings.json Deep Dive (Part 2): The Permissions System
A thorough breakdown of Claude Code's permissions configuration — allow/deny/ask rule arrays, wildcard syntax, MCP tool permissions, defaultMode options, and additionalDirectories.
Claude Code settings.json Deep Dive (Part 3): The Hooks System
A thorough breakdown of Claude Code's hooks configuration — four hook types, core events (PreToolUse/PostToolUse/Stop/Notification), stdin/stdout protocol, exit code semantics, and practical examples.
Claude Code settings.json Deep Dive (4): env, Models, Auth, and Other Useful Fields
A comprehensive guide to the remaining settings.json fields in Claude Code — env variable injection, model configuration, authentication helpers, Git attribution, session cleanup, language and UI, thinking depth, auto-updates, memory system, and more.