Claude Code models: what each alias means, how to change model, and what each costs
Which models Claude Code can use, what opus, sonnet, haiku, fable and opusplan mean today, how to change model, and what each cost on one machine.
Claude Code supports Claude models only: Opus, Sonnet, Haiku and Fable. You pick one by alias (opus, sonnet, haiku, fable) or by full model ID, and change it mid-session with /model. On the Anthropic API today opus is Opus 5.5 and sonnet is Sonnet 5.5, and Opus 5.5 is the default on every Claude plan.
Claude Code models list: the aliases today
An alias points at the recommended version for your provider and moves when Anthropic ships a new one. These are the targets on the Anthropic API:
| Alias | Resolves to | For |
|---|---|---|
default | your account's default: Opus 5.5 | clearing an override |
opus | Opus 5.5 | complex reasoning |
sonnet | Sonnet 5.5 | daily coding |
haiku | Haiku 5.5 | simple tasks |
fable | Fable 5.1 | the hardest, longest tasks |
best | Fable 5.1 where available, else opus | the top model you can use |
opusplan | Opus in plan mode, Sonnet after | planning, then executing |
opus[1m], sonnet[1m] | the same model with a 1M window; no effect on Opus 5.5 or Sonnet 5.5, which already have it | long sessions |
claude-haiku-4-5, if you want it. Opus 5.5 needs Claude Code v2.1.280 or later, Sonnet 5.5 v2.1.284 and Haiku 5.5 v2.1.293; run claude update if a request for one fails.The targets differ by provider:
- Amazon Bedrock and Google Cloud's Agent Platform:
opusis Opus 5.5,sonnetis Sonnet 4.5. - Claude Platform on AWS:
opusis Opus 5.5,sonnetis Sonnet 4.6. - Microsoft Foundry:
opusis Opus 4.6,sonnetis Sonnet 4.5, anddefaultis Sonnet 4.5.
On all of them haiku is still Haiku 4.5.
To stay on one version, use the full ID, such as claude-opus-5-5, or set ANTHROPIC_DEFAULT_OPUS_MODEL (and the _SONNET_, _HAIKU_, _FABLE_ variants). Fable 5 stays selectable by its full ID, claude-fable-5.
The 1M window: on the Anthropic API, Opus 4.7 and later, Sonnet 5 and later, Haiku 5.5 and both Fable models run with a 1M context window on every plan, including Pro, with no [1m] to select. The suffix matters for Opus 4.6 and Sonnet 4.6.
How to change model in Claude Code
- 1
Switch in a session and save it as your default
- 2
Open the picker; Enter saves, s switches for this session only
- 3
Start one session on a model
- 4
Pin a version
When more than one is set, this order wins: /model in the session, then --model, then ANTHROPIC_MODEL, then the model key in settings, then ANTHROPIC_DEFAULT_MODEL. The settings key looks like this:
{ "model": "opus" }
Put it in ~/.claude/settings.json for every project, or in .claude/settings.local.json to change your own sessions in one project without changing your team's committed file.
- Check the current model:
/status, or your status line if it shows one. - Switching costs a cache miss. Each model has its own prompt cache, so the first request after
/modelre-reads the whole conversation uncached. Claude Code asks you to confirm only while the cache is still warm. - A resumed session keeps its model.
claude --resumeand--continuerestore the model the transcript was using, unless you pass--modelor setANTHROPIC_MODEL(or anANTHROPIC_DEFAULT_*_MODELvariable). On Bedrock, Agent Platform and Foundry the transcript model is not restored. - A new session started on another model: a project or managed
model,ANTHROPIC_MODELin your shell, or an organization default your admin set to override user choices outranks your/modelchoice. The startup header names the settings file that set it.
Claude Code Opus, Sonnet, Haiku or Fable
Anthropic's cost advice is direct: Sonnet handles most coding tasks well and costs less than Opus; keep Opus for complex architecture and multi-step reasoning, and use model: haiku for simple subagents. Fable is for work larger than one sitting: long autonomous sessions and ambiguous problems such as root-cause investigations.
List prices per million tokens, input and output, from Anthropic's pricing page:
- Fable 5.1: $10 and $50.
- Opus 5.5: $4 and $20. Opus 5 and Opus 4.8 are $5 and $25.
- Sonnet 5.5 and Sonnet 5: $2 and $10.
- Haiku 5.5: $0.10 and $0.50 on prompts up to 100,000 tokens, $0.50 and $2.50 above that.
- Haiku 4.5: $1 and $5.
Cache reads, cache writes and every other model: Claude API pricing.
opusplan splits the difference: Opus while you are in plan mode, Sonnet once you execute. Each toggle is a model switch, so it starts a fresh cache.
What each plan allows
- Every plan gets Opus 5.5 by default: Pro, Max, Team, Enterprise and the API.
- Fable can bill to usage credits instead of your plan's limits, depending on your plan and seat. The
/modelpicker then says "Requires usage credits", and Claude Code asks before the first such request in an interactive session. With-pit bills without asking. - Model-specific limits: after "You've hit your Opus limit" or "You've hit your Sonnet limit", switching to the other family with
/modelkeeps you working. The session and weekly limits are shared by all models, so switching does not help there; see Claude usage limits. - Admins can restrict the list with
availableModelsin managed settings; then/model,--modeland your ownmodelkey pick only from it.
Which model a subagent uses
A subagent's model comes from, in order: the model Claude passes for that call, the model field in its definition (inherit means yours), the CLAUDE_CODE_SUBAGENT_MODEL variable, then the main conversation's model. So /model opus also moves every subagent that inherits. To keep one on a smaller model, set model: haiku in its file. /tasks names the model on each running subagent's row. More in Claude Code subagents.
Can Claude Code use other models, or local models?
Besides Anthropic's API, Claude Code reaches Claude through cloud providers and gateways, each with its own switch:
- Amazon Bedrock:
CLAUDE_CODE_USE_BEDROCK=1; the model ids become inference profiles such asus.anthropic.claude-opus-5-5: Claude Code on Bedrock. - Google Cloud's Agent Platform (formerly Vertex AI):
CLAUDE_CODE_USE_VERTEX=1. - Microsoft Foundry:
CLAUDE_CODE_USE_FOUNDRY=1. - An LLM gateway your organization runs:
ANTHROPIC_BASE_URLplus a gateway credential.
All of them serve Claude models, as does Claude Platform on AWS. Anthropic's docs are explicit about the rest: ANTHROPIC_BASE_URL "changes where requests are sent, not which model answers them", and Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway". Third-party gateway products exist; Anthropic does not endorse, maintain or audit them. A local model behind a proxy that imitates Anthropic's API is outside what Anthropic supports.
Two things change on these routes. On Bedrock, Agent Platform, Foundry and the Claude apps gateway, the /model picker shows no prices, because the provider sets them; through a gateway that proxies Anthropic's API it still shows list prices. And with a gateway credential active, your claude.ai plan's limits do not apply: the traffic is billed per token to whoever owns the credential.
Claude Code with Ollama
Ollama documents its own route: it serves part of Anthropic's Messages API, and Claude Code points at it with ANTHROPIC_BASE_URL. That is the non-Claude case Anthropic does not support, so what works is Ollama's to say. From Ollama's docs, read 8 October 2026:
- 1
Start Claude Code through Ollama
- 2
Or point Claude Code at a local Ollama server yourself
- 3
Give it Ollama's placeholder token and no Anthropic key
- 4
Start it on a local model
- Context: Ollama asks for a local model with a context window of 64K tokens or more.
- Not supported: Ollama's API does not support prompt caching, token counting or
tool_choice, and its token counts are approximations. - Ollama Cloud: set
ANTHROPIC_BASE_URL=https://ollama.comwith an Ollama API key to run hosted models with no local install. - Your Claude plan: the requests go to Ollama, not Anthropic, so they use none of it.
Caprock has no Ollama prices. A model missing from its price table, such as qwen3.5, shows as unpriced with its token count, never as $0; a model whose name starts with one Caprock does price is priced at that maker's list price, not at what Ollama charges.
What each model cost on my machine
Every Claude Code call on my machine from 18 July to 5 October 2026, read with caprock export and priced at Anthropic's list prices: 88,890 API calls, $14,460. It is one heavy user's machine, not a benchmark and not a bill.
- 57.9%
- of the list-price cost was Opus 5: $8,378 from 45,024 calls
- 26.6%
- was Opus 4.8: $3,844 from 20,993 calls
- 9 of 71
- sessions with main-thread calls used more than one model
| Model | Calls | Cost | Share |
|---|---|---|---|
| Opus 5 | 45,024 | $8,378 | 57.9% |
| Opus 4.8 | 20,993 | $3,844 | 26.6% |
| Opus 5.5 | 14,057 | $880 | 6.1% |
| Fable 5 | 1,860 | $856 | 5.9% |
| Sonnet 5 | 6,829 | $501 | 3.5% |
| Haiku 4.5 | 122 | $1 | — |
Where a call is made matters as much as the model. A main-thread call carries the whole conversation; a subagent starts fresh.
- Main thread, per call: Fable 5 $0.541, Opus 4.8 $0.302, Opus 5 $0.282, Sonnet 5 $0.115.
- Subagents, per call: about $0.054 on Opus 5, 4.8 and 5.5, $0.027 on Sonnet 5, $0.009 on Haiku 4.5.
- Opus 5.5 on the main thread: $0.083 a call, but every Opus 5.5 call here came from 29 September on, weeks after I capped the auto-compact window at 500K on 9 September. Part of that gap is the smaller context, not the lower rate.
- Haiku 4.5: all 122 calls came from subagents or background work, none from the main thread.
See your own model mix
/usage shows token use for the session in front of you. Caprock keeps every session on the machine and prices each turn per model from its own pricing table:
- Cost screen, Model mix: each model with its turns, tokens, cost and share of the total, for the range you pick.
- Lifetime screen, Model mix: cost by model over everything Caprock has seen (or today, 7d, 30d), as a donut or a table of tokens, cost and share.
- caprock report: prints the top five models by cost;
--jsonadds each one's turns. - caprock export: one row per turn (and per tool call), with a
modelcolumn, which is how the figures above were read.
On the Cost screen, a model missing from the pricing table shows "unpriced" rather than $0.00.
$ caprock export --agent claude --since 90d --out events.tsv
Caprock records every session on your machine whether or not it started it, and every dollar it shows is a list-price estimate, as Claude Code's own /usage is, beside the plan's dollars and the share of the weekly limit the work used. Free, open source; nothing leaves your machine. Install Caprock.
Questions people ask
- Which models can Claude Code use?
- Claude Code supports Claude models only: Opus, Sonnet, Haiku and Fable, by alias or full model ID. On the Anthropic API, opus is Opus 5.5, sonnet is Sonnet 5.5, haiku is Haiku 5.5 and fable is Fable 5.1.
- How do I change the model in Claude Code?
- Run /model with an alias such as /model sonnet inside a session, start with claude --model opus, or set "model" in ~/.claude/settings.json. /model saves your choice as the default for new sessions.
- Can Claude Code use local or other models?
- Anthropic doesn't support routing Claude Code to non-Claude models through any gateway. It supports Claude through the Anthropic API, Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and LLM gateways.
- Can I use Claude Code with Ollama?
- Ollama documents it: run ollama launch claude, or set ANTHROPIC_BASE_URL to a local Ollama server. Anthropic does not support routing Claude Code to non-Claude models, and Ollama's API leaves out prompt caching.
- What is the default model in Claude Code?
- Opus 5.5 on Pro, Max, Team, Enterprise and the Anthropic API, and on Bedrock and Google Cloud's Agent Platform. On Microsoft Foundry it is Sonnet 4.5. Fable is never the default.
- Is Opus or Sonnet better for Claude Code?
- Anthropic says Sonnet handles most coding tasks well and costs less; keep Opus for complex architecture and multi-step reasoning. Opus 5.5 lists at $4 and $20 per million input and output tokens, Sonnet 5.5 at $2 and $10.
Sources
- Claude Code docs — Model configuration, read 20 October 2026
- Claude Code docs — Settings and the model key, read 20 October 2026
- Claude Code docs — CLI reference (--model), read 20 October 2026
- Claude Code docs — Create custom subagents (choose a model), read 20 October 2026
- Claude Code docs — Prompt caching (switching models), read 20 October 2026
- Claude Code docs — Manage costs effectively, read 20 October 2026
- Claude Code docs — Other LLM gateways, read 20 October 2026
- Claude Code docs — Enterprise deployment overview, read 20 October 2026
- Claude Code docs — Amazon Bedrock, read 20 October 2026
- Claude Code docs — Google Cloud's Agent Platform, read 20 October 2026
- Claude Code docs — Microsoft Foundry, read 20 October 2026
- Anthropic — Models overview, read 20 October 2026
- Anthropic — Pricing, read 20 October 2026
- Caprock source — Cost screen, Model mix panel (ui/src/screens/Cost.tsx)
- Caprock source — Lifetime screen, Model mix panel (ui/src/screens/History.tsx)
- Caprock source — caprock report, top models (cmd/caprock/report.go)
- Caprock export schema — model column
- Caprock pricing table, one row per model
- Ollama docs — Claude Code integration, read 20 October 2026
- Ollama docs — Anthropic compatibility, read 20 October 2026
- Caprock source — model lookup and unpriced models (internal/cost/cost.go)
Try it
The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.
Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.
Or run it yourself:
Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app