Skip to Content

Can You Choose Which Claude Model to Use in Claude Code?

September 26, 2026 by
aliakram

Yes. Claude Code lets you choose which Claude model you want to use, and you can change the model during an active session.

The simplest method is:

/model

Claude Code opens the model picker, where you can select an available model. Anthropic's current Claude Code documentation also supports starting a session with the --model flag and configuring a preferred model through environment variables. You can check which model is currently active with:

/status

But there is an important detail that is easy to miss.

Choosing a Claude model is not simply a matter of picking the model with the biggest name. Anthropic recommends considering capability, speed, cost, and effort. In many cases, changing the effort level within a model can be a better adjustment than immediately moving to a more expensive model.

This guide explains how Claude Code model selection works, what the current models are suited for, how to change them, when to use each one, and how to build a practical model-selection workflow.

Can You Choose Which Claude Model Claude Code Uses?

Yes.

Claude Code gives you several ways to select a model:

  • /model for changing the model inside a session
  • --model for selecting a model when starting a session
  • ANTHROPIC_MODEL for configuring a preferred model
  • model aliases such as opus, sonnet, haiku, and fable
  • exact model IDs when you need version-specific behavior
  • effort settings for adjusting reasoning depth

The /model command is the easiest option because the change takes effect immediately without restarting your terminal. Anthropic's current support documentation explicitly lists /model, --model, and environment variables as the main ways to configure Claude Code's model.

How to Change the Claude Model in Claude Code

Method 1: Use /model

Start Claude Code:

claude

Then type:

/model

Claude Code will show the interactive model picker.

Choose the model you want and the change takes effect immediately. You can check the active model with:

/status

This is the best method when you're already working inside a session and realize that the current model isn't appropriate for the task.

For example:

/model opus

or:

/model sonnet

depending on the models and aliases available in your environment.

Method 2: Start Claude Code With --model

If you already know which model you want before starting a session, use the --model option.

For example:

claude --model claude-opus-5-5

or:

claude --model claude-sonnet-5

You can also specify Fable:

claude --model claude-fable-5-1

Anthropic's current support documentation lists exact model IDs including Opus 5.5, Fable 5.1, Opus 5, Sonnet 5, Fable 5, Opus 4.8, Opus 4.7, Sonnet 4.6, Opus 4.6, Opus 4.5, Haiku 4.5, and Sonnet 4.5. Availability can depend on your account and configuration.

A useful distinction:

--model selects the model for that launched session.

It should not be confused with permanently changing your default configuration.

Method 3: Set a Default Model With ANTHROPIC_MODEL

If you want future Claude Code sessions to start with a particular model, you can configure ANTHROPIC_MODEL.

For example:

export ANTHROPIC_MODEL="claude-opus-5-5"

Or:

export ANTHROPIC_MODEL="claude-sonnet-5"

Anthropic documents this as a way to configure the preferred model for future sessions.

On macOS or Linux, this can be placed in the appropriate shell configuration file such as .zshrc or .bashrc.

For example:

echo 'export ANTHROPIC_MODEL="claude-sonnet-5"' >> ~/.zshrc

Then open a new terminal session.

What Claude Models Can You Use in Claude Code?

The current Claude model lineup is broader than the older Opus/Sonnet/Haiku-only explanations you may still find online.

Anthropic's current model documentation lists:

  • Claude Fable 5.1
  • Claude Opus 5.5
  • Claude Sonnet 5
  • Claude Haiku 4.5

as current models in its model documentation.

Claude Code's support documentation also lists several previous model generations that may remain available depending on the environment.

That distinction matters because articles that publish a permanent model list can become outdated quickly.

A better way to think about Claude Code models is by what kind of work you need to perform.

Which Claude Model Should You Use for Claude Code?

There isn't one model that should be used for every task.

Anthropic's model-selection guidance recommends considering:

  1. Capability
  2. Speed
  3. Cost
  4. Effort

Anthropic also provides two broad approaches: efficiency-first and capability-first.

For Claude Code, a practical starting framework looks like this:

