Claudebeginner

How to Switch Between Claude Models in Claude Code

Learn to switch between Claude Opus, Sonnet, and Haiku models in Claude Code. Understand model capabilities, cost implications, and when to use each model for optimal results and quota management.

6 min readUpdated January 2025

Want us to handle this for you?

Get expert help →

Claude Code gives you access to multiple Claude models, each optimized for different use cases. Knowing when and how to switch between Opus, Sonnet, and Haiku helps you work more efficiently and make the most of your subscription quota.

Available Models

Claude Code provides access to three model tiers, each with distinct strengths:

Model Capabilities Comparison

ModelCapabilitySpeedQuota CostBest For
Opus 4.5HighestSlowestHighestComplex reasoning, architecture decisions, security-sensitive code
Sonnet 4HighFastModerateMost coding tasks, code reviews, documentation
HaikuGoodFastestLowestQuick questions, formatting, simple edits

Opus 4.5 (claude-opus-4-5-20251101) is the flagship model with the deepest reasoning capabilities. It excels at multi-file refactoring, understanding complex system interactions, and making nuanced decisions about code architecture.

Sonnet 4 (claude-sonnet-4-20250514) offers an excellent balance of capability and efficiency. For most coding tasks, Sonnet performs nearly as well as Opus while using significantly less quota.

Haiku is optimized for speed and efficiency. While less capable than its larger siblings, it handles straightforward tasks quickly and economically.

How to Switch Models

Using the /model Command

The simplest way to switch models is the /model slash command:

/model sonnet

Available options:

  • /model opus - Switch to Opus 4.5
  • /model sonnet - Switch to Sonnet 4
  • /model haiku - Switch to Haiku

The model switch takes effect immediately for all subsequent prompts in your session.

Checking the Current Model

To see which model you are currently using:

/model

This displays your active model without making any changes.

Model Selection in the UI

When starting a new Claude Code session, you may see a model selector. Click on the model name to reveal available options and select your preferred model before beginning work.

Setting a Default Model

Configuration File

Set your default model in Claude Code's configuration:

claude config set model sonnet

This sets Sonnet as your default model for new sessions. Valid values are opus, sonnet, or haiku.

Project-Level Defaults

You can specify a default model for specific projects in your CLAUDE.md file:

## Claude Configuration

Default model: sonnet
Use opus for: security reviews, architecture decisions
Use haiku for: formatting, simple refactors

While Claude Code does not automatically parse this, including model guidance in your project instructions helps maintain consistent practices.

Quota Implications

Different models consume your subscription quota at different rates:

Relative Quota Usage

ModelRelative CostTypical Tasks Per Day (Pro)
Opus 4.51x (baseline)Limited use
Sonnet 4~0.2xModerate to heavy use
Haiku~0.05xVery heavy use

Example scenario: If Opus allows approximately 20 complex requests per day, Sonnet might allow 100+ requests, and Haiku could handle 400+ simple requests.

Quota Management Tips

  1. Default to Sonnet for most work - it handles 90% of coding tasks well
  2. Reserve Opus for tasks that genuinely require deeper reasoning
  3. Use Haiku for high-volume, simple operations
  4. Batch related questions rather than asking them one at a time

When to Use Each Model

Use Opus 4.5 For:

  • Complex multi-file refactoring that requires understanding system-wide implications
  • Security-sensitive code where correctness is critical
  • Architecture decisions that affect the entire codebase
  • Debugging subtle issues that require deep reasoning about code behavior
  • Novel problems without established patterns to follow

Use Sonnet 4 For:

  • Most daily coding tasks - implementations, bug fixes, features
  • Code reviews and suggesting improvements
  • Writing documentation and comments
  • Test generation for existing code
  • Explaining code to understand unfamiliar sections
  • Git workflows like commit messages and PR descriptions

Use Haiku For:

  • Quick questions about syntax or simple concepts
  • Code formatting and style fixes
  • Simple search and replace operations
  • Generating boilerplate from clear patterns
  • High-volume tasks where speed matters more than depth

Subscription Tier Differences

Claude Pro ($20/month)

Pro subscriptions provide:

  • Full access to Sonnet and Haiku
  • Limited Opus access (varies based on demand)
  • Daily quota reset at midnight UTC
  • May experience model downgrades during peak usage

Claude Max ($100/month)

Max subscriptions provide:

  • Full, priority access to all models including Opus
  • 5x the quota of Pro
  • Weekly quota reset
  • Priority access during high-demand periods
  • No automatic model downgrades

Model Availability

When Opus quota is exhausted, Claude Code automatically falls back to Sonnet. If you need guaranteed Opus access for critical work, Max subscription ensures availability.

Model Selection Strategies

Strategy 1: The 80/20 Approach

Use Sonnet for 80% of your work and reserve Opus for the 20% that truly needs it:

Daily workflow:
- Morning standup/planning: Sonnet
- Feature implementation: Sonnet
- Complex bug investigation: Opus
- Code review: Sonnet
- Documentation: Sonnet or Haiku

Strategy 2: Task-Based Switching

Switch models based on what you are doing:

# Starting a complex refactor
/model opus

# Switching to routine implementation
/model sonnet

# Quick formatting questions
/model haiku

Strategy 3: Quota Monitoring

When approaching quota limits, proactively downgrade:

  1. Check your usage at claude.ai in Settings
  2. If above 70% usage, switch to Sonnet exclusively
  3. If above 90% usage, switch to Haiku for remaining tasks
  4. Wait for quota reset before resuming Opus use

Troubleshooting

Model Not Switching

If /model opus does not work:

  • You may have exhausted Opus quota for the period
  • Your subscription tier may not include Opus access
  • There may be high demand limiting Opus availability

Unexpected Model Downgrades

If Claude automatically uses a lower-tier model:

  • Check your quota usage in account settings
  • Verify your subscription is active
  • Consider upgrading to Max for priority access

Model Performance Issues

If a model seems less capable than expected:

  • Ensure you are using the intended model with /model
  • Provide clearer context in your prompts
  • Try switching to a higher-tier model for the task

Next Steps

Frequently Asked Questions

Find answers to common questions

Claude Code supports Opus (highest capability, most expensive), Sonnet (balanced performance and cost), and Haiku (fastest, most economical). The available models depend on your subscription tier - Pro users may have limited Opus access while Max users get full access to all models.

Need Professional IT & Security Help?

Our team of experts is ready to help protect and optimize your technology infrastructure.