Claude Code models: how to change it, and the dial that matters more
Five places can set the model and they resolve in a fixed order. What the default actually is on your plan, why opusplan is the setting most people want and never find, why MAX_THINKING_TOKENS does nothing on newer models, and the honest answer about local models.
Five different things can set your model, and they resolve in this order, highest first:
/model <name>during the sessionclaude --model <name>at startupANTHROPIC_MODELin your environment- The
modelkey in settings ANTHROPIC_DEFAULT_MODEL, which applies to new sessions only when nothing above picks one
Most "I set the model and it ignored me" reports are a higher item in that list. Note that 3 beats 4: an ANTHROPIC_MODEL left in your shell profile silently outranks every settings file you own.
In the /model picker, Enter switches and saves as your default. Press s instead to switch for this session only. Typing /model sonnet directly behaves like Enter, which is how people accidentally change their default while trying to test something.
What model you are actually on
The question "what model does Claude Code use" has a plan-dependent answer, which is why nobody answers it cleanly:
| Plan | Default |
|---|---|
| Max, Team Premium, Enterprise, Anthropic API | Opus 5 |
| Pro, Team Standard | Sonnet 5 |
An organization default set by an admin overrides that. Aliases worth knowing beyond the obvious: default resolves to your account-type default, best resolves to Fable if available and Opus otherwise, and sonnet[1m] or opus[1m] request the 1M context variants.
Fable is never the account default. You select it explicitly, and on paid plans it may bill to usage credits, with a consent prompt in interactive sessions. A -p run never shows that prompt and bills automatically, which is worth knowing before you put --model fable in a cron job.
opusplan, the setting most people want and never find
/model opusplan
Opus for plan mode, Sonnet for execution, switched automatically. It matches how most people actually want to spend: heavy reasoning on deciding what to do, cheaper generation on doing it. opusplan[1m] gets you the extended context version.
If your organization's availableModels excludes the newest Opus but allows an older one, opusplan uses the newest permitted Opus for planning rather than giving up. It falls back to plain Sonnet only when every Opus is excluded.
Effort is the bigger dial
Switching Opus to Sonnet is the move everyone reaches for. The effort level often matters more, and almost nobody touches it.
/effort high # set directly
/effort # interactive slider
/effort auto # clear the saved level for the active model
claude --effort xhigh
On current models the levels are low, medium, high, xhigh, max, with high as the usual default. You can set them per model rather than globally, which is the configuration actually worth writing down:
{
"modelSettings": {
"claude-opus-5": { "effortLevel": "xhigh" },
"claude-sonnet-5": { "effortLevel": "medium" }
}
}
Three behaviors that will otherwise confuse you:
- Some models hold your first choice. Claude Code remembers the first effort level you run certain models at and reuses it across sessions. If a model feels permanently stuck at a level you do not remember choosing,
/effort autoclears it. Entersaves,sis session-only. Same pattern as the model picker, same accidental-default problem.maxis always session-only unless you set it throughCLAUDE_CODE_EFFORT_LEVEL.
Effort costs real money because thinking tokens bill as output tokens, which we covered in the cost post. Turning effort down for shallow work is a better first lever than downgrading the model, because it keeps the model's judgment and cuts the part you were not using.
Why MAX_THINKING_TOKENS does nothing
This one wastes afternoons. There are two different mechanisms and the advice you find online is usually for the old one.
Adaptive reasoning models decide per step whether to think, and the effort level is the control. MAX_THINKING_TOKENS is ignored. This covers Fable, Sonnet 5, and Opus 4.7 and later.
Fixed thinking budget models are the ones MAX_THINKING_TOKENS was for. On Opus 4.6 and Sonnet 4.6 you can also set CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 to go back to that mode.
So if you set MAX_THINKING_TOKENS=8000 and nothing changed, you are on an adaptive model and you wanted /effort instead. And you cannot turn thinking off at all on Fable models; they decide per step.
Option+T on macOS, Alt+T elsewhere, toggles thinking for the current session.
Context window, which is now a model property
Sonnet 5, Fable, and Opus 4.7 and later have native 1M windows and auto-compact around 967K by default. On the Anthropic API, Sonnet 5 always uses 1M with no [1m] suffix and no usage credits on any plan, which quietly changes the economics of long sessions.
To budget tighter:
/autocompact 500k # this session and future ones
claude --autocompact 200k # this session only
export CLAUDE_CODE_DISABLE_1M_CONTEXT=1 # treat native 1M models as 200K
The window accepts 200000, 500k, 1M, or the shorthand 200 meaning 200,000, and ranges from 100K to 1M capped at the model's real window.
Can you use a local model?
No. This comes up constantly and the honest answer is that Claude Code runs Anthropic models only. What is configurable is where they are served from: the Anthropic API, Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or an LLM gateway you run. The provider is a choice; the model family is not. If you need a local open-weights model, you need a different agent, not a different Claude Code setting.
Fallback, and the fallback you did not configure
claude --fallback-model sonnet,haiku
Up to three models, tried when the primary is overloaded or unavailable. It does not trigger on auth or billing errors, and it lasts one turn: your next message tries the primary again. Subagents use it too.
Separately, there is content-based fallback you did not set up. Safety classifiers on Fable and Opus 5 can route certain requests to a different model rather than refusing. If you would rather be asked:
{ "switchModelsOnFlag": false }
That pauses the session so you can switch or edit and retry. In non-interactive mode it becomes a refusal instead of a prompt.
When your organization decides for you
availableModels in managed or policy settings restricts the whole surface: /model, --model, ANTHROPIC_MODEL, the model key, subagents, teammates, skills, and fast mode toggles. Aliases resolve to the newest permitted version. A blocked /model is rejected outright, while a blocked --model or env var is replaced at startup with a warning, and a blocked subagent quietly runs on the fallback instead.
Admins can also cap effort per role. Naming a higher level runs at the cap, with a warning in interactive sessions only, so a scripted run is silently capped.
How we would set it up
- Default to
opusplanif you use plan mode seriously. It is the one setting that changes spend shape rather than just spend level. - Set effort per model rather than globally, high on the expensive model and medium on the cheap one.
- Reach for
/effortbefore/modelwhen something feels slow or expensive. Downgrading the model changes judgment; lowering effort usually does not. - Set
model: haikuon simple subagents, since a summarizer does not need your session model. - Check your shell for a stale
ANTHROPIC_MODELbefore debugging anything else, because it outranks every file you would think to edit.
The general shape: the model picks how good the reasoning can be, effort picks how much of it you buy, and the context window picks how much history every request drags along. Most people only ever touch the first one, which is why their usage limits arrive earlier than they expect.