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:
| Where | How | Lasts for |
|---|---|---|
| In a session | /model sonnet (or /model to open the picker) | Saved as default with Enter; s = this session only |
| At startup | claude --model opus | That session |
| Environment variable | ANTHROPIC_MODEL=haiku | That session |
| Settings file | "model": "opus" in settings.json | Every 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
| Alias | What it uses |
|---|---|
| default | Clears your override and goes back to your account's default |
| opus / best | The latest Opus (Opus 5.5) for complex reasoning |
| sonnet | The latest Sonnet (Sonnet 5.5) for daily coding |
| haiku | Haiku 5.5, fast and cheap for simple tasks |
| fable | Fable, for the hardest and longest-running tasks |
| opusplan | Opus 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?
| Job | Model | Why |
|---|---|---|
| Everyday coding, edits, tests | sonnet | Fast and capable, uses less of your limit |
| Hard bugs, architecture, big refactors | opus | Best reasoning; uses more usage |
| Quick mechanical changes, renames, summaries | haiku | Cheapest and fastest |
| Plan carefully, then build | opusplan | Opus plans, Sonnet executes |
| The longest, hardest agentic tasks | fable | Most 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:
/effortopens a slider;/effort highsets it directly;/effort autoclears your saved level. - At startup:
claude --effort low. - Levels:
low,medium,high,xhigh,maxon the current models. The default ismediumon 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
/modelwith no argument to open the picker; the current model is selected. - Run
/statusto 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 →