TaskModel to considerWhy
Simple lookup or extractionHaiku 4.5Low latency and cost
Mechanical code editsHaiku 4.5Little complex reasoning required
Normal codingSonnet 5Balance of capability and speed
DebuggingSonnet 5 / Opus 5.5Depends on complexity
Large refactoringOpus 5.5More complex reasoning
Architecture decisionsOpus 5.5Multi-factor reasoning
Long autonomous workFable 5.1Long-horizon agentic work
Very demanding researchFable 5.1High capability and long-running tasks

This isn't a hard rule. Anthropic recommends testing the actual workload and evaluating the results rather than assuming that a particular model will always perform better.

Claude Haiku 4.5: When Should You Use It?

Haiku is designed around speed and efficiency.

Claude Academy recommends Haiku for tasks such as:

  • simple questions
  • quick lookups
  • categorization
  • extracting specific information
  • simple summarization
  • straightforward tasks that don't require complex reasoning

For Claude Code, that translates well to mechanical work.

For example:

/model haiku

Then:

Rename this variable throughout the project without changing its behavior.

Other examples include:

  • formatting
  • simple renaming
  • extracting information
  • straightforward transformations
  • repetitive subagent tasks

The key is that the task should be well-defined.

Claude Sonnet 5: The General-Purpose Coding Option

Sonnet is positioned as the general-purpose model for many workloads.

Claude Academy specifically lists Sonnet for:

  • coding
  • debugging
  • writing new code
  • refactoring
  • analysis
  • multi-step problems
  • general-purpose work when you're unsure which model to choose

That makes Sonnet particularly relevant to everyday Claude Code work.

Examples:

/model sonnet

Then ask Claude to:

Find the failing test, identify the root cause, fix the issue, and run the relevant tests.

Or:

Add authentication middleware to this Express application and update the tests.

For ordinary feature development, debugging, and refactoring, Sonnet is often a sensible starting point.

Claude Opus 5.5: When Should You Move Up?

Anthropic's current model-selection documentation positions Opus 5.5 for complex agentic coding and enterprise work, including large-scale refactoring, complex systems engineering, and long-running autonomous coding.

Use it when the task requires more sophisticated reasoning than your current model is handling effectively.

Examples include:

  • complicated architecture decisions
  • large refactors
  • difficult bugs
  • unfamiliar codebases
  • long-running coding agents
  • complex dependency changes
  • problems involving multiple interacting systems

For example:

/model opus

Then:

Trace the authentication flow across the application, identify why refresh tokens occasionally fail, explain the root cause, implement the fix, and run the relevant test suite.

The important point is that you shouldn't automatically move to Opus simply because a task is important.

If Sonnet can solve the task correctly, there may be little reason to use a more expensive model.

Claude Fable 5.1: When Is It Useful?

Fable 5.1 sits at the highest capability end of Anthropic's current general model lineup.

Anthropic describes it as suited to demanding reasoning and long-horizon agentic work. Its model-selection guide gives examples such as agents running for hours, deep research, and work that needs to be carried through to a finished document or other deliverable.

Claude Academy recommends Fable for:

  • specialized tasks where accuracy is critical
  • long-horizon tasks with many connected steps
  • dense source material
  • technical diagrams and complex documents
  • tasks where you want Claude to plan and execute a larger outcome
  • problems where Opus has already struggled

For Claude Code, think of Fable as a model you reach for when the task has become a long-running, highly connected piece of work, rather than simply a difficult single question.

For example:

/model fable

could make sense for a task such as:

Understand this unfamiliar repository, map the architecture, identify the migration risks, create an implementation plan, modify the relevant systems, update tests, and verify the final result.

Don't Choose a Model Before You Define the Task

One useful idea from Anthropic's Academy material is that model selection should start with the output you actually need.

A quick lookup doesn't need the same level of reasoning as analysis that will influence an important decision. Anthropic recommends checking the result proportionally to the importance of the task.

This gives you a better workflow:

Task → Required output → Complexity → Model → Effort → Evaluation

Instead of:

Important task → Automatically choose biggest model

That distinction can save both time and usage.

Model vs Effort: What Is the Difference?

This is one of the most important concepts in current Claude model selection.

Model

The model determines the underlying capability.

For example:

Haiku → Sonnet → Opus → Fable

represent different capability/cost/speed tradeoffs.

Effort

Effort changes how much reasoning work Claude performs within supported models.

Anthropic says effort can trade intelligence against latency and cost, and specifically notes that tuning effort can often be a better lever than switching models.

