Black Friday sale: 85 Claude Code agents for $29 one-time · lifetime updatesGet access →
Setup·Updated ·7 min read

How to Change the Model in Claude Code

By Shubhranshu, creator of claudeagents · Last reviewed

To change the model in Claude Code, type /model and pick one from the list, or type /model followed by a name, for example /model sonnet. You can also start with claude --model opus, set the ANTHROPIC_MODEL environment variable, or put "model" in your settings file. On Pro, Max, Ultra and the Anthropic API, the default is Opus 5.5.

Picking the right model is the easiest way to get better results and make your usage last longer. This guide covers every way to switch, what each alias means, effort levels, and a simple guide to which model to use for which kind of work. Checked against Claude Code's model configuration docs on 28 November 2026.

4 ways to change the model in Claude Code

Claude Code checks these in order, so an earlier one wins over a later one:

Ways to set the model, highest priority first
WhereHowLasts for
In a session/model sonnet (or /model to open the picker)Saved as default with Enter; s = this session only
At startupclaude --model opusThat session
Environment variableANTHROPIC_MODEL=haikuThat session
Settings file"model": "opus" in settings.jsonEvery session

There's also ANTHROPIC_DEFAULT_MODEL to set the default for new sessions (Claude Code v2.1.236 or later). Resumed sessions keep the model they were saved with.

Claude Code model aliases explained

Model aliases (on the Anthropic API)
AliasWhat it uses
defaultClears your override and goes back to your account's default
opus / bestThe latest Opus (Opus 5.5) for complex reasoning
sonnetThe latest Sonnet (Sonnet 5.5) for daily coding
haikuHaiku 5.5, fast and cheap for simple tasks
fableFable, for the hardest and longest-running tasks
opusplanOpus in plan mode, then Sonnet to do the work
sonnet[1m] / opus[1m]1M-token context (already native on the current Opus and Sonnet)

On Amazon Bedrock, Google Cloud and other providers, aliases can point to different versions.

Which model should you use?

A simple guide
JobModelWhy
Everyday coding, edits, testssonnetFast and capable, uses less of your limit
Hard bugs, architecture, big refactorsopusBest reasoning; uses more usage
Quick mechanical changes, renames, summarieshaikuCheapest and fastest
Plan carefully, then buildopusplanOpus plans, Sonnet executes
The longest, hardest agentic tasksfableMost capable; much more expensive

Not sure? Start with Sonnet and switch to Opus only when you're stuck. It's one of the best ways to make your usage limits last. Compare costs per task in our cost calculator.

Change the effort level

Effort controls how much the model thinks before answering. More effort can mean better answers on hard problems, but it takes longer and uses more.

  • In a session: /effort opens a slider; /effort high sets it directly; /effort auto clears your saved level.
  • At startup: claude --effort low.
  • Levels: low, medium, high, xhigh, max on the current models. The default is medium on Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2.
  • In settings: "effortLevel": "high" (accepts low to xhigh).

Use different models for subagents

Your main conversation and your subagents can use different models: for example Opus for the main session and Haiku for a test-running subagent. Set it in the subagent's model field. We cover this step by step in Claude Code subagent model, and our subagent generator lets you pick the model with one click.

claudeagents ships 85 agents that already pick a sensible model for each job, so routine work runs on lighter models and heavy reasoning stays on Opus.

Check which model you're using

  • Type /model with no argument to open the picker; the current model is selected.
  • Run /status to see your session details.
  • Add the model name to your status line with our status line generator so it's always visible.

Frequently asked questions

How do I change the model in Claude Code?

Type /model in Claude Code and pick a model, or type /model sonnet (or opus, haiku, fable). You can also start with claude --model opus, set ANTHROPIC_MODEL, or add "model": "opus" to settings.json.

What is the default model in Claude Code?

Opus 5.5 is the default on Pro, Max, Ultra, Team, Enterprise and the Anthropic API, as of November 2026. Some cloud providers use a different default.

What is the best model for Claude Code?

Sonnet 5.5 for most everyday coding, Opus 5.5 for hard problems and architecture, Haiku 5.5 for quick simple tasks, and opusplan to plan with Opus and build with Sonnet.

What does opusplan do in Claude Code?

opusplan uses Opus while you're in plan mode, then switches to Sonnet to carry out the plan, giving you strong planning with lower usage during execution.

How do I make a model the default in Claude Code?

Open /model, select the model and press Enter; that saves it as your default. Or add "model": "sonnet" to ~/.claude/settings.json.

How do I change the effort level in Claude Code?

Type /effort to open the slider or /effort high to set it, or start with claude --effort low. Current models support low, medium, high, xhigh and max.

Sources

Skip the setup: get 85 ready-made agents

Coding, SEO and marketing kits for Claude Code, with 52 skills and 53 slash commands. $29 one-time, lifetime updates.

See what's included →

Keep reading