Claude Code models: which ones you can use and how to switch
As of October 2026, Claude Code runs Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 on the Anthropic API, and older versions by full model name. Opus 5.5 is the default on Pro, Max, Ultra, Team, Enterprise and the API. Switch with /model inside a session, claude --model at launch, the ANTHROPIC_MODEL variable, or the model field in settings.json. Use Sonnet for routine work, Haiku for simple subagent jobs, and Fable for tasks larger than one sitting.
Which models can Claude Code use?
Claude Code picks a model through an alias, so you do not have to remember version numbers. The alias points at the newest recommended version for your provider and moves forward when Anthropic ships a new one. This table is from the model configuration page of the Claude Code docs, checked in October 2026.
| Alias | Resolves to | What the docs say it is for |
|---|---|---|
| default | Opus 5.5 on Pro, Max, Ultra, Team, Enterprise and the Anthropic API | Clears any override and returns to the default for your account |
| opus | Opus 5.5 | Complex reasoning |
| sonnet | Sonnet 5.5 | Daily coding tasks |
| haiku | Haiku 5.5 | Simple tasks, fast and efficient |
| fable | Fable 5.1 | Your hardest and longest-running tasks |
| best | The model fable resolves to where Fable is available to you, otherwise the same as opus | Shortcut for the strongest model you can use |
| opusplan | Opus while in plan mode, then Sonnet for execution | Planning with the stronger model, building with the cheaper one |
| sonnet[1m] and opus[1m] | The same models with a 1 million token window | No effect when the model already has that window natively |
Fable is never the account default. You choose it yourself. The docs describe Fable 5.1 and Fable 5 as the most capable models in Claude Code, suited to tasks larger than a single sitting.
Other providers resolve the aliases to older models. On Amazon Bedrock and Google Cloud's Agent Platform, opus is Opus 5.5 but sonnet is Sonnet 4.5 and haiku is Haiku 4.5. On Microsoft Foundry the defaults are Opus 4.6, Sonnet 4.5 and Haiku 4.5, and the default model there is Sonnet 4.5. If you want the newer model on those providers, select it by its full name or set ANTHROPIC_DEFAULT_OPUS_MODEL or ANTHROPIC_DEFAULT_SONNET_MODEL.
How do you switch models in Claude Code?
There are five ways to set the model, listed here from highest to lowest priority. The first one that applies wins.
- During a session: type /model followed by an alias or name, such as /model sonnet. Run /model with no argument to open the picker.
- At launch: start with claude --model opus (or any alias or full name).
- Environment variable: set ANTHROPIC_MODEL to an alias or name in your shell.
- Settings file: put a model field in settings.json. This is the permanent option.
- Default for new sessions: set ANTHROPIC_DEFAULT_MODEL. It applies only when none of the four above selects a model, and it needs Claude Code v2.1.236 or later.
The picker has one detail worth knowing. Pressing Enter on a row switches the model and saves it as your default. Pressing s switches for the current session only and leaves your saved default alone. Typing /model sonnet directly behaves like Enter, so it saves.
# Start a session on Opus claude --model opus # Switch inside the session (also saves it as your default) /model sonnet # Open the picker; press s on a row to switch for this session only /model # Pin an exact version instead of an alias claude --model claude-opus-5-5 # Fable 5.1 through its alias /model fable # Check which model you are on /status
Three behaviors catch people out. First, a session you resume with claude --resume or --continue usually keeps the model it was using, not your current default. Second, if you switch with /model, subagents that inherit the main conversation's model switch too, because their model is resolved from the one your session uses when Claude starts them. To keep a custom subagent on a smaller model, set the model field in its definition (see the subagents guide). Third, to run different models in different terminals at the same time, launch each with its own --model flag instead of switching with /model.
How do you set a default model in settings.json?
Add a model field to a settings file. The user file at ~/.claude/settings.json applies to every project on your machine. The project file at .claude/settings.json applies to everyone who works in that folder, and the local file .claude/settings.local.json is yours alone for one project. The permissions guide explains how these files stack.
{
"model": "opus",
"permissions": {
"allow": ["Bash(npm run lint)"]
}
}The docs give this exact shape, with a model next to a permission rule. A value can be an alias or a full model ID. The /model command also writes this field into ~/.claude/settings.json when you save a choice.
If a new session starts on a different model than the one you picked, the docs list the usual causes. You chose it for one session only (the s key, --model, or /model in non-interactive mode). Something with higher priority sets the model, such as a model value in project or managed settings, or ANTHROPIC_MODEL in your shell. The file ~/.claude/settings.json is not writable. Or you resumed a session that kept its old model. When project or managed settings set the model, the startup header names the file.
Which model should you use for which job?
The docs' own guidance is short. The default, Opus 5.5, handles most coding well. Sonnet costs less on routine work. Fable is there when you select it explicitly. Haiku is a good fit for subagents doing simple jobs. The table turns that into choices for a builder working through an app idea.
| Job | Start with | Why |
|---|---|---|
| Building features with a clear scope | default (Opus 5.5) or sonnet | The docs call Opus 5.5 capable for most coding and Sonnet cheaper on routine work |
| Planning a new app before any code exists | opusplan | Opus reasons while in plan mode, Sonnet writes the code afterwards |
| Renames, small edits, quick questions | sonnet or haiku, effort low | You review every result anyway, so extra deliberation adds only waiting |
| Root-cause debugging in code you did not write | default or fable, effort high | The docs name investigations and outage debugging as where Fable pays off |
| Large, ambiguous tasks that run for a long time | fable | Described as sustaining long autonomous sessions and verifying its own work |
| Research or test runs inside subagents | haiku in the subagent definition | Simple jobs do not need the strongest model |
Two cost notes from the docs. Depending on your plan and seat tier, Fable usage can bill to usage credits instead of your plan's included limits. When it does, the /model picker shows “Requires usage credits” on the Fable row. And requests that a Fable model's safety classifiers flag, most often in cybersecurity and biology topics, trigger automatic model fallback. For plan details see the Claude Code pricing guide and the usage limits guide.
If you are starting a project from a build prompt, a sensible split is to run the first planning pass in plan mode on opusplan, review the plan, then let the session build. The guide to building an app with Claude Code walks through that flow, and every idea on the board comes with a ready prompt to paste.
What is effort, and how is it different from the model?
The model decides who does the thinking. Effort decides how much thinking happens. Effort controls adaptive reasoning: the model chooses whether and how long to think on each step, and a lower level is faster and cheaper while a higher level reasons more deeply. The docs say effort has replaced most of what people used to do with prompt wording.
| Level | When the docs suggest it |
|---|---|
| low | Quick exchanges where you review each result: brainstorming, a first sketch, a rename |
| medium | The default on Opus 5.5, Sonnet 5.5 and Haiku 5.5; day-to-day work with a clear scope |
| high | Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase; the default on most other models |
| xhigh | Deeper reasoning at higher token spend; the default on Opus 4.7 |
| max | Hard problems you want worked through without you; it can overthink, so test before adopting it widely |
Set it with /effort and a level name, or run /effort alone for a slider. Use /effort auto to clear your saved level for the active model. In the picker, the left and right arrows adjust effort. Enter saves the level as your default and s applies it to the current session only. The max level is session-only unless you set it through the CLAUDE_CODE_EFFORT_LEVEL variable.
For one hard question in the middle of routine work, put the word ultrathink in that prompt instead of changing the setting. The docs say other phrases such as “think hard” are ordinary prompt text, not keywords. Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models also cannot have thinking switched off.
How big is the context window for each model?
Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with a 1 million token window by default, with no [1m] suffix needed. Opus 4.6 and Sonnet 4.6 reach 1 million only through their [1m] variants, and access depends on your plan. On the Anthropic API the 1 million window uses standard model pricing with no premium for tokens beyond 200K, except Haiku 5.5, which costs more on prompts longer than 100K tokens.
To keep sessions at a 200K window, set CLAUDE_CODE_DISABLE_1M_CONTEXT=1. A bigger window does not mean you can stop managing context. A long conversation is re-sent with each request, so it still costs more. The context window guide covers compaction and what to do about it.
How do you pin a version or set a fallback model?
Aliases move. If you need a repeatable setup, such as a team project or a CI job, pin the full name, for example claude-opus-5-5, or set the matching environment variable: ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL or ANTHROPIC_DEFAULT_HAIKU_MODEL. A mistyped value set through --model, ANTHROPIC_MODEL or the model setting is not checked at startup. You see an error on the first request.
When the primary model is overloaded or returns a non-retryable server error, Claude Code can switch to a fallback model for that turn. Pass --fallback-model with a comma-separated list, or set fallbackModel as an array in settings. Chains are capped at three models, and the switch lasts for the current turn only.
claude --model opus --fallback-model sonnet,haiku
Administrators can restrict which models appear with availableModels and block specific ones with deniedModels in managed settings. If your picker is missing a model you expect, an allowlist is the first thing to check.
Frequently asked questions
What is the default model in Claude Code?
As of October 2026, the default is Opus 5.5 on Pro, Max, Ultra, Team, Enterprise and the Anthropic API, and on Amazon Bedrock and Google Cloud's Agent Platform. On Microsoft Foundry the default is Sonnet 4.5. An administrator can set an organization default that replaces these. Run /model default to clear any override and return to your account's default.
How do I change the model in Claude Code?
Type /model followed by an alias such as sonnet, opus, haiku or fable. Or run /model alone for a picker. To start on a model, launch with claude --model opus. To make a choice permanent, set the model field in settings.json. Enter in the picker saves your choice as the default and s switches for the current session only.
Can Claude Code use Opus?
Yes. Opus 5.5 is the default on most plans, and the opus alias resolves to it on the Anthropic API. Select it with /model opus or claude --model opus. To pin it exactly, use the full name claude-opus-5-5. The opusplan alias uses Opus while you plan and Sonnet while it builds.
What does opusplan do in Claude Code?
Opusplan is a hybrid alias. In plan mode it uses the opus model for reasoning and architecture decisions, and in execution mode it switches automatically to sonnet for writing code. It pairs stronger reasoning for planning with lower cost for implementation. Set it with /model opusplan, and add [1m] only where the models do not already have the 1 million window.
Does Claude Code have a 1 million token context window?
Yes, on current models. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with a 1 million token window by default. Opus 4.6 and Sonnet 4.6 need their [1m] variants, and access depends on your plan. Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 to hold sessions to 200K.
Can I use different models in different terminals?
Yes. Launch each terminal with its own flag, for example claude --model opus in one and claude --model sonnet in another. The flag and the ANTHROPIC_MODEL variable apply only to the session you start with them. Switching with /model writes to your saved default, so use the flag when you want two models running side by side.
How do I pin a specific Claude model version in Claude Code?
Use the full model name instead of an alias, for example claude --model claude-opus-5-5, or set the matching environment variable such as ANTHROPIC_DEFAULT_OPUS_MODEL. Aliases point at the recommended version for your provider and change over time, so pinning keeps a team or CI job on the same model.
Created with AI assistance and edited for this site. Examples are illustrative and do not represent customer research. About the publisher.