Claude Academy similarly explains that lower effort can produce faster responses and use less of your limit, while higher effort is better reserved for harder problems.

So if Sonnet understands your task but stops too early, you don't necessarily need to jump straight to Opus.

Try adjusting effort first.

A Better Model-Selection Workflow

Instead of choosing models based on reputation, use a simple escalation strategy.

Step 1: Start with the efficient option

For simple work, start with Haiku.

For general coding, start with Sonnet.

Step 2: Evaluate the result

Ask:

  • Was the code correct?
  • Did Claude understand the architecture?
  • Did it handle edge cases?
  • Did it run the appropriate tests?
  • Did it follow the requested constraints?

Step 3: Increase effort if the model understands the problem

If the model is capable but doesn't investigate deeply enough, increase effort where supported.

Step 4: Move to a stronger model if there is a capability gap

If the model repeatedly fails because the problem itself is beyond what it can handle, move upward.

For example:

Haiku → Sonnet → Opus → Fable

The important word is repeatedly.

One bad response doesn't automatically prove that you need a different model.

Anthropic's Two Model-Selection Strategies

Anthropic's official model-selection guide describes two useful approaches.

Strategy 1: Efficiency-first

Start with a fast, cost-effective model.

The workflow is:

  1. Start with a lower-cost model.
  2. Test your real workload.
  3. Evaluate the output.
  4. Upgrade only when a specific capability gap appears.

This works particularly well for:

  • prototypes
  • high-volume tasks
  • latency-sensitive applications
  • straightforward workloads
  • cost-sensitive development

For Claude Code, the equivalent idea is to avoid automatically running every task on the largest model.

Strategy 2: Capability-first

For difficult tasks, start with a highly capable model.

Then:

  1. Run the real workload.
  2. Evaluate the output.
  3. Optimize prompts and workflow.
  4. Lower effort or move to a more efficient model if quality remains acceptable.

This approach makes more sense when:

  • accuracy matters more than cost
  • the task is complex
  • the work is highly autonomous
  • failure is expensive
  • the problem requires advanced reasoning

Don't Guess: Benchmark Your Actual Coding Tasks

One of the strongest points in Anthropic's official guidance is that model selection should be evaluated using your actual workload.

Anthropic recommends creating benchmark tests specific to your use case, running actual prompts and data, and comparing:

  • accuracy
  • response quality
  • edge-case handling
  • performance versus cost

For Claude Code, you can make a small test set.

For example:

Test 1: Simple feature

Add a password visibility toggle to this form.

Test 2: Debugging

Find why this API occasionally returns a 500 error.

Test 3: Refactoring

Refactor this authentication module without changing its public API.

Test 4: Architecture

Design a migration from the current queue system to an event-driven architecture.

Run comparable tasks on the models you are considering.

Don't judge only by how impressive the answer sounds.

Check whether the resulting code actually works.

Can You Use Different Models for Different Tasks?

Yes.

This is where model selection becomes more interesting in Claude Code.

You don't have to treat your entire development workflow as if it needs one model.

For example:

Haiku → file discovery / mechanical work
Sonnet → implementation / normal debugging
Opus → difficult architecture / complex debugging
Fable → long-running autonomous work

A developer might use Sonnet for most implementation work, switch to Opus for a difficult architecture problem, and use Haiku for repetitive tasks.

Community discussions around Claude Code also show that users are actively exploring task-specific model selection and automatic routing rather than treating one model as universally optimal.

The community discussion should be treated as user experience rather than an official performance benchmark.

What Is opusplan?

Claude Code also supports the opusplan workflow.

The idea is:

Opus for planning → Sonnet for execution

This is useful for tasks where planning requires more reasoning but implementation can be handled efficiently by a general-purpose model.

For example:

/model opusplan

A practical workflow could look like:

Phase 1: Analyze repository
        ↓
Opus planning
        ↓
Create implementation approach
        ↓
Sonnet execution
        ↓
Tests and verification

This can reduce the need to manually switch models between planning and implementation.

Third-party Claude Code documentation also describes opusplan as an Opus planning/Sonnet execution pattern.

Because aliases and model routing can change, check the current Claude Code documentation for the exact behavior available in your installed version.

What Are Model Aliases?

Claude Code supports convenient aliases such as:

opus
sonnet
haiku
fable

