How to change the model in Claude Code

Change the model in Claude Code with /model, claude --model, an environment variable or settings.json. /model wins; Enter in its picker sets your default.

Contents

To change the model in Claude Code, type /model and pick from the list, or type /model sonnet to skip the picker. claude --model opus starts a session on Opus. For a standing default, put "model": "opus" in a settings file or export ANTHROPIC_MODEL=opus. When they disagree, /model wins.

Every alias, default and version on this page is from Anthropic's model configuration docs as we read them on 23 October 2026, including the order below, which decides what a session really runs on.

The four ways to set the model, in order#

Claude Code checks these from the top. The first one that is set wins.

Order How Lasts
1 /model <alias or name> in a session, or /model for the picker Saved as your default (Enter), or this session only (s in the picker)
2 claude --model <alias or name> when you start This session
3 ANTHROPIC_MODEL=<alias or name> in your shell Every session started from that shell
4 "model": "opus" in your settings file Every session that reads that file

New sessions have a fifth: ANTHROPIC_DEFAULT_MODEL sets the model a new session starts on. The docs say it needs Claude Code v2.1.236 or later.

Row 1 is where people get caught. Enter in the /model picker changes your default for next time as well. To try Opus on one task and come back to Sonnet tomorrow without thinking about it, press s instead.

What the aliases mean#

A full model name works anywhere an alias does. Aliases follow Anthropic's latest models, so a setting written as opus doesn't need editing when a new Opus ships.

Alias Meaning
default Clears your choice and goes back to your account's default
sonnet The latest Sonnet, for daily coding
opus The latest Opus, for complex reasoning
haiku The fast, small model, for simple tasks
fable Anthropic's Fable model, for the hardest and longest tasks
best Fable where your provider has it, otherwise Opus
sonnet[1m], opus[1m] The same models with a 1M-token context window
opusplan Opus in plan mode, then Sonnet to carry the plan out

On the Anthropic API, the docs say opus, sonnet and haiku resolve to Opus 5.5, Sonnet 5.5 and Haiku 5.5. Amazon Bedrock and other providers can resolve them to earlier versions. Four variables repoint an alias: ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and ANTHROPIC_DEFAULT_FABLE_MODEL each take the model ID you want that alias to mean.

Choosing between opus and sonnet is its own question, answered task by task in Opus vs Sonnet for coding. When the [1m] window is worth it is in the 1M context guide.

What the default is#

As of 23 October 2026, Anthropic lists Opus 5.5 as the default on Pro, Max, Team, Enterprise and the Anthropic API, and on Bedrock and Google Cloud too. Microsoft Foundry defaults to Sonnet 4.5. Fable is never the account default, and an Enterprise admin can set an organisation default that overrides it.

How to set the model step by step#

For one task#

  1. Type /model in the session.
  2. Pick the model.
  3. Press s, not Enter, so the choice ends with this session.

For one project#

  1. Open .claude/settings.json at the project root (create it if needed).
  2. Add "model": "sonnet" at the top level.
  3. Commit the file if the whole team should start on Sonnet.

For a script or CI job#

bash
claude -p --model haiku "Summarise the failing tests in test.log"

Put the flag in the script rather than an ANTHROPIC_MODEL export, because the next person reading the job sees the model on the same line as the prompt. The other variables Claude Code reads are in our environment variables guide.

Model and effort are two settings#

The model is who answers; the effort level is how hard it thinks. Effort has its own controls: /effort, --effort and CLAUDE_CODE_EFFORT_LEVEL. The docs list medium as the default effort for Opus 5.5, Sonnet 5.5 and Haiku 5.5, and what each level is for is in our effort levels guide.

Picking the model in Shuriken#

In Shuriken the model is a picker in each chat's message box, next to Thinking. A project's next chat starts on the model and thinking last chosen in one of its chats. Until you choose one it starts on Auto, which is Claude Code's own default. The project's settings show which applies, under New chats, and Use app defaults clears it. When a provider starts listing a new model, Shuriken pops up a notice with Try it and Set as default, and the picker marks the model New.

Sources

  1. Claude Code docs: Model configuration (accessed 23 October 2026)
  2. Claude Code docs: CLI reference (accessed 23 October 2026)

Frequently asked questions

What is the default model in Claude Code?

On 23 October 2026 Anthropic's model docs list Opus 5.5 as the default on Pro, Max, Team, Enterprise and the Anthropic API. Fable is never the account default, and an Enterprise admin can set a different one.

Does /model change the model for every new session?

Yes, unless you choose otherwise. The docs say /model saves the choice as your default. In the picker, Enter saves it and s applies it to the current session only.

What does opusplan do?

It uses Opus while you are in plan mode and switches to Sonnet when Claude starts carrying out the plan.

Which wins: --model, ANTHROPIC_MODEL or settings.json?

/model during a session wins, then the --model flag, then the ANTHROPIC_MODEL environment variable, then the model field in your settings file.

Free tools