# 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.

Source: https://shuriken.sh/guides/change-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.

By Shuriken Updated 27 October 2026 3 min read

**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](https://code.claude.com/docs/en/model-config) 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](https://shuriken.sh/guides/opus-vs-sonnet-for-coding). When the [1m] window is worth it is in [the 1M context guide](https://shuriken.sh/guides/claude-code-1m-context-window).

## 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.

Shuriken runs your coding agents on your own computers and keeps them going when an account hits its limit.

[Download](https://shuriken.sh/download)

## How to set the model step by step #

### For one task #

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

### For one project #

- Open .claude/settings.json at the project root (create it if needed).
- Add "model": "sonnet" at the top level.
- 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](https://shuriken.sh/guides/claude-code-environment-variables).

## 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](https://shuriken.sh/guides/claude-code-effort-levels).

## 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.

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fchange-model-in-claude-code&text=How%20to%20change%20the%20model%20in%20Claude%20Code)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fchange-model-in-claude-code)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fchange-model-in-claude-code&t=How%20to%20change%20the%20model%20in%20Claude%20Code)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fchange-model-in-claude-code&title=How%20to%20change%20the%20model%20in%20Claude%20Code)[E-mail](mailto:?subject=How%20to%20change%20the%20model%20in%20Claude%20Code&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fchange-model-in-claude-code)

## Sources

- [Claude Code docs: Model configuration](https://code.claude.com/docs/en/model-config) (accessed 23 October 2026)
- [Claude Code docs: CLI reference](https://code.claude.com/docs/en/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.

Shuriken

The harness for your coding agents.

Run Claude Code, Codex and Gemini CLI on your own computers, move chats to your next account at a limit, and follow every chat from any device.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [Claude Code API Error 400 on tool_use: what to do: Guide 27 Oct 2026 4 min read A Claude Code API Error 400 about tool use means the saved history has a tool call out of step with its result. Update, then rewind past the broken turn.](https://shuriken.sh/guides/claude-code-api-error-400-tool-use)
- [Claude Code custom slash commands: make your own: Guide 27 Oct 2026 3 min read Make your own Claude Code slash commands: one Markdown file in .claude/commands or a skill, with arguments, shell output and allowed tools. With examples.](https://shuriken.sh/guides/claude-code-custom-slash-commands)
- [Claude Code chat history deleted? Set cleanupPeriodDays: Guide 27 Oct 2026 5 min read Claude Code deletes session transcripts after 30 days by default. Raise cleanupPeriodDays in settings.json to keep them, and back up what you can't lose.](https://shuriken.sh/guides/claude-code-history-deleted-after-30-days)
- [Claude Code hooks not working? Why they don't fire: Guide 27 Oct 2026 6 min read A Claude Code hook that never fires is either not loaded (missing from /hooks) or loaded with a matcher that matches nothing. The causes and their fixes.](https://shuriken.sh/guides/claude-code-hooks-not-working)
- [Claude Code keyboard shortcuts and commands cheat sheet: Guide 27 Oct 2026 5 min read Every Claude Code keyboard shortcut worth knowing, for Mac and Windows, plus the slash commands that matter. One page, checked against Anthropic's docs.](https://shuriken.sh/guides/claude-code-keyboard-shortcuts)
- [Does Claude Code remember between sessions? How memory works: Guide 27 Oct 2026 6 min read Does Claude Code remember between sessions? Only through CLAUDE.md files and auto memory. A past chat comes back only when you resume it.](https://shuriken.sh/guides/claude-code-memory-between-sessions)
- [How to run Claude Code on a Chromebook: Guide 27 Oct 2026 7 min read Claude Code runs on a Chromebook inside ChromeOS's Linux if the chip is 64-bit, Intel and AMD chips have AVX, and there is 4 GB of RAM.](https://shuriken.sh/guides/claude-code-on-a-chromebook)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