The advantage is convenience.

Instead of specifying a long model ID, you can write:

/model opus

The disadvantage is that an alias can resolve to a different model version as Anthropic updates its model lineup or depending on the provider.

That means:

opus

and:

claude-opus-5-5

are not conceptually the same thing.

The first asks Claude Code to resolve the current Opus alias.

The second explicitly identifies a model version.

This distinction becomes important when reproducibility matters.

Third-party sources also emphasize that aliases can resolve differently across providers and that exact model IDs are preferable when a workflow needs a fixed version.

When Should You Pin an Exact Model?

Use an exact model ID when you need predictable behavior across time.

For example:

claude --model claude-opus-5-5

This can be useful for:

  • reproducible testing
  • team environments
  • benchmark comparisons
  • automated workflows
  • production integrations
  • debugging model-specific behavior

If you simply want Claude Code to follow the current recommended model associated with an alias, an alias can be more convenient.

The tradeoff is:

Alias = easier maintenance

Exact model ID = more version control

Why Can Two Developers Get Different Models From the Same Alias?

Provider configuration matters.

Claude Code can work through different environments and providers, and available models can vary depending on the configured runtime.

That means you should not assume that:

/model opus

always maps to precisely the same underlying model in every environment.

This is especially relevant for teams using cloud providers or enterprise configurations.

The current Claude Code documentation explicitly lists model availability and exact IDs, while third-party technical discussions note that provider-specific configurations can affect alias resolution.

If consistency matters, use an exact model ID where supported.

What If Claude Code Uses a Different Model Than You Expected?

First run:

/status

This shows the current model.

Then check:

  1. Which model you selected
  2. Whether you used an alias or exact model ID
  3. Your ANTHROPIC_MODEL environment variable
  4. Your Claude Code settings
  5. Your provider
  6. Your organization restrictions
  7. Whether you're using a resumed session
  8. Whether the model is available on your account

Don't assume that the model name shown in an old tutorial is still the current model.

Claude's model lineup changes quickly.

What About Automatic Model Switching?

Model selection isn't always completely static.

Some current Claude configurations can move requests to another model under specific conditions.

This is another reason to check the active model instead of assuming that the model you selected at the beginning is necessarily the model handling every later request.

For high-stakes workflows, inspect the actual model and evaluate the output rather than relying solely on the initial configuration.

Can You Use a 1M Context Model in Claude Code?

For supported configurations, Claude Code provides extended-context model options such as:

opus[1m]

and:

sonnet[1m]

The availability and billing behavior depend on your plan and configuration.

This matters for large repositories and long-running sessions because model capability isn't the only constraint.

Context size can also determine how much project information Claude can keep available during a task.

For large codebases, ask:

  • Does the task actually need the larger context?
  • Is the model reading too much irrelevant information?
  • Would a cleaner task boundary work better?
  • Would a fresh session reduce unnecessary context?

A larger context window isn't automatically a better workflow.

Model Choice vs Context: Don't Confuse the Two

Imagine Claude is struggling with a large codebase.

You have two possible problems:

Problem A: The model isn't capable enough

A stronger model may help.

Problem B: Claude has too much irrelevant context

Changing models may not solve the problem.

In the second case, you may get better results by:

  • starting a fresh session
  • narrowing the task
  • giving Claude the relevant files
  • improving CLAUDE.md
  • using subagents
  • reducing unnecessary conversation history

This is why model selection should be part of a larger workflow rather than the only optimization lever.

Multi-Model Workflows Can Reduce Cost

Anthropic's model-selection guidance also describes multi-model strategies.

The basic idea is to combine:

  • a lower-cost model for routine work
  • a stronger model for difficult decisions

Two common patterns are:

Executor + advisor

A cheaper model performs most of the work while a stronger model handles difficult decisions.

Orchestrator + workers

A stronger model coordinates the task while lower-cost models perform delegated work.

Anthropic explicitly recommends multi-model strategies as a way to balance intelligence and cost.

For Claude Code users, this concept becomes particularly useful when working with subagents or large automated workflows.

A Practical Claude Code Model Matrix

Here is a practical way to think about model selection:

If your task is...Consider
Find a fileHaiku
Extract informationHaiku
Rename variablesHaiku
Format codeHaiku
Write normal featuresSonnet
Write testsSonnet
Normal debuggingSonnet
Content/documentation workSonnet
Complex debuggingOpus
Architecture designOpus
Large refactoringOpus
Long autonomous projectFable
Deep multi-step researchFable
Plan + implement workflowopusplan

This is a starting framework, not a benchmark ranking. Anthropic's own guidance recommends testing the actual workload and choosing based on the capability, speed, cost, and effort required.

Common Model-Selection Mistakes

1. Always using the biggest model

More capability doesn't automatically mean better economics.

If Haiku can correctly perform a mechanical task, using Fable for it is unnecessary.

2. Always using the cheapest model

The opposite mistake can be just as problematic.

A difficult architecture problem can require substantially more reasoning.

3. Changing the model instead of changing effort

If the model understands the task but needs more reasoning, effort may be the better lever.

Anthropic explicitly recommends considering effort before automatically switching models in many situations.

4. Judging models by one prompt

One successful or failed prompt doesn't tell you much.

Use a small benchmark based on your actual work.

5. Ignoring cost

Model selection isn't only about quality.

Anthropic frames the decision as a balance between capability, speed, cost, and effort.

6. Assuming aliases are permanent

opus, sonnet, haiku, and fable can represent moving targets as models evolve.

Use exact IDs when reproducibility matters.

7. Forgetting to check the actual model

Run:

/status

before assuming which model is handling the session.

Best Workflow for Choosing a Claude Code Model

If you're not sure where to start, use this process:

For simple tasks

Haiku

For normal development

Sonnet

If Sonnet struggles

Increase effort

If the problem is still genuinely beyond the model

Opus

If Opus still struggles with a long, complex task

Fable

If your workflow naturally separates planning from execution

opusplan

This is much more practical than asking:

"Which Claude model is the best?"

The better question is:

"Which model provides enough capability for this particular task at an acceptable speed and cost?"

Frequently Asked Questions

Can I choose which Claude model to use in Claude Code?

Yes. Use:

/model

to select an available model from the interactive picker.

How do I check which model Claude Code is using?

Run:

/status

Claude Code displays the current model information.

Can I specify a model when starting Claude Code?

Yes:

claude --model claude-opus-5-5

The --model option selects the model for that session.

Can I set a default model?

Yes. Claude Code supports environment-based model configuration such as:

export ANTHROPIC_MODEL="claude-sonnet-5"

Which model should I use for coding?

For general coding, Sonnet is a sensible starting point. For complex architecture, difficult debugging, or advanced autonomous coding, consider Opus. For long-horizon demanding work, Fable may be appropriate. Anthropic's own model-selection guide makes similar distinctions.

Is Fable always better than Sonnet?

Not necessarily for every task. Model choice depends on the required capability, speed, cost, and effort. A simpler task may not benefit enough from a higher-capability model to justify the additional resources.

Should I switch models or increase effort?

If the model understands the task but needs deeper reasoning, increasing effort can be a useful first experiment. Anthropic specifically identifies effort as an important optimization lever.

Can I use different models for different tasks?

Yes. You can manually switch models, use aliases, and build workflows that use different models for different kinds of work.

Should I use aliases or exact model IDs?

Use aliases when you want convenience and current model resolution. Use exact model IDs when reproducibility and version control matter.

Final Takeaway

Yes, you can choose which Claude model to use in Claude Code.

The fastest way is:

/model

To check what is currently active:

/status

To start a session with a specific model:

claude --model claude-opus-5-5

And for a configured default:

export ANTHROPIC_MODEL="claude-sonnet-5"


But the more important lesson is how to choose the model.

Start with the actual task.

  • Haiku makes sense for simple, fast, repetitive work.
  • Sonnet is a strong starting point for everyday coding and multi-step development.
  • Opus is appropriate to consider when the problem requires more complex reasoning or advanced coding.
  • Fable is aimed at demanding, long-horizon work.
  • opusplan can combine stronger planning with more efficient execution.
  • Effort gives you another lever before you automatically move to a different model.

Anthropic's current guidance is to balance capability, speed, cost, and effort, then validate the choice against your actual workload.

So instead of asking:

"Which Claude model is the best?"

ask:

"What is the least expensive model that can reliably complete this task at the quality I need?"

That question leads to a much more useful Claude Code workflow.