How to Use Claude Opus 4.5 in Claude Code: Switch, Pin the Version, and Control Cost
Introduction
Claude Opus 4.5 is the model that first broke 80% on SWE-bench Verified, and it still runs inside Claude Code today. The catch is that it is no longer the default. The opus alias now points to a newer Opus, and the current flagship, Opus 5.5, is both cheaper and longer-context. So using Opus 4.5 is a deliberate choice now: you pick it when you want a pinned, known snapshot for a workflow you have already tuned, not when you want the newest or cheapest model. This tutorial shows the three ways to select it, how to pin it, and how to check what it costs you.
Quick answer
Run /model claude-opus-4-5-20251101 inside Claude Code, or launch with claude --model claude-opus-4-5-20251101. Pin it permanently with ANTHROPIC_MODEL or the model field in settings.json. Use the full ID, because the opus alias follows the newest Opus.
Evidence
Opus 4.5 earned its reputation on real coding work. Anthropic’s launch announcement states it is “the best model in the world for coding, agents, and computer use,” and reports that it was the first model to pass 80% on SWE-bench Verified, scoring 80.9% at launch, ahead of Gemini 3 Pro at 76.2% and GPT-5.1 at 76.3%. That benchmark tests models on real GitHub pull requests, not on synthetic puzzles.
The pricing is what made 4.5 famous, and also what dates it. At launch it cost $5 per million input tokens and $25 per million output tokens, a 66% price cut over Opus 4.1. Since then, newer Opus models kept the same $5/$25 rate while adding a 1M-token context window, and Opus 5.5 cut the price further to $4 input and $20 output per million tokens. Opus 4.5 keeps its original 200,000-token context window and 64,000-token maximum output. The honest reading is that 4.5 has no price advantage left, but it remains a strong, stable, well-measured model for everyday coding.
Inside Claude Code specifically, Opus 4.5 brought a real upgrade to Plan Mode. The announcement notes that Plan Mode “now builds more precise plans and executes more thoroughly,” asking clarifying questions up front and then building a user-editable plan.md file before executing. That is the feature that makes 4.5 worth pinning for architecture work and multi-file refactors, where a good plan saves more tokens than a cheaper model does. For the mechanics of switching models, the Claude Code model configuration docs list the four methods in priority order, and the models overview confirms Opus 5.5 as the current default recommendation.
Prerequisites
- Claude Code installed and working. Run
claude --versionandclaude updatefirst, since model selection behavior changed across versions, and the/modelpicker only saves defaults reliably on recent releases. - An Anthropic account with Opus access. API users get Opus 4.5 through the API. Max and Team Premium subscribers had their Opus usage limits increased when 4.5 launched. If you are on a lower plan, check your plan’s Opus access before assuming the model will appear.
- A terminal where you can set environment variables, plus a text editor for the settings file.
- About 15 minutes, and a small test task to try the model on before you commit a real project to it.
Step-by-step guide
Step 1: Check your Claude Code version and current model
Open a terminal and confirm what you are running:
claude --version
claude update
Then start Claude Code and check the active model:
/status
The status output shows the model, the account, and the current context usage. If /status shows a Sonnet or a newer Opus, you are on the default and need to switch. If it already shows claude-opus-4-5-20251101, skip to Step 6.
Step 2: Switch inside a session with /model
This is the fastest method. Inside a running session, type:
/model
An interactive picker opens. Press Enter on a model to switch and save it as your default for new sessions, or press s to switch for this session only. To skip the picker and switch immediately, pass the model directly:
/model claude-opus-4-5-20251101
Typing /model <name> directly behaves like pressing Enter: it switches and saves the choice as your default. That is convenient, but a quick experiment can quietly become your permanent default. If you only want 4.5 for one task, use the picker and press s, or use the --model flag in Step 3 instead.
Never rely on the short alias when you mean a specific version:
/model opus
This switches to whatever the opus alias currently resolves to, which is the newest Opus for your provider, not 4.5. The alias is handy, but it drifts with every release, and it is the reason people report that “Opus 4.5 disappeared from the picker.” It did not disappear. The alias moved on, and the full model ID is still there.
Step 3: Launch a single session with –model
When you want Opus 4.5 for one session without touching any default, launch it from the flag:
claude --model claude-opus-4-5-20251101
The flag applies only to the session you launch. The next time you start Claude Code normally, it goes back to your saved default. This is the safest method for trying 4.5 on a real task, because nothing persists. It is also the right method when you run two terminals at once with different models: launch each one with its own --model flag rather than switching with /model. Use the full ID in scripts. Aliases are fine for interactive use, but a script that says opus will silently run a different model six months from now.
Step 4: Pin Opus 4.5 as your default with ANTHROPIC_MODEL
If you want every new session to start on Opus 4.5, set the environment variable in your shell profile:
echo 'export ANTHROPIC_MODEL="claude-opus-4-5-20251101"' >> ~/.zshrc
For bash, use ~/.bashrc instead of ~/.zshrc. Then reload the shell or open a new terminal and start Claude Code:
claude
Every session launched with that variable present uses Opus 4.5. The variable accepts an alias or a full model name, but the full ID is the version that does not drift.
Know the priority order, because it explains most “my model setting did nothing” complaints. From highest to lowest: /model during a session, then the --model flag, then ANTHROPIC_MODEL, then the model field in your settings file. A higher-priority source always wins.
Step 5: Pin it per project in settings.json
Environment variables are global. When you want Opus 4.5 for one repository and the default everywhere else, put the model in the project settings file instead. Create or edit .claude/settings.json in the project root:
{
"model": "claude-opus-4-5-20251101"
}
For a global default across all projects, put the same model field in ~/.claude/settings.json. The settings file is the lowest-priority source, so ANTHROPIC_MODEL or a --model flag still overrides it when present.
Step 6: Use Opus 4.5 for planning with opusplan
Opus 4.5’s best role is planning complex work. The opusplan mode uses Opus while planning and Sonnet while executing:
/model opusplan
Or start a planning-only session explicitly:
/plan
With Opus 4.5 active, Plan Mode asks clarifying questions up front, then writes a plan.md file you can edit before anything runs. Read that file before approving it. The plan is where 4.5 earns its keep: a precise plan with the right files and the right order prevents the long, expensive correction loops that happen when a model starts coding before it understands the task. For more on controlling how much thinking each agent does, see our guide to Claude Code subagent effort levels.
Step 7: Verify the model and watch the cost
After switching, confirm the change took effect:
/status
The status output should show claude-opus-4-5-20251101 as the active model. Then run a real task and check what it cost:
/cost
The /cost command shows token usage and an estimated cost for the current session. It is intended for API users, and the dollar figure is a local estimate, so check the Claude Console for authoritative billing. Subscribers can use /stats instead.
Do the arithmetic once yourself so the estimate makes sense. At $5 per million input tokens and $25 per million output tokens, a session with 100,000 input tokens and 20,000 output tokens costs about $1.00. The same session on Opus 5.5 at $4/$20 would cost about $0.80. The difference is small on one session, but it adds up across a week of heavy use.
Step 8: Decide when 4.5 is enough and when to move up
Use Opus 4.5 when the work is already tuned to it, when you need a stable snapshot for reproducibility, or when you are comparing a new model against a known baseline. A regression test that ran on 4.5 last month should run on 4.5 again, or the comparison is meaningless. Use it for planning, architecture, and multi-file refactors where its Plan Mode improvements and 80.9% SWE-bench Verified score matter more than raw context size.
Move to Opus 5.5 when the task needs a context window larger than 200,000 tokens, when you are starting a new long-running agentic workflow, or when cost is the deciding factor. Opus 5.5 gives you a 1M-token context window at $4/$20, so it wins on both size and price. If your prompts approach the 200K ceiling on 4.5, switch models or split the work. For connecting external tools to either model, our Claude Code MCP setup guide works the same regardless of which model is active.
Troubleshooting
The /model picker does not list Opus 4.5
The picker shows aliases and the models your provider serves. If 4.5 is missing, type the full ID directly instead of browsing: /model claude-opus-4-5-20251101. The picker is a convenience, not the full list. If the full ID also fails, check your plan, since Opus access depends on your subscription or API account. Run claude update as well, since older Claude Code versions may not know about a model that your account can already use.
ANTHROPIC_MODEL is set but sessions still start on another model
Check the priority order. A model field saved earlier by /model does not beat the environment variable, but a --model flag does, and so does an in-session /model switch. More commonly, the variable is set in the wrong shell file: ~/.zshrc for zsh, ~/.bashrc for bash, and it only takes effect in terminals opened after you saved it. Run echo $ANTHROPIC_MODEL in the same terminal before launching Claude Code. If it prints nothing, the export never loaded.
Switching mid-session made the next response slow and expensive
Switching models forces Claude Code to re-read the full conversation history with the new model, which costs tokens and time. The fix is to switch before the conversation grows: pick your model at launch with --model, or switch in a fresh session. If you are already deep in a session, run /compact first to summarize the context down, then switch.
The session hits the 200K context limit
Opus 4.5 has a 200,000-token context window, and long repositories plus long conversations fill it faster than people expect. When you see context warnings, run /compact to summarize, or start a fresh session for the next chunk of work. For a task that genuinely needs more than 200K tokens in one window, switch to Opus 5.5 with its 1M-token window instead of fighting the limit. Our Claude Code projects guide explains how to scope work so each session starts with the right context.
Output feels weaker than the benchmark promises
SWE-bench Verified measures autonomous bug fixing on real repositories with clear test suites, and 80.9% is a strong result on that task. It does not guarantee the same quality on vague prompts, missing context, or tasks without tests. If 4.5 gives you weak output, the usual cause is an underspecified prompt, not the model. Write the plan first, name the files to change, state the expected behavior, and point at the tests that prove it. If the output is still weak after that, compare the same task on Opus 5.5 to see whether the newer model actually does better on your workload.
FAQ
What is the exact model ID for Claude Opus 4.5 in Claude Code?
The full model ID is claude-opus-4-5-20251101. Use the full ID when you want that exact snapshot, because the short opus alias always resolves to the newest Opus model, which is no longer 4.5.
Is Opus 4.5 still worth using now that Opus 5.5 exists?
Yes, for pinned, stable workflows. Opus 4.5 scored 80.9% on SWE-bench Verified and handles most coding work well, but Opus 5.5 is cheaper at $4/$20 per million tokens and has a 1M-token context window, so new long-running work should start on 5.5.
How much does Opus 4.5 cost in Claude Code?
API pricing is $5 per million input tokens and $25 per million output tokens. A session with 100,000 input tokens and 20,000 output tokens costs about $1.00 at list rates. Subscription users pay through their plan instead, and /cost shows the session estimate.
Why did /model opus give me a different model than Opus 4.5?
The opus alias points to the newest Opus release for your provider, not to 4.5. Run /model claude-opus-4-5-20251101 with the full ID to stop the alias from drifting.
Does switching models mid-session lose my conversation?
No, the conversation stays, but Claude Code re-reads the full history with the new model, which costs extra tokens. Switch before you start a long task when you can, and use /compact first if the context is already large.
Can I use Opus 4.5 with Plan Mode?
Yes. Type /model opusplan to use Opus for planning and Sonnet for execution, or run /model claude-opus-4-5-20251101 and then start planning with /plan. Opus 4.5 improved Plan Mode with more precise plans and an editable plan.md file.
Conclusion
Claude Opus 4.5 in Claude Code is a one-line switch, but the useful skill is knowing which one-liner to use. /model claude-opus-4-5-20251101 switches for a session, claude --model claude-opus-4-5-20251101 launches a single session, and ANTHROPIC_MODEL or the model field in settings.json pins it as your default. Use the full model ID every time, because the opus alias follows the newest release. Keep 4.5 for stable, tuned workflows and planning-heavy work, and reach for Opus 5.5 when you need a 1M-token window or the lower $4/$20 rate. Verify with /status, watch the spend with /cost, and let your own tasks decide which model earns the default.
Frequently asked questions
What is the exact model ID for Claude Opus 4.5 in Claude Code?
The full model ID is claude-opus-4-5-20251101. Use the full ID when you want that exact snapshot, because the short opus alias always resolves to the newest Opus model, which is no longer 4.5.
Is Opus 4.5 still worth using now that Opus 5.5 exists?
Yes, for pinned, stable workflows. Opus 4.5 scored 80.9% on SWE-bench Verified and handles most coding work well, but Opus 5.5 is cheaper at $4/$20 per million tokens and has a 1M-token context window, so new long-running work should start on 5.5.
How much does Opus 4.5 cost in Claude Code?
API pricing is $5 per million input tokens and $25 per million output tokens. A session with 100,000 input tokens and 20,000 output tokens costs about $1.00 at list rates. Subscription users pay through their plan instead, and /cost shows the session estimate.
Why did /model opus give me a different model than Opus 4.5?
The opus alias points to the newest Opus release for your provider, not to 4.5. Run /model claude-opus-4-5-20251101 with the full ID to stop the alias from drifting.
Does switching models mid-session lose my conversation?
No, the conversation stays, but Claude Code re-reads the full history with the new model, which costs extra tokens. Switch before you start a long task when you can, and use /compact first if the context is already large.
Can I use Opus 4.5 with Plan Mode?
Yes. Type /model opusplan to use Opus for planning and Sonnet for execution, or run /model claude-opus-4-5-20251101 and then start planning with /plan. Opus 4.5 improved Plan Mode with more precise plans and an editable plan.md file.