modified
Show diff (143 lines)
--- a/model-config.md +++ b/model-config.md @@ -76,8 +76,10 @@ When you’re signed in with `/login` and continue on Fable at the terminal or in VS Code, Claude Code saves that choice for later sessions. With [Remote Control](</docs/en/remote-control>) connected in an interactive terminal session, you can also answer the mid-session prompt on your device, and that answer lasts for that session. Answering on your device requires Claude Code v2.1.323 or later. The mid-session prompt waits until you answer. It can instead close at the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default, in these sessions: - * **Remote Control connected, or a[split-pane teammate](</docs/en/agent-teams#choose-a-display-mode>)**: press the right arrow key at the terminal to cancel the deadline. - * **[Background session](</docs/en/agent-view>), or an [Agent SDK](</docs/en/agent-sdk/overview>) application such as VS Code**: answer before the deadline, even with Remote Control connected. + * A session with Remote Control connected + * A [split-pane teammate](</docs/en/agent-teams#choose-a-display-mode>) session + * A [background session](</docs/en/agent-view>) + * A session in an [Agent SDK](</docs/en/agent-sdk/overview>) application such as VS Code If the deadline passes, Claude Code ends the turn without sending the request and keeps your model. The prompt returns with your next message on Fable. If you send a message while the prompt is open, the turn can end the same way. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking. @@ -126,7 +128,7 @@ "model": "opus" } -When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies in new sessions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings. A managed `availableModels` allowlist stays in force unless the host supplies its own. [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. +To override a model set in project or managed settings, run `/model`. The project or managed setting reapplies in new sessions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings. A managed `availableModels` allowlist stays in force unless the host supplies its own. [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. #### Which model a resumed session uses @@ -173,7 +175,7 @@ When you pick a model with `/model` and your next session starts on something else, these are the usual causes: * **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone. - * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file. + * **Something with higher priority sets the model.** A `model` value in project or managed settings, the `ANTHROPIC_MODEL` variable in your shell, or an organization default set to override user choices applies again at every new-session launch. Your `/model` choice is still saved. * **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>). * **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default. @@ -244,14 +246,12 @@ #### When the allowlist limits Cowork -On Team plans, claude.ai applies a non-empty `availableModels` list from your [server-managed settings](</docs/en/server-managed-settings>) to Cowork. On Enterprise plans, it does the same until Anthropic turns this off for your organization. With the list applied: +On Team plans, claude.ai applies a non-empty `availableModels` list from your [server-managed settings](</docs/en/server-managed-settings>) to Cowork. On an Enterprise plan, you can’t use the list to limit members’ Cowork sessions or their conversations in the [new unified Claude experience](<https://support.claude.com/en/articles/17444462-set-up-and-manage-the-new-unified-claude-experience-for-your-enterprise-organization>). claude.ai stopped applying it to them on November 30, 2026. Claude Code outside Cowork still follows the list. To keep a model out of Cowork and those conversations on an Enterprise plan, disable it in [**Organization settings > Models**](<https://claude.ai/admin-settings/models>), which sets organization model restrictions. The Models page has no switch for Haiku models or for a model that isn’t generally available. You can’t disable a model there for one product alone, so members lose it in Claude Code and chat as well as Cowork. On a Team plan, members meet the list in Cowork’s picker and in sessions that run remotely: * **Model picker** : Cowork’s picker normally hides or greys out the models outside the list, wherever the session runs * **Remote Cowork sessions** : the server also checks the model a user picks, and rejects one outside the list - * **Unified conversations** : a conversation in the [new unified Claude experience](<https://support.claude.com/en/articles/17444462-set-up-and-manage-the-new-unified-claude-experience-for-your-enterprise-organization>) isn’t checked until it runs in a remote Cowork session, for example to run code or work with files. One that moves there on a model outside the list normally switches to a listed model with no notice. There, a pick outside the list fails, normally with a message starting `Your organization's settings don't allow this model here`. + * **Unified conversations** : a conversation in the new unified Claude experience isn’t checked until it runs in a remote Cowork session, for example to run code or work with files. One that moves there on a model outside the list normally switches to a listed model with no notice. There, a pick outside the list fails, normally with a message starting `Your organization's settings don't allow this model here`. * **Sessions on the user’s machine** : the list isn’t enforced beyond the picker. [Where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>) covers which device policy reaches those sessions. - -After Anthropic turns this off, claude.ai doesn’t apply the list to members’ Cowork sessions or unified conversations. Claude Code outside Cowork still follows it. Models outside the list can then appear in Cowork’s picker, and a member whose default model in Cowork is outside the list can start on it without picking it. A scheduled Cowork task saved on such a model can run on it. On an Enterprise plan, don’t count on the list to keep a model out of Cowork or unified conversations. No setting shows whether Anthropic has turned this off. For any model but Haiku, disable it in [**Organization settings > Models**](<https://claude.ai/admin-settings/models>), which sets organization model restrictions. You can’t disable a model there for one product alone, so members lose it in Claude Code and chat as well as Cowork. ### Default model behavior @@ -645,7 +645,7 @@ #### Haiku 5.5 context window and pricing -On the Anthropic API, Haiku 5.5 runs with the 1M context window on every plan, with no `[1m]` suffix to select. Its model ID is `claude-haiku-5-5`. To use it, run `/model claude-haiku-5-5` in a session, or start Claude Code from your shell with `claude --model claude-haiku-5-5`. A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](<https://platform.claude.com/docs/en/about-claude/pricing>) for both rates. Sessions auto-compact at about 967K tokens by default. To compact earlier, set a smaller auto-compact window for the model. +On the Anthropic API, Haiku 5.5 runs with the 1M context window on every plan, with no `[1m]` suffix to select. Its model ID is `claude-haiku-5-5`. To use it, run `/model claude-haiku-5-5` in a session, or start Claude Code from your shell with `claude --model claude-haiku-5-5`. A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](<https://platform.claude.com/docs/en/about-claude/pricing>) for both rates. By default, a Haiku 5.5 session compacts near 400K tokens, or later in some cases. To compact earlier, set a smaller auto-compact window for the model. ## Context window and auto-compaction @@ -687,13 +687,53 @@ If you don’t set an auto-compact window, Claude Code compacts when the conversation reaches the model’s context limit, except in these sessions: - * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. These include the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway + * Current models with a native 1M window compact near 400K tokens by default or later in some cases. These models include the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID + * [Cloud sessions](</docs/en/claude-code-on-the-web#manage-context>) can compact before these thresholds See the [`idleCompaction`](</docs/en/settings-reference#idlecompaction>) setting for when Claude Code also compacts a conversation you leave idle. + +#### Compaction near 400K on a 1M model + +By default, your session uses `auto`, an auto-compact window that Anthropic tunes per model for the best cost and performance. On current models with a native 1M context window, `auto` is 400K, so your session compacts near 400K tokens, or later in some cases. Your later requests are smaller when compaction runs sooner, so long sessions use fewer tokens. A notice like this one means your session is on `auto` at 400K: + + This session is on auto, which now autocompacts near 400k tokens instead of 1m to lower the cost of long sessions. To opt out, run /autocompact 1m. + +On `auto` at 400K, compaction runs at about 367K tokens. The [status line’s](</docs/en/statusline#context-window-fields>) `used_percentage` then reads about 37%, because it counts against the full 1M. `auto` is the recommended setting, so you can keep working as you are. To use the full 1M, set the window yourself: + + * **Use the full 1M on the current model** : run `/autocompact 1M` in your session. On your own machine, the size is saved for later sessions on that model version, and compaction runs at about 967K tokens. + * **Keep 1M for your organization** : in [managed settings](</docs/en/managed-settings>), add a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry for each 1M model version, such as `"claude-opus-5-5": { "autoCompactWindow": 1000000 }`. The managed entry replaces the size a developer saved for that model. A developer can still override it with `--autocompact` or `CLAUDE_CODE_AUTO_COMPACT_WINDOW`. If a computer that runs the Desktop app has no managed settings yet, also set [`parentSettingsBehavior`](</docs/en/settings-reference#parentsettingsbehavior>) to `"merge"` so [Desktop’s own policy](</docs/en/managed-settings#let-an-embedding-host-add-policy>) still applies. If Desktop users on Windows work in WSL, also [allow WSL sessions](</docs/en/admin-setup#wsl-sessions-in-claude-code-desktop>), which Desktop turns off on managed devices. + * **Use the full 1M in cloud sessions** : run `/autocompact 1M` for the current [cloud session](</docs/en/claude-code-on-the-web#manage-context>). For later sessions on one repository, commit the same `modelSettings` entry to its `.claude/settings.json`. Or add `CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000` to your cloud environment’s [variables](</docs/en/cloud-environments#set-environment-variables>), which applies to every model. A [project’s threads](</docs/en/claude-projects#choose-models-and-let-claude-manage-context>) keep their own window. + * **Set a size for every model or in scripts** : see Set the auto-compact window. + +A conversation you leave idle can still compact below the size you set. To prevent that, turn off [idle compaction](</docs/en/settings-reference#idlecompaction>). To check your session’s auto-compact window, run `/autocompact` with no value. In a resumed conversation, wait for a reply from Claude first. Check again after you switch to a newer model, because Anthropic continues to evaluate `auto` for future models and can set a different window. + +#### Answer the one-time 400K prompt + +If you see a prompt titled **Autocompact now defaults to 400k tokens** , choose which of your native 1M models use `auto` at 400K: + +If you choose| What happens to those models +---|--- +**Apply (all models)**| They move to `auto`, and you lose the sizes you saved for them +**Apply** for the current model only| That model moves to `auto`. The others keep their saved size, or get 1M saved if they were on `auto`. +**Keep**| Your saved sizes stay, and models in your `/model` picker that were on `auto` get 1M saved. When you switch to a model version released later, you have no saved size for it. + +If you close the prompt, no setting changes, so models on `auto` compact near 400K. In a cloud session, your answer lasts for that session. To change your answer later, run `/autocompact 1M` or `/autocompact auto` for the model you’re using. + +#### Sessions that run past 400K by default + +In cases such as these, your session’s auto-compact window on a current native 1M model is larger than 400K, so the session can run past 400K tokens before it compacts: + +Case| Auto-compact window your session uses +---|--- +You send more than about 180K tokens of system prompt, tools, and instruction files with each request| Raised for that conversation +You start the session by resuming a conversation that’s already past 400K tokens, such as with `claude --resume`| 1M until the conversation compacts +You run a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), a [cloud scheduled task](</docs/en/routines>), or a session in a [self-hosted environment](</docs/en/self-hosted-environments>)| 1M +You run a Claude Code version before v2.1.334. For a local Desktop session, check the [Code tab’s Claude Code version](</docs/en/desktop#claude-code-version-in-the-code-tab>), which can differ from your terminal’s.| 1M + +To compact sooner, update Claude Code if you run an older version, or set a smaller window. If you see the notice `Raised this conversation's auto-compact window`, use fewer tools or shorter instruction files instead, because a smaller window can refill right after each compaction. In a terminal session, run `/autocompact` to see the raised size. ### Correct the window for a gateway or custom model ID @@ -759,20 +799,20 @@ ### Pin models for third-party deployments -When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable: +Pin model versions before rolling out Claude Code on [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), or [Claude Models on Google Cloud (Anthropic managed)](</docs/en/claude-models-on-google-cloud-anthropic-managed>). Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable: * **Amazon Bedrock and Google Cloud’s Agent Platform** : after a [startup check](</docs/en/amazon-bedrock#startup-model-checks>), users see a notice and the session falls back to an earlier version of the default model. When the default is an Opus model and no Opus version is available, the session falls back to the default Sonnet model. * **Microsoft Foundry** : Claude Code switches to an older model or the request fails. On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. -Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.On [Google Cloud’s Agent Platform](<https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude/sonnet-4-5>) and [Microsoft Foundry](<https://platform.claude.com/docs/en/about-claude/model-deprecations>), move off Sonnet 4.5 before it retires there on November 30, 2026: - - * **On Claude Code before v2.1.332** : the `sonnet` alias resolves to Sonnet 4.5, and so does the default model on Microsoft Foundry. Set `ANTHROPIC_DEFAULT_SONNET_MODEL` to a newer model such as `claude-sonnet-5`, or on Microsoft Foundry to your deployment’s name. Set `ANTHROPIC_DEFAULT_OPUS_MODEL` too, or the default model on Agent Platform can become the Sonnet model you set. +Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.If you use [Google Cloud’s Agent Platform](<https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude/sonnet-4-5>), [Microsoft Foundry, Claude Platform on AWS, or Claude Models on Google Cloud (Anthropic managed)](<https://platform.claude.com/docs/en/about-claude/model-deprecations>), move off Sonnet 4.5. The model’s retirement date on these platforms is November 30, 2026, so update your configuration: + + * **On any Claude Code version** : replace Sonnet 4.5 wherever your configuration names it, such as in the `ANTHROPIC_DEFAULT_SONNET_MODEL` or `ANTHROPIC_MODEL` environment variable, the `--model` flag, or the `availableModels` allowlist. + * **Before Claude Code v2.1.332, on Agent Platform or Microsoft Foundry** : the `sonnet` alias resolves to Sonnet 4.5, and so does the default model on Microsoft Foundry. Set the `ANTHROPIC_DEFAULT_SONNET_MODEL` environment variable to a newer model such as `claude-sonnet-5`, or on Microsoft Foundry to the newer model’s deployment name. Set the `ANTHROPIC_DEFAULT_OPUS_MODEL` environment variable too, or the default model on Agent Platform can become the Sonnet model you set. * If an enforced `availableModels` list has `sonnet` and no Opus, put the newer model’s ID there in its place. - * **On any version** : replace Sonnet 4.5 wherever your configuration names it, such as `ANTHROPIC_MODEL`, `--model`, or `availableModels`. - -After that date, requests to Sonnet 4.5 on those platforms stop working, including background tasks. + +After Sonnet 4.5 retires on your platform, requests to it stop working, including background tasks. Use the following environment variables with version-specific model IDs for your provider:
modified
--- a/model-config.md +++ b/model-config.md @@ -230,16 +230,28 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- -[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, but not delivered to [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions or to sessions on a self-hosted runner that [uses Amazon Bedrock or Google Cloud’s Agent Platform](</docs/en/self-hosted-environments-configuration#what-differs-from-sessions-on-the-anthropic-api>)| Enforced| Remote Cowork sessions: the server checks the model. On the user’s machine: not delivered. +[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, but not delivered to [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions or to sessions on a self-hosted runner that [uses Amazon Bedrock or Google Cloud’s Agent Platform](</docs/en/self-hosted-environments-configuration#what-differs-from-sessions-on-the-anthropic-api>)| Enforced| Not delivered. See When the allowlist limits Cowork. [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. - * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. When the `availableModels` list in your server-managed settings is non-empty and a user picks a model outside it, the server rejects that model for a remote Cowork session. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. + * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. claude.ai can apply the `availableModels` list in those settings to Cowork. + * A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * For sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), deliver the allowlist through MDM or managed settings files. * Delivery from the admin console requires the session to fetch with an [eligible login](</docs/en/server-managed-settings#platform-availability>) to your organization or an OAuth token issued for it. For fleets that authenticate with API keys, whether configured directly or generated by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script, deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). - * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. + * Claude Code’s model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. + +#### When the allowlist limits Cowork + +On Team plans, claude.ai applies a non-empty `availableModels` list from your [server-managed settings](</docs/en/server-managed-settings>) to Cowork. On Enterprise plans, it does the same until Anthropic turns this off for your organization. With the list applied: + + * **Model picker** : Cowork’s picker normally hides or greys out the models outside the list, wherever the session runs + * **Remote Cowork sessions** : the server also checks the model a user picks, and rejects one outside the list + * **Unified conversations** : a conversation in the [new unified Claude experience](<https://support.claude.com/en/articles/17444462-set-up-and-manage-the-new-unified-claude-experience-for-your-enterprise-organization>) isn’t checked until it runs in a remote Cowork session, for example to run code or work with files. One that moves there on a model outside the list normally switches to a listed model with no notice. There, a pick outside the list fails, normally with a message starting `Your organization's settings don't allow this model here`. + * **Sessions on the user’s machine** : the list isn’t enforced beyond the picker. [Where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>) covers which device policy reaches those sessions. + +After Anthropic turns this off, claude.ai doesn’t apply the list to members’ Cowork sessions or unified conversations. Claude Code outside Cowork still follows it. Models outside the list can then appear in Cowork’s picker, and a member whose default model in Cowork is outside the list can start on it without picking it. A scheduled Cowork task saved on such a model can run on it. On an Enterprise plan, don’t count on the list to keep a model out of Cowork or unified conversations. No setting shows whether Anthropic has turned this off. For any model but Haiku, disable it in [**Organization settings > Models**](<https://claude.ai/admin-settings/models>), which sets organization model restrictions. You can’t disable a model there for one product alone, so members lose it in Claude Code and chat as well as Cowork. ### Default model behavior
modified
Show diff (138 lines)
--- a/model-config.md +++ b/model-config.md @@ -36,8 +36,9 @@ Anthropic API| Opus 5.5| Sonnet 5.5| Haiku 5.5 [Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6| Haiku 4.5 [Claude Models on Google Cloud (Anthropic managed)](</docs/en/claude-models-on-google-cloud-anthropic-managed>)| Opus 5.5| Sonnet 5.5| Haiku 4.5 -Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5| Haiku 4.5 -Microsoft Foundry| Opus 4.6| Sonnet 4.5| Haiku 4.5 +Amazon Bedrock| Opus 5.5| Sonnet 4.5| Haiku 4.5 +[Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) alone| Opus 5.5| Sonnet 5| Haiku 4.5 +Google Cloud’s Agent Platform, Microsoft Foundry| Opus 5.5| Sonnet 5.5| Haiku 4.5 Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5 in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions and to Fable 5.2 everywhere else. A gateway that isn’t configured to serve `claude-fable-5-2` rejects requests for that model. To use Fable 5.2 through a gateway that serves it, select it with `/model claude-fable-5-2`. Where `opus` or `sonnet` resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. @@ -71,16 +72,14 @@ Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: * When you select a Fable model with `/model`, you keep your current model. - * Mid-session, Claude Code continues the turn on your default model. - -After you choose to continue on Fable using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: - - * With Remote Control connected or in a teammate’s session, press any key at the terminal to cancel the deadline, and Claude Code waits for your answer. - * With Remote Control connected in an interactive terminal session, you can also answer on your connected device, and that answer lasts for that session. Requires Claude Code v2.1.323 or later. - * In a background session, answer before the deadline. - * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it. - -In a session another application hosts through the [Agent SDK](</docs/en/agent-sdk/overview>), whether the prompt appears is up to that application. If it appears and nobody answers before the same [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, Claude Code ends the turn without sending the request. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking. + * Mid-session, Claude Code either [ends the turn](</docs/en/errors#the-prompt-to-confirm-went-unanswered>) or continues it on your default model. + +When you’re signed in with `/login` and continue on Fable at the terminal or in VS Code, Claude Code saves that choice for later sessions. With [Remote Control](</docs/en/remote-control>) connected in an interactive terminal session, you can also answer the mid-session prompt on your device, and that answer lasts for that session. Answering on your device requires Claude Code v2.1.323 or later. The mid-session prompt waits until you answer. It can instead close at the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default, in these sessions: + + * **Remote Control connected, or a[split-pane teammate](</docs/en/agent-teams#choose-a-display-mode>)**: press the right arrow key at the terminal to cancel the deadline. + * **[Background session](</docs/en/agent-view>), or an [Agent SDK](</docs/en/agent-sdk/overview>) application such as VS Code**: answer before the deadline, even with Remote Control connected. + +If the deadline passes, Claude Code ends the turn without sending the request and keeps your model. The prompt returns with your next message on Fable. If you send a message while the prompt is open, the turn can end the same way. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking. ### Setting your model @@ -103,7 +102,7 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default. `/model` in that mode requires Claude Code v2.1.205 or later. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only. `/model` in that mode requires Claude Code v2.1.205 or later. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. @@ -186,7 +185,7 @@ * A version prefix such as `claude-sonnet-4-5`. It also matches later model IDs that extend it with another segment. For example, `claude-fable-5` permits Fable 5, Fable 5.1, and Fable 5.2, while `claude-fable-5-1` permits Fable 5.1 only * A full model ID such as `claude-sonnet-4-5-20250929` -To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +A prefix-matched list that names `claude-sonnet-5` lets an unpinned `sonnet` run Sonnet 5.5, because that entry also matches the later version. This applies from v2.1.332 on Google Cloud’s Agent Platform and Microsoft Foundry. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -196,7 +195,7 @@ * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) -On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to its usual model when the allowlist permits that model. When the allowlist blocks that model, Claude Code substitutes the newest version of the family that the allowlist permits and shows a notice naming both the requested and substituted models. With `["sonnet", "claude-opus-4-6"]`, for example, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Claude Code handles any other blocked selection according to where the model was set: +On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to its usual model when the allowlist permits that model. When the allowlist blocks that model, Claude Code substitutes the newest version of the family that the allowlist permits and shows a notice naming both the requested and substituted models. With `["sonnet", "claude-opus-4-6"]`, for example, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. When a selection stays blocked, Claude Code handles it according to where the model was set: * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model @@ -210,9 +209,9 @@ Claude Code hides excluded models from the `/model` picker. Whether a model ID you list also gets a row of its own differs by provider: * **Anthropic API,[Claude Platform on AWS](</docs/en/claude-platform-on-aws>), [Claude apps gateway](</docs/en/claude-apps-gateway>), or an [LLM gateway](</docs/en/llm-gateway>) set through `ANTHROPIC_BASE_URL`**: an Anthropic model ID you list that has no built-in picker row appears as its own labeled row. Claude Code adds such a row for Opus, Sonnet, and Haiku versions, such as an older version that the list pins. If you set `replaceBuiltInOptions` in a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, that row doesn’t appear. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. - * **Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry** : unless a model ID you list starts with `anthropic.`, Claude Code doesn’t add a row for it, whether it’s an Anthropic model ID or a provider-specific one. Mantle model IDs carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, which accepts IDs in your provider’s format. - -Model changes that Claude Code makes on your behalf are checked the same way: + * **Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry** : unless a model ID you list starts with `anthropic.`, Claude Code doesn’t add a row for it. Mantle model IDs carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, which accepts IDs in your provider’s format. + +When Claude Code changes models on your behalf, it avoids excluded models in most of these cases: * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model @@ -358,7 +357,7 @@ * **Pro, Max, Ultra, Team, Enterprise, and Anthropic API** : defaults to Opus 5.5 * **Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 - * **Microsoft Foundry** : defaults to Sonnet 4.5 + * **Microsoft Foundry** : defaults to Sonnet 5.5 Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. @@ -446,13 +445,13 @@ * Claude Code must recognize the current model as a fallback source. Fable models are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5, Sonnet 5.5, and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping. * An Opus target must resolve in your deployment, whichever model refused: set `ANTHROPIC_DEFAULT_OPUS_MODEL`, or keep an Opus 4.8 entry in the provider’s model list. Without one, fallback stays off for every source model, including Sonnet 5.5, and flagged requests end with a refusal. - * The flagged category’s fallback model must resolve in your deployment. From a Fable model, Opus 5.5, or Opus 5, if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on the Opus 4.8 entry, and biology-flagged requests from a Fable model or Opus 5.5 on an Opus 5 entry. From Sonnet 5.5, cybersecurity-flagged requests re-run on the model you set in `ANTHROPIC_DEFAULT_SONNET_MODEL`, or on a Sonnet 5 entry in the provider’s model list if you don’t set it. + * The flagged category’s fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, that model is the fallback for Fable models, Opus 5.5, and Opus 5 in each category that has a fallback model. If either model can’t be identified, Claude Code doesn’t switch. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. To make both models identifiable, set the pins for your source model: - * **Fable models** : set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID so Claude Code recognizes it as a fallback source. - * **Every source model** : set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID to turn fallback on and give the flagged categories a target. A pin that names a model outside the Opus family, or the model that refused, leaves the refusal standing. - * **Sonnet 5.5** : in addition to the Opus pin, set `ANTHROPIC_DEFAULT_SONNET_MODEL` or keep a Sonnet 5 entry in the provider’s model list to supply the model the request re-runs on. A Sonnet pin that names a model outside the Sonnet family, or Sonnet 5.5 itself, leaves the refusal standing. + * **Fable models** : set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID, and set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID. + * **Opus 5.5 or Opus 5** : start your session with the full model ID, and set `ANTHROPIC_DEFAULT_OPUS_MODEL` to another Opus model ID. If Claude Code recognizes that ID as a non-Opus model or the model that refused, the request ends with the refusal. + * **Sonnet 5.5** : start your session with the full model ID, and set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID. Set `ANTHROPIC_DEFAULT_SONNET_MODEL` to the Sonnet model ID you want cybersecurity-flagged requests to re-run on. If Claude Code recognizes that ID as a non-Sonnet model or Sonnet 5.5, the request ends with the refusal. The fallback model must also have a context window at least as large as the session’s, or Claude Code doesn’t switch and the flagged request ends with the same refusal. On these providers the source models run with the 1M context window by default. Pin a model that also does, such as Opus 4.8 in `ANTHROPIC_DEFAULT_OPUS_MODEL` or Sonnet 5 in `ANTHROPIC_DEFAULT_SONNET_MODEL`, by an ID Claude Code can match to that model. @@ -755,7 +754,13 @@ On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. -Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. +Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.On [Google Cloud’s Agent Platform](<https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude/sonnet-4-5>) and [Microsoft Foundry](<https://platform.claude.com/docs/en/about-claude/model-deprecations>), move off Sonnet 4.5 before it retires there on November 30, 2026: + + * **On Claude Code before v2.1.332** : the `sonnet` alias resolves to Sonnet 4.5, and so does the default model on Microsoft Foundry. Set `ANTHROPIC_DEFAULT_SONNET_MODEL` to a newer model such as `claude-sonnet-5`, or on Microsoft Foundry to your deployment’s name. Set `ANTHROPIC_DEFAULT_OPUS_MODEL` too, or the default model on Agent Platform can become the Sonnet model you set. + * If an enforced `availableModels` list has `sonnet` and no Opus, put the newer model’s ID there in its place. + * **On any version** : replace Sonnet 4.5 wherever your configuration names it, such as `ANTHROPIC_MODEL`, `--model`, or `availableModels`. + +After that date, requests to Sonnet 4.5 on those platforms stop working, including background tasks. Use the following environment variables with version-specific model IDs for your provider: @@ -796,7 +801,7 @@ * **Recognized** : the exact ID of a model Claude Code knows, such as its Anthropic API ID or your provider’s or gateway’s form of it, with or without the `[1m]` suffix. Pin `us.anthropic.claude-sonnet-4-5-20250929-v1:0` and the row reads `Sonnet 4.5`. * **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that ID. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default. -When a row shows the model’s name, its default description includes the pinned ID so you can still see which ID is pinned. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. +When a row shows the model’s name, its default description includes the pinned ID. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. Environment variable| Description ---|--- @@ -856,6 +861,7 @@ Version| Change ---|--- +v2.1.332| `sonnet` resolves to Sonnet 5.5 on Google Cloud’s Agent Platform and Microsoft Foundry, and to Sonnet 5 on Mantle alone. `opus` and `default` on Foundry resolve to Opus 5.5 and Sonnet 5.5 v2.1.321| `fable` resolves to Fable 5.2, except in Claude apps gateway sessions v2.1.321| `best` resolves to the same model as `opus`. Earlier versions use the model `fable` resolves to, where Fable is available v2.1.293| `haiku` resolves to Haiku 5.5 on the Anthropic API
modified
--- a/model-config.md +++ b/model-config.md @@ -329,7 +329,7 @@ * a `model` value in [managed settings](</docs/en/managed-settings>) or supplied through `--settings` * a `model` value in your user, project, or local settings, including a model you save with `/model` -Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings. A model you save with `/model` then applies for the current session, and the organization default returns in new sessions. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: +Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings. A model you save with `/model` then applies for the current session, and the organization default returns in new sessions. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. In the terminal, a new session still starts on the model that the `--model` flag, `ANTHROPIC_MODEL`, managed settings, or `--settings` sets, even with override on. To limit which models members can select, use organization model restrictions or `availableModels`. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: * with the default prefix matching and `enforceAvailableModels` set, an organization default outside the `availableModels` allowlist is remapped to a model on that list * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted
modified
--- a/model-config.md +++ b/model-config.md @@ -174,7 +174,7 @@ When you pick a model with `/model` and your next session starts on something else, these are the usual causes: * **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone. - * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file. + * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file. * **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>). * **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default. @@ -526,7 +526,7 @@ If the word isn’t rainbow when you start a new turn, try one of these: * Retype it outside anything such as quotes, brackets, a path, or a command, in a prompt that doesn’t start with `/` - * Unset `CLAUDE_CODE_EFFORT_LEVEL` if it’s set below `xhigh`, raise your own [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) to `xhigh` or above, or ask an organization admin to raise your organization’s limit + * Unset `CLAUDE_CODE_EFFORT_LEVEL` if it’s set below `xhigh`, or raise your own [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) to `xhigh` or above. If you’re in an organization with an effort limit, ask an organization admin to raise it * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, Google Cloud’s Agent Platform, or a [Claude apps gateway](</docs/en/claude-apps-gateway>), set the effort level instead To turn the keyword off, including its in-context instruction, set `CLAUDE_CODE_DISABLE_ULTRATHINK` to `1` in your shell or in a [settings file](</docs/en/env-vars#in-settings-files>). Requires Claude Code v2.1.316 or later.
modified
--- a/model-config.md +++ b/model-config.md @@ -267,14 +267,14 @@ * **`model`** : sets the initial model selection when a session starts * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to, and which version the account-type default uses -This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and ensures Default resolves to a model on the allowlist rather than the tier default: +This example starts users on Sonnet 5, limits the picker to Sonnet 5.x and Haiku, and ensures Default resolves to a model on the allowlist: { - "model": "claude-sonnet-4-5", - "availableModels": ["claude-sonnet-4-5", "haiku"], + "model": "claude-sonnet-5", + "availableModels": ["claude-sonnet-5", "haiku"], "enforceAvailableModels": true, "env": { - "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5" + "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5" } } @@ -487,7 +487,7 @@ A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. -When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only and doesn’t save it as your default. The `/effort` slider also has an **Ultracode** toggle. Ultracode is a Claude Code setting rather than a model effort level: with it on, Claude orchestrates [dynamic workflows](</docs/en/workflows>) for substantive tasks, at whichever effort level the session runs at. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. Turning ultracode on or off with `/effort` or the `ultracode` setting leaves the effort level unchanged. The `--effort ultracode` flag and the Agent SDK `effortLevel: "ultracode"` value turn it on and also set the level to `xhigh`. Picking a level in the `/effort` slider or the `/model` picker leaves ultracode as it was. You can turn on ultracode through any of the following: +When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only. The `/effort` slider also has an **Ultracode** toggle. Ultracode is a Claude Code setting rather than a model effort level: with it on, Claude orchestrates [dynamic workflows](</docs/en/workflows>) for substantive tasks, at whichever effort level the session runs at. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. Turning ultracode on or off with `/effort` or the `ultracode` setting leaves the effort level unchanged. The `--effort ultracode` flag and the Agent SDK `effortLevel: "ultracode"` value turn it on and also set the level to `xhigh`. Picking a level in the `/effort` slider or the `/model` picker leaves ultracode as it was. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode` to turn it on for the current session or `/effort ultracode off` to turn it off. In the `/effort` slider, press `Tab` to flip the **Ultracode** toggle, then `Enter` to apply it * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on
modified
--- a/model-config.md +++ b/model-config.md @@ -237,8 +237,8 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. When the `availableModels` list in your server-managed settings is non-empty and a user picks a model outside it, the server rejects that model for a remote Cowork session. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. - * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. - * Delivery from the admin console also requires the session to fetch with an [eligible login](</docs/en/server-managed-settings#platform-availability>) to your organization or an OAuth token issued for it. For fleets that authenticate with API keys, whether configured directly or generated by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script, deliver the allowlist through MDM or managed settings files. + * For sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), deliver the allowlist through MDM or managed settings files. + * Delivery from the admin console requires the session to fetch with an [eligible login](</docs/en/server-managed-settings#platform-availability>) to your organization or an OAuth token issued for it. For fleets that authenticate with API keys, whether configured directly or generated by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script, deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. @@ -319,7 +319,7 @@ * Haiku models are always available and can’t be disabled, so every member keeps at least one usable model. * An access change takes effect on new requests within about a minute; the `/model` picker reflects it the next time a session starts. -Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions reach sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments only; on any other provider, use `availableModels` instead. +Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions reach sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments only; with a [gateway credential](</docs/en/llm-gateway#subscriptions-and-gateways>) or on any other provider, use `availableModels` instead. ## Organization default model @@ -345,6 +345,8 @@ * Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. If you start a plain-text `--print` run with `--effort` above the cap, a warning on stderr names the requested and applied levels. In interactive sessions, with `json` or `stream-json` output, or in background agents, that warning goes to the [debug log](</docs/en/errors#configuration-warnings>) instead. * Caps are per model, so switching models can change which levels are available. * When several of your roles grant the same model, the least restrictive cap applies. + * If you see `Your organization limits effort for <model>` and need the higher level, ask an organization admin to raise the limit, then restart Claude Code. + * If a request fails with `API Error: 400 Invalid effort level`, update to v2.1.314 or later and restart. If it still fails, remove any `output_config.effort` key from [`CLAUDE_CODE_EXTRA_BODY`](</docs/en/env-vars#variables>). Effort limits are delivered together with organization model restrictions and reach the same sessions. @@ -369,7 +371,7 @@ * **In plan mode** : uses `opus` for complex reasoning and architecture decisions * **In execution mode** : automatically switches to `sonnet` for code generation and implementation -This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting, and the execution phase uses the same window as `sonnet`. When `opus` and `sonnet` resolve to models that run with the 1M context window by default, as the current models do on the Anthropic API, both phases run with it. To request 1M context for both phases where they don’t, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. To request the 1M context window where `opus` and `sonnet` don’t have it by default, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### Fallback model chains @@ -545,7 +547,7 @@ #### Effort level of subagents and teammates -On the main conversation’s model, a [subagent](</docs/en/sub-agents#choose-an-effort-level>) or [teammate](</docs/en/agent-teams#specify-teammates-and-models>) with no `effort` of its own runs at the level you pick in the session or set with `--effort`. On another model, that level doesn’t apply. To pick a subagent’s level, set `effort` in its definition. +On the main conversation’s model, a [subagent](</docs/en/sub-agents#choose-an-effort-level>) or [teammate](</docs/en/agent-teams#specify-teammates-and-models>) with [no other level set](</docs/en/sub-agents#when-a-subagent-has-no-effort-field-or-parameter>) runs at the level you pick in the session or set with `--effort`. On another model, that level doesn’t apply. To pick a subagent’s level, set `effort` in its definition. #### Check the effort level you set @@ -772,7 +774,7 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]' -With the `[1m]` suffix, the 1M context window applies to all usage of the pinned alias, including the plan-mode Opus phase of `opusplan` and [subagents](</docs/en/sub-agents#choose-a-model>) whose `model` frontmatter names the alias. +With the `[1m]` suffix, the pinned alias runs with the 1M context window. * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). @@ -780,7 +782,7 @@ When you set an `ANTHROPIC_DEFAULT_*_MODEL` variable, the `/model` picker shows one row for that model in place of the family’s built-in rows, including any 1M context rows. To reach the 1M window without adding the suffix to that variable, your users run `/model opus[1m]`, and Claude Code applies the suffix to the model the variable names. `/model sonnet[1m]` works the same way. -An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, map it through `modelOverrides` or list its full provider-form ID: +`availableModels` filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, map it through `modelOverrides` or list its full provider-form ID: * **Google Cloud’s Agent Platform** : when the ID Claude Code requests carries an `@` date, such as `claude-sonnet-4-5@20250929`, include the date in your allowlist entry. On its own, `claude-sonnet-4-5` doesn’t match that ID under either [`availableModelsMatch`](</docs/en/settings-reference#availablemodelsmatch>) setting. * **Pinned models** : list the value you set in the model’s `ANTHROPIC_DEFAULT_*_MODEL` variable
modified
--- a/model-config.md +++ b/model-config.md @@ -650,7 +650,7 @@ * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to a token count such as `200000`. Unless Claude Code ignores the value, the variable takes precedence over the command, the flag, and the `autoCompactWindow` setting. `/autocompact` then reports the override without saving. The status line’s `used_percentage` measures against the model’s full context window, so while the variable is set, that percentage doesn’t indicate when compaction will run. * **For one subagent** : see [Set the auto-compact window for one subagent](</docs/en/sub-agents#subagent-auto-compact-window>). -The command and the flag accept a window size from 100K to 1M tokens, in any of these forms: +The command and the flag accept a window size of 100K tokens or more, in any of these forms: * A plain token count, such as `200000` * A `k` or `M` suffix, such as `500k` or `1M` @@ -660,7 +660,7 @@ #### Values and warnings for `CLAUDE_CODE_AUTO_COMPACT_WINDOW` -A warning that quotes your `CLAUDE_CODE_AUTO_COMPACT_WINDOW` value means the value falls outside 100,000 to 1,000,000 or isn’t a token count. To stop the warning, set a number in that range, such as `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`. On Claude Code v2.1.304 or later, you can also write the number with `k` for thousands or `M` for millions, as in `200k` or `1M`. Find your warning’s wording in the first column, then read across for the window your session uses and what to change: +A warning that quotes your `CLAUDE_CODE_AUTO_COMPACT_WINDOW` value means your session isn’t using the value as you set it. To stop the warning, set a number such as `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`. On Claude Code v2.1.304 or later, you can also write the number with `k` for thousands or `M` for millions, as in `200k` or `1M`. Find your warning’s wording in the first column, then read across for the window your session uses and what to change: Your warning contains| Window the session uses| What to change ---|---|---
modified
--- a/model-config.md +++ b/model-config.md @@ -103,7 +103,7 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. If your `model` setting is `haiku`, a session saved on a Haiku model resumes on the model that `haiku` resolves to now. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default. `/model` in that mode requires Claude Code v2.1.205 or later. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. @@ -127,6 +127,20 @@ "model": "opus" } +When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies in new sessions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings. A managed `availableModels` allowlist stays in force unless the host supplies its own. [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. + +#### Which model a resumed session uses + +A session you resume with `claude --resume` or `--continue` keeps the model it was saved on, except in cases such as these, where it follows the priority order instead: + + * You set an alias variable such as `ANTHROPIC_DEFAULT_OPUS_MODEL`, or `ANTHROPIC_DEFAULT_MODEL` under the conditions listed in its section + * The saved model has been retired or is excluded by `availableModels` + * Your provider uses provider-specific deployment IDs rather than Anthropic model IDs, as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry do + * Your `model` setting is `haiku` and the session was saved on a Haiku or Sonnet model. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. + * Your `model` setting is `opusplan` and the session was saved on an Opus or Sonnet model + +To resume on a model you choose, pass `--model` or set `ANTHROPIC_MODEL`. + #### Fix a mistyped model name Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize: @@ -160,7 +174,7 @@ When you pick a model with `/model` and your next session starts on something else, these are the usual causes: * **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone. - * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file. + * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file. * **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>). * **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default. @@ -315,9 +329,9 @@ * a `model` value in [managed settings](</docs/en/managed-settings>) or supplied through `--settings` * a `model` value in your user, project, or local settings, including a model you save with `/model` -Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: - - * With the default prefix matching, `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry as well +Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings. A model you save with `/model` then applies for the current session, and the organization default returns in new sessions. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: + + * with the default prefix matching and `enforceAvailableModels` set, an organization default outside the `availableModels` allowlist is remapped to a model on that list * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted * for an organization default that `deniedModels` or an `"exact"` list blocks, see Block specific models or versions * an organization default that isn’t available to your account at all is skipped, and the Default option resolves as it would without an organization default @@ -752,7 +766,7 @@ Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. By default, Claude Code treats a pinned ID as having the 1M context window, with no `[1m]` suffix needed, in these cases: * **An ID Claude Code matches to a model with a native 1M window, such as Opus 4.8 or Sonnet 5** : the ID matches when it contains the model’s Anthropic API ID, as `us.anthropic.claude-opus-4-8` contains `claude-opus-4-8`, or when a `modelOverrides` entry maps the model to it - * **An ID Claude Code can’t match to a model** : set the real window if the model behind the ID accepts less + * **An ID Claude Code can’t match to a model** : set the real window if the model behind the ID accepts less. Before v2.1.323, Claude Code assumed 200K by default, so on those versions append `[1m]` to the ID if the model accepts 1M. For a model that reaches 1M through its `[1m]` variant, such as Opus 4.6 or Sonnet 4.6, enable extended context by appending `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`:
modified
--- a/model-config.md +++ b/model-config.md @@ -732,7 +732,12 @@ ### Pin models for third-party deployments -When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. +When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable: + + * **Amazon Bedrock and Google Cloud’s Agent Platform** : after a [startup check](</docs/en/amazon-bedrock#startup-model-checks>), users see a notice and the session falls back to an earlier version of the default model. When the default is an Opus model and no Opus version is available, the session falls back to the default Sonnet model. + * **Microsoft Foundry** : Claude Code switches to an older model or the request fails. + +On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.
modified
Show diff (147 lines)
--- a/model-config.md +++ b/model-config.md @@ -35,6 +35,7 @@ ---|---|---|--- Anthropic API| Opus 5.5| Sonnet 5.5| Haiku 5.5 [Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6| Haiku 4.5 +[Claude Models on Google Cloud (Anthropic managed)](</docs/en/claude-models-on-google-cloud-anthropic-managed>)| Opus 5.5| Sonnet 5.5| Haiku 4.5 Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5| Haiku 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5| Haiku 4.5 @@ -75,6 +76,7 @@ After you choose to continue on Fable using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: * With Remote Control connected or in a teammate’s session, press any key at the terminal to cancel the deadline, and Claude Code waits for your answer. + * With Remote Control connected in an interactive terminal session, you can also answer on your connected device, and that answer lasts for that session. Requires Claude Code v2.1.323 or later. * In a background session, answer before the deadline. * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it. @@ -113,6 +115,8 @@ Then switch models from within the session: /model sonnet + +By default, a session you start on the Anthropic API with a Claude Opus 4 or Opus 4.1 ID such as `claude-opus-4-1` runs on the model `opus` resolves to. Example settings file: @@ -183,7 +187,7 @@ * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model * **`ANTHROPIC_DEFAULT_MODEL`** : Claude Code ignores the variable - * **Subagent or teammate override** : Claude Code runs the subagent or teammate on a fallback model rather than failing the request. See [Choose a model](</docs/en/sub-agents#choose-a-model>) for the subagent fallback and [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>) for the teammate fallback. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead. Before v2.1.222, an alias fell back like any other blocked value on every provider + * **Subagent or teammate override** : Claude Code runs the subagent or teammate on a fallback model rather than failing the request. See [When an allowlist blocks a subagent model](</docs/en/sub-agents#when-an-allowlist-blocks-a-subagent-model>) for the subagent fallback and [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>) for the teammate fallback. In interactive sessions, Claude Code warns you when it substitutes a top-level subagent’s model. It doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead. Before v2.1.222, an alias fell back like any other blocked value on every provider * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting @@ -213,7 +217,7 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- -[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Enforced| Remote Cowork sessions: the server checks the model. On the user’s machine: not delivered. +[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, but not delivered to [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions or to sessions on a self-hosted runner that [uses Amazon Bedrock or Google Cloud’s Agent Platform](</docs/en/self-hosted-environments-configuration#what-differs-from-sessions-on-the-anthropic-api>)| Enforced| Remote Cowork sessions: the server checks the model. On the user’s machine: not delivered. [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. @@ -337,7 +341,7 @@ The behavior of `default` depends on your account type: * **Pro, Max, Ultra, Team, Enterprise, and Anthropic API** : defaults to Opus 5.5 - * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 + * **Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 * **Microsoft Foundry** : defaults to Sonnet 4.5 Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. @@ -362,13 +366,18 @@ To persist a chain across sessions, set `fallbackModel` in [settings](</docs/en/settings>) as an array: { - "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"] + "fallbackModel": ["claude-sonnet-5", "claude-haiku-5-5"] } -The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each entry accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. When a request fails over, Claude Code tries each entry in order until one accepts it. An entry that can’t be reached either, such as a retired model pinned in settings, fails over to the next one the same way. Claude Code removes two kinds of entry before that walk starts: +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each entry accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. + +#### Which entries Claude Code tries + +When a request fails over, Claude Code tries each entry in order until one accepts it. An entry that can’t be reached either, such as a retired model pinned in settings, fails over to the next one the same way. Claude Code leaves an entry out in these cases: * **Outside the allowlist** : Claude Code drops any entry not permitted by `availableModels` when it reads the chain. * **Smaller context window during compaction** : the chain also covers [compaction](</docs/en/context-window#what-survives-compaction>), but Claude Code won’t fall back to a model with a smaller context window than the primary’s, since summarizing there would cut off part of the conversation first. If every fallback is smaller, compaction shows the original error and you can retry. + * **Not supported in auto mode** : in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), and in plan mode while the classifier reviews commands, Claude Code skips models that auto mode doesn’t support. Include a supported model if you use either mode. Claude Code also applies the chain to [subagents](</docs/en/sub-agents>). When a subagent’s request fails over, Claude Code tries your configured fallback models in order, and the subagent continues on the model that accepts the request. Your session’s model is unchanged. Before v2.1.247, a failure the chain covers ended the subagent instead. @@ -492,11 +501,19 @@ #### Use ultrathink for one-off deep reasoning -Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. Claude Code passes other phrases such as “think”, “think hard”, and “think more” through as ordinary prompt text and doesn’t recognize them as keywords. Typed in the terminal prompt, the word can also raise that turn to `xhigh` effort. When it can, the word shows in rainbow colors. Requires Claude Code v2.1.311 or later. If the word isn’t rainbow when you start a new turn, try one of these: +Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. Claude Code passes other phrases such as “think”, “think hard”, and “think more” through as ordinary prompt text and doesn’t recognize them as keywords. To raise that turn to `xhigh` effort as well, type the word in one of these places: + + * The terminal prompt, where the word shows in rainbow colors when it can raise the turn. Requires Claude Code v2.1.311 or later. + * VS Code’s chat box, where the word also shows in rainbow colors. Requires Claude Code v2.1.316 or later. + * A local session in the desktop app’s Code tab. Requires Claude Code v2.1.316 or later. + +If the word isn’t rainbow when you start a new turn, try one of these: * Retype it outside anything such as quotes, brackets, a path, or a command, in a prompt that doesn’t start with `/` * Unset `CLAUDE_CODE_EFFORT_LEVEL` if it’s set below `xhigh`, raise your own [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) to `xhigh` or above, or ask an organization admin to raise your organization’s limit - * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, set the effort level instead + * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, Google Cloud’s Agent Platform, or a [Claude apps gateway](</docs/en/claude-apps-gateway>), set the effort level instead + +To turn the keyword off, including its in-context instruction, set `CLAUDE_CODE_DISABLE_ULTRATHINK` to `1` in your shell or in a [settings file](</docs/en/env-vars#in-settings-files>). Requires Claude Code v2.1.316 or later. #### Set the effort level @@ -653,12 +670,12 @@ ### Correct the window for a gateway or custom model ID -Either of these warnings means Claude Code doesn’t recognize your session’s model ID, so it can’t tell the model’s context window and assumes 200K tokens: - - ⚠ Model "my-gateway-opus" isn't recognized · context assumed to be 200k tokens · ... - Claude Code doesn't recognize the model "my-gateway-opus", so it assumes a context window of 200k tokens. Update Claude Code, or see https://code.claude.com/docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id to set the window. - -Claude Code auto-compacts the conversation at the assumed 200K, so if the model’s real context window is 200K, there is nothing to correct. Otherwise, give Claude Code the real window in whichever of these ways fits your ID: +Either of these warnings means Claude Code doesn’t recognize your session’s model ID and assumes the context window the warning names: + + ⚠ Model "my-gateway-opus" isn't recognized · context assumed to be 1m tokens · ... + Claude Code doesn't recognize the model "my-gateway-opus", so it assumes a context window of 1m tokens. Update Claude Code, or see https://code.claude.com/docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id to set the window. + +Claude Code auto-compacts the conversation to fit the assumed window, so if the warning names the model’s real context window, there is nothing to correct. Otherwise, give Claude Code the real window: * **A model newer than your Claude Code version** : run `claude update` in your shell. If Claude Code recognizes the ID after the update, you don’t need to configure anything else. * **Your gateway’s or provider’s name for a model Claude Code knows** : add a `modelOverrides` entry that maps the Anthropic model ID to your ID, such as `"claude-opus-4-8": "my-gateway-opus"`. You can instead list your ID in a [`modelPicker`](</docs/en/settings-reference#fields-for-modelpicker>) row with `behavesAs` set to that model. Either way, Claude Code then treats the ID as that model. @@ -669,11 +686,11 @@ #### Which IDs `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies to -On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. Set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window Claude Code should assume instead. How the variable applies depends on the ID. Claude Code treats an ID as a provider or custom spelling when it doesn’t start with `claude-`, in any casing, or when it carries a suffix that Claude Code strips when reading the ID, such as the `@YYYYMMDD` date used on Google Cloud’s Agent Platform. Before v2.1.259, Claude Code didn’t count a stripped suffix, so an unrecognized `claude-` ID with a date suffix was treated as a bare `claude-` name. An unrecognized provider or custom spelling, the same spelling with `[1m]`, and every other ID are three separate cases: - - * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID doesn’t contain `[1m]`, the variable applies directly and proactive compaction continues at the declared window. - * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID contains `[1m]`, in any casing, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With that variable set, Claude Code sizes the ID like the same spelling without `[1m]`, so `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies when it would apply to that untagged spelling. With a declared window above 200K, the warning that [the 200K limit isn’t enforced](</docs/en/errors#the-200k-limit-isnt-enforced>) is expected in this configuration. - * If the ID resolves to a model Claude Code recognizes, or the ID is a bare `claude-` name with no suffix for Claude Code to strip, in any casing, the variable takes effect only when you also set [`DISABLE_COMPACT`](</docs/en/env-vars>), which disables all compaction. For example, an ID that contains a Claude model name that Claude Code knows, such as `anthropic/claude-opus-4-8`, `us.anthropic.claude-…-v1:0`, or the dated `claude-sonnet-4-5@20250929`, resolves to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. +On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. Set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window Claude Code should assume instead. The variable works differently for an unrecognized ID, an unrecognized ID with `[1m]`, and an ID that Claude Code recognizes: + + * If Claude Code doesn’t recognize the ID and the ID doesn’t contain `[1m]`, the variable applies on its own and proactive compaction continues at the declared window. For an ID such as `claude-sonnet-latest`, this requires Claude Code v2.1.324 or later. + * If Claude Code doesn’t recognize the ID and the ID contains `[1m]`, in any casing, Claude Code assumes a 1M window for it. A value under 1M in the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With that variable set, Claude Code sizes the ID like the same ID without `[1m]`, so `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies. With a declared window above 200K, the warning that [the 200K limit isn’t enforced](</docs/en/errors#the-200k-limit-isnt-enforced>) is expected in this configuration. + * If the ID resolves to a model Claude Code recognizes, the variable takes effect only when you also set [`DISABLE_COMPACT`](</docs/en/env-vars>), which disables all compaction. For example, an ID that contains a Claude model name that Claude Code knows, such as `anthropic/claude-opus-4-8`, `us.anthropic.claude-…-v1:0`, or the dated `claude-sonnet-4-5@20250929`, resolves to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with a [too-long error Claude Code recognizes](</docs/en/errors#prompt-is-too-long>). Claude Code doesn’t run that recovery when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>) to wording Claude Code doesn’t recognize. @@ -727,7 +744,12 @@ Google Cloud’s Agent Platform| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Microsoft Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. A pinned model with a native 1M window, such as Opus 4.8 or Sonnet 5, runs with the 1M context window without any suffix when Claude Code can match the pinned ID to that model. The ID matches when it contains the model’s Anthropic API ID, as `us.anthropic.claude-opus-4-8` contains `claude-opus-4-8`, or when a `modelOverrides` entry maps the model to it. On a pinned ID that Claude Code can’t match to a model, sessions run with a 200K window by default unless the ID carries the `[1m]` suffix. For a model that reaches 1M through its `[1m]` variant, such as Opus 4.6 or Sonnet 4.6, enable extended context by appending `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: +Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. By default, Claude Code treats a pinned ID as having the 1M context window, with no `[1m]` suffix needed, in these cases: + + * **An ID Claude Code matches to a model with a native 1M window, such as Opus 4.8 or Sonnet 5** : the ID matches when it contains the model’s Anthropic API ID, as `us.anthropic.claude-opus-4-8` contains `claude-opus-4-8`, or when a `modelOverrides` entry maps the model to it + * **An ID Claude Code can’t match to a model** : set the real window if the model behind the ID accepts less + +For a model that reaches 1M through its `[1m]` variant, such as Opus 4.6 or Sonnet 4.6, enable extended context by appending `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]'
modified
Show diff (740 lines)
--- a/model-config.md +++ b/model-config.md @@ -1,8 +1,4 @@ -## - -​ - -Available models +## Available models For the `model` setting in Claude Code, you can configure either: @@ -17,11 +13,7 @@ `ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateways](</docs/en/llm-gateway>). -### - -​ - -Model aliases +### Model aliases Use a model alias to select model settings without remembering exact version numbers: @@ -50,11 +42,7 @@ Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Use v2.1.293 or later with Haiku 5.5. Run `claude update` to upgrade. -### - -​ - -Work with Fable +### Work with Fable [Claude Fable models](<https://platform.claude.com/docs/en/about-claude/models/overview>) are the most capable models in Claude Code, suited to tasks larger than a single sitting. They sustain long autonomous sessions, investigate before acting, and verify their work more often than smaller models. No Fable model is the account-type default on any plan or provider. Select one explicitly: @@ -77,11 +65,7 @@ On the Anthropic API, a Fable model appears in the `/model` picker unless `availableModels` or organization model restrictions exclude it. When your organization can’t use Fable at all, for example under [zero data retention](</docs/en/zero-data-retention#model-availability-under-zdr>), the row stays in the picker grayed out, with a note on why. -#### - -​ - -Fable and usage credits +#### Fable and usage credits Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: @@ -96,11 +80,7 @@ In a session another application hosts through the [Agent SDK](</docs/en/agent-sdk/overview>), whether the prompt appears is up to that application. If it appears and nobody answers before the same [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, Claude Code ends the turn without sending the request. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking. -### - -​ - -Setting your model +### Setting your model You can configure your model in several ways, listed in order of priority: @@ -121,7 +101,7 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. If your `model` setting is `haiku`, a session saved on a Haiku model resumes on the model that `haiku` resolves to now. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. If your `model` setting is `haiku`, a session saved on a Haiku model resumes on the model that `haiku` resolves to now. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. @@ -143,11 +123,7 @@ "model": "opus" } -#### - -​ - -Fix a mistyped model name +#### Fix a mistyped model name Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize: @@ -157,11 +133,7 @@ * **You mistyped the ID** : change it to the suggestion wherever you set the model * **The ID is deliberate** : leave it as it is. The session sends it as you wrote it. If the context window Claude Code assumes for it is wrong, correct the window -#### - -​ - -Set a default model for new sessions +#### Set a default model for new sessions Set `ANTHROPIC_DEFAULT_MODEL=<alias|name>` to choose the model your sessions start on by default. Requires Claude Code v2.1.236 or later. Claude Code starts a new session on the variable’s model only when none of these selects a model: @@ -179,11 +151,7 @@ When a new session would start on the variable’s model, a session you resume with `claude --resume`, `--continue`, or the `/resume` picker starts on it too. Claude Code doesn’t restore the model saved in that session’s transcript. Otherwise Claude Code doesn’t use the variable when you resume a session. -#### - -​ - -A new session starts on a different model than you picked +#### A new session starts on a different model than you picked When you pick a model with `/model` and your next session starts on something else, these are the usual causes: @@ -192,11 +160,7 @@ * **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>). * **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default. -## - -​ - -Restrict model selection +## Restrict model selection Administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Each entry matches one of these: @@ -243,11 +207,7 @@ "availableModels": ["sonnet", "haiku"] } -### - -​ - -Surface coverage +### Surface coverage Every surface enforces the allowlist it receives. Which delivery mechanism reaches each surface differs: @@ -264,19 +224,11 @@ * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. -### - -​ - -Default model behavior +### Default model behavior With the default prefix matching, `availableModels` on its own leaves the Default option on the system’s runtime default for the account until you also set `enforceAvailableModels`. If that default is a model you intend to restrict, set `enforceAvailableModels` as well, or block that model. With `availableModels: []`, named model selections are blocked and `enforceAvailableModels` has no effect. -### - -​ - -Enforce the allowlist for the Default model +### Enforce the allowlist for the Default model Set `enforceAvailableModels: true` alongside a non-empty `availableModels` in managed settings to extend the allowlist to the Default option. This requires Claude Code v2.1.175 or later. @@ -287,11 +239,7 @@ For a member with no model recorded on their account, the Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. A model recorded on a member’s account is checked against `availableModels` too; Setting your model describes how the Default option treats it. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys together in the highest-ranked managed source you deliver. By default Claude Code reads only that source, so a pair placed in a managed settings file is ignored when the admin console delivers any settings; under the opt-in merge in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code still ignores a `modelOverrides` map from a source ranked below the one that sets `availableModels`. -### - -​ - -Control the model users run on +### Control the model users run on The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system’s runtime default regardless of what `model` is set to, unless `enforceAvailableModels` or the keys that block specific versions apply to it. To fully control the model experience, combine these settings: @@ -314,27 +262,15 @@ Without `enforceAvailableModels` or the `env` block, a user who selects Default in the picker gets the runtime default rather than the version pinned in `model`. The two settings cover different scopes: `enforceAvailableModels` makes Default obey the allowlist, while the `env` block pins which version a permitted alias such as `sonnet` resolves to. Use `enforceAvailableModels` alone when restricting model families is enough; add the `env` block when you also need to pin a specific version. -### - -​ - -Merge behavior +### Merge behavior When the managed settings Claude Code applies define `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#exceptions-to-managed-settings-precedence>): entries in user, project, or local settings cannot extend it, and Claude Code never merges `availableModels` across managed sources either; [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s list applies. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. Before Claude Code v2.1.175, entries from lower-precedence scopes merged into the managed list instead of being replaced by it. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry. For example, with `["sonnet", "claude-sonnet-4-5"]`, users can pick only the model IDs that `claude-sonnet-4-5` matches, not every Sonnet model. -### - -​ - -Mantle model IDs +### Mantle model IDs Entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options. This is an exception to the alias matching described in Pin models for third-party deployments. With the [Amazon Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) enabled, Claude Code routes the entries that match the Mantle format to that endpoint. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. -### - -​ - -Block specific models or versions +### Block specific models or versions An `availableModels` entry such as `claude-opus-5` also permits later releases that extend it, such as Opus 5.5, as soon as Claude Code supports them. Two managed settings let you hold a release back, and both require Claude Code v2.1.283 or later: @@ -356,11 +292,7 @@ If none of those is permitted, a session starting on the Default option [refuses to start](</docs/en/errors#managed-settings-block-the-default-model>) with an error that names the key to fix. An `"exact"` list affects the Default option only when the managed `availableModels` list names at least one model or family. Claude Code reads both keys from managed settings only. If you set either one in user, project, or local settings or with `--settings`, Claude Code ignores it with a warning. -### - -​ - -Organization model restrictions +### Organization model restrictions Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. Surface coverage says how each surface receives and enforces these settings. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to its usual model when the organization permits it. When the organization restricts that model, Claude Code substitutes the newest version of the family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: @@ -371,11 +303,7 @@ Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions reach sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments only; on any other provider, use `availableModels` instead. -## - -​ - -Organization default model +## Organization default model Organization admins on Claude Enterprise plans can set a default model for Claude Code members from the claude.ai admin console, for the whole organization or per custom role. When one is set, the Default option resolves to that model. Requires Claude Code v2.1.196 or later. The Default row in the `/model` picker shows the organization default’s name with the label Org default. The label reads Org default whether the admin set the default for the whole organization or for your role. A role default covers members of that custom role and takes precedence over the organization-wide default; when several of your roles set different defaults, the most capable model applies. The organization default is a starting point, not a restriction. These selections take precedence over it: @@ -392,11 +320,7 @@ As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/managed-settings>) instead. -## - -​ - -Organization effort limits +## Organization effort limits Your organization can cap the effort level in two ways. On a Claude Enterprise plan, organization admins set per-role effort limits, described below. On any plan and any provider, including Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) managed setting caps effort on the client instead. When both apply to a model, the lower cap applies. Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Requires Claude Code v2.1.195 or later. @@ -406,17 +330,9 @@ Effort limits are delivered together with organization model restrictions and reach the same sessions. -## - -​ - -Special model behavior - -### - -​ - -`default` model setting +## Special model behavior + +### `default` model setting The behavior of `default` depends on your account type: @@ -428,11 +344,7 @@ Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it, apart from the one-time change to a saved Fable 5.1 pick. -### - -​ - -`opusplan` model setting +### `opusplan` model setting The `opusplan` model alias provides an automated hybrid approach: @@ -441,11 +353,7 @@ This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting, and the execution phase uses the same window as `sonnet`. When `opus` and `sonnet` resolve to models that run with the 1M context window by default, as the current models do on the Anthropic API, both phases run with it. To request 1M context for both phases where they don’t, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). -### - -​ - -Fallback model chains +### Fallback model chains When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors, and a [denial by your organization’s policy check](</docs/en/errors#automatic-retries>), never trigger a switch; those follow their normal retry and error handling. It does switch when [Amazon Bedrock](</docs/en/amazon-bedrock#when-a-model-is-disabled-mid-session>) or [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-a-model-is-disabled-mid-session>) refuses a model your account can’t invoke, which Claude Code treats as the model being unavailable rather than as an authentication error. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: @@ -464,11 +372,7 @@ Claude Code also applies the chain to [subagents](</docs/en/sub-agents>). When a subagent’s request fails over, Claude Code tries your configured fallback models in order, and the subagent continues on the model that accepts the request. Your session’s model is unchanged. Before v2.1.247, a failure the chain covers ended the subagent instead. -### - -​ - -Automatic model fallback +### Automatic model fallback This section covers content-based fallback from Fable models, Opus 5.5, Sonnet 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. For those two categories, the fallback model depends on which model refused: @@ -478,11 +382,7 @@ On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment’s model IDs instead. See Enable fallback on Bedrock, Agent Platform, and Foundry. When Claude Code switches a flagged request to the fallback model for its category, it re-runs the request on that model. In your main conversation, it shows a notice in the transcript. To be asked first, see Ask before switching. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. -#### - -​ - -Effort level after a fallback +#### Effort level after a fallback When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: @@ -491,19 +391,11 @@ To see the level set for your session after a fallback, run `/effort status`. To change it, run `/effort`. -#### - -​ - -Check what triggered fallback +#### Check what triggered fallback Fallback can trigger on the first request of a session, before you send anything unusual, because the first request carries workspace context such as your CLAUDE.md content and git status. A repository that contains security or biology material can trip the classifier on that context alone. To check whether customizations are the trigger, start a session with `claude --safe-mode`, which disables customizations such as CLAUDE.md, skills, MCP servers, and hooks. Git status and directory names are not customizations and are still included. -#### - -​ - -Ask before switching +#### Ask before switching To decide what happens each time a request is flagged, run `/config`, select **Switch models when a message is flagged** , and choose **Ask each time**. You can also set [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) to `false` in your settings file. Claude Code then pauses at a flagged request that would switch models and gives you two options: switch to the fallback model, or edit the prompt and retry. The first time a flagged request would switch models in an interactive session, Claude Code may ask whether to switch automatically from then on. It asks only if you haven’t set `switchModelsOnFlag`, and it saves your choice as that key in your user settings. If you choose to stay on the current model instead, the saved value is `false`, the same as **Ask each time**. If you dismiss the question, Claude Code saves nothing and asks again the next time a flagged request would switch models. When you’ve chosen **Ask each time** , some cases behave differently: @@ -514,11 +406,7 @@ * In a subagent that Claude starts with the [Agent tool](</docs/en/tools-reference#agent-tool-behavior>), Claude Code doesn’t pause to ask, and the subagent fails instead of switching models. See Subagents switch or fail without asking. * When the fallback target is blocked by `availableModels`, Claude Code doesn’t show the prompt. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked. -#### - -​ - -Subagents switch or fail without asking +#### Subagents switch or fail without asking In a built-in or custom [subagent](</docs/en/sub-agents>) that Claude starts with the [Agent tool](</docs/en/tools-reference#agent-tool-behavior>), Claude Code doesn’t pause to ask at a flagged request. If a fallback model is available, the request re-runs on it or the subagent fails, according to your **Switch models when a message is flagged** choice in `/config`: @@ -527,11 +415,7 @@ When no fallback model is available, the subagent fails the same way with either choice. Before v2.1.318, a subagent’s flagged request re-ran on an available fallback model whichever you chose. -#### - -​ - -Enable fallback on Bedrock, Agent Platform, and Foundry +#### Enable fallback on Bedrock, Agent Platform, and Foundry On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify each model involved: @@ -547,19 +431,11 @@ The fallback model must also have a context window at least as large as the session’s, or Claude Code doesn’t switch and the flagged request ends with the same refusal. On these providers the source models run with the 1M context window by default. Pin a model that also does, such as Opus 4.8 in `ANTHROPIC_DEFAULT_OPUS_MODEL` or Sonnet 5 in `ANTHROPIC_DEFAULT_SONNET_MODEL`, by an ID Claude Code can match to that model. -#### - -​ - -Security research and biology workloads +#### Security research and biology workloads Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. For substantive biology work on a Fable model or Opus 5.5, the first flagged request that switches models moves the session to Opus 5. Later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5 and Sonnet 5.5, those refusals start with the first flagged request. -### - -​ - -Adjust effort level +### Adjust effort level [Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which lets the model decide whether and how much to think on each step based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. The available effort levels depend on the model. Models not listed here do not support effort: @@ -599,11 +475,7 @@ In those cases `--effort ultracode` starts the session with ultracode off, at the highest effort level the model and any cap allow, up to `xhigh`. -#### - -​ - -Choose an effort level +#### Choose an effort level Each level trades token spend against capability. The default suits most coding tasks; adjust when you want a different balance. @@ -618,11 +490,7 @@ In tests on Opus 5.5 and Fable 5.1, Claude at a higher level tested more edge cases and verified more of its work before answering. It also made more choices on its own. At a lower level, Claude returned a starting point sooner, which fits work where you review each result and steer the next step. To see the same tasks run at each level, read [Using Claude Code: Spending your effort](<https://claude.dev/blog/spending-your-effort/>) on the blog. The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. Opus 5.5 defaults to `medium`, one level below Opus 5’s default of `high`. In Anthropic’s testing, Opus 5.5 at `medium` matches or exceeds Opus 5 at `high` on coding and knowledge-work evaluations. At a given level, Opus 5.5 tends to think more per turn than Opus 5. When you move from Opus 5 to Opus 5.5, start at `medium` rather than carrying over the level you used on Opus 5. To test levels against your own work, see [Calibrate effort](<https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#calibrate-effort>) in the Opus 5.5 prompting guide. -#### - -​ - -Use ultrathink for one-off deep reasoning +#### Use ultrathink for one-off deep reasoning Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. Claude Code passes other phrases such as “think”, “think hard”, and “think more” through as ordinary prompt text and doesn’t recognize them as keywords. Typed in the terminal prompt, the word can also raise that turn to `xhigh` effort. When it can, the word shows in rainbow colors. Requires Claude Code v2.1.311 or later. If the word isn’t rainbow when you start a new turn, try one of these: @@ -630,11 +498,7 @@ * Unset `CLAUDE_CODE_EFFORT_LEVEL` if it’s set below `xhigh`, raise your own [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) to `xhigh` or above, or ask an organization admin to raise your organization’s limit * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, set the effort level instead -#### - -​ - -Set the effort level +#### Set the effort level You can change effort through any of the following: @@ -648,27 +512,15 @@ A skill’s `effort` applies until the end of the turn it runs in, or for the forked subagent’s run with `context: fork`. A subagent’s `effort` applies while the subagent runs, unless [its invocation overrides it](</docs/en/sub-agents#choose-an-effort-level>). While either one applies, the skill or subagent runs at its level, whatever level you launch with, save, or pick. If `CLAUDE_CODE_EFFORT_LEVEL` is set, that level applies instead. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). -#### - -​ - -Effort level of subagents and teammates +#### Effort level of subagents and teammates On the main conversation’s model, a [subagent](</docs/en/sub-agents#choose-an-effort-level>) or [teammate](</docs/en/agent-teams#specify-teammates-and-models>) with no `effort` of its own runs at the level you pick in the session or set with `--effort`. On another model, that level doesn’t apply. To pick a subagent’s level, set `effort` in its definition. -#### - -​ - -Check the effort level you set +#### Check the effort level you set The effort slider appears in `/model` when a supported model is selected. A level in the session header, for example “with low effort”, comes from your effort setting, even if Claude is still working at the old level. At startup and when you change it, the footer also briefly shows the level set for your session. -#### - -​ - -When a new effort level starts +#### When a new effort level starts In a terminal session, once `/effort` confirms the new level, the next message you send runs at that level. You can send it after the turn in progress ends or [while Claude is still working](</docs/en/interactive-mode#queue-messages-while-claude-works>): @@ -677,11 +529,7 @@ Before v2.1.242, Claude Code could queue `/effort` itself until the turn finished, and always did in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). -#### - -​ - -Send no effort level +#### Send no effort level When Claude Code sends no effort level to a supported model, the [API’s default](<https://platform.claude.com/docs/en/build-with-claude/effort>) applies instead of Claude Code’s. To have Claude Code send none, start `claude` from a shell that exports `CLAUDE_CODE_EFFORT_LEVEL` with the value `auto` or the value `unset`, which do the same thing: @@ -694,19 +542,11 @@ Before v2.1.304, `/effort status` printed `Effort level: auto (currently high)` even while no level was sent. -#### - -​ - -Adaptive reasoning and fixed thinking budgets +#### Adaptive reasoning and fixed thinking budgets Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). -### - -​ - -Extended thinking +### Extended thinking Extended thinking is the reasoning Claude emits before responding. On models that support adaptive reasoning, the effort level is the primary control for how much thinking happens; the settings below turn thinking on or off and control how it displays. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. @@ -718,22 +558,14 @@ Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set [`showThinkingSummaries: true`](</docs/en/settings-reference#showthinkingsummaries>) in settings if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. -#### - -​ - -Where you can’t turn thinking off +#### Where you can’t turn thinking off You can’t turn thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. To stop or reduce thinking, use the step for your provider: * **Anthropic API** : you can turn thinking off on models such as `claude-opus-5`, `claude-sonnet-5`, and `claude-haiku-4-5`. Aliases such as `sonnet` select models where you can’t, so set the model by its ID. * **[Third-party providers](</docs/en/third-party-integrations>)** : on providers such as Amazon Bedrock and Microsoft Foundry, models with adaptive reasoning may still think with thinking off. Lower the effort level to reduce thinking. -### - -​ - -Extended context +### Extended context Long sessions with large codebases can use a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). Fable models, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support it. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. To run them with a 200K window instead, see Turn off 1M context. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Ultra, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max and Ultra. @@ -745,11 +577,7 @@ Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. On the Anthropic API, the 1M context window uses standard model pricing with no premium for tokens beyond 200K, except on Haiku 5.5, which costs more on prompts longer than 100K tokens. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. -#### - -​ - -Select 1M context for Opus 4.6 or Sonnet 4.6 +#### Select 1M context for Opus 4.6 or Sonnet 4.6 To select a 1M variant by name, append the `[1m]` suffix to a model alias or a full model name: @@ -760,46 +588,26 @@ # Or to an alias: the suffix applies to the model the alias resolves to /model opus[1m] -#### - -​ - -Context window behind an LLM gateway +#### Context window behind an LLM gateway If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant. A model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. -#### - -​ - -Turn off 1M context +#### Turn off 1M context To keep sessions at a 200K window, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1` in your shell or in a [settings file](</docs/en/env-vars#set-environment-variables>). Claude Code removes the `[1m]` model variants from the model picker. On models that run with the 1M window by default, such as the Fable models, Sonnet 5 and later, and Opus 4.7 and later, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. -#### - -​ - -Haiku 5.5 context window and pricing +#### Haiku 5.5 context window and pricing On the Anthropic API, Haiku 5.5 runs with the 1M context window on every plan, with no `[1m]` suffix to select. Its model ID is `claude-haiku-5-5`. To use it, run `/model claude-haiku-5-5` in a session, or start Claude Code from your shell with `claude --model claude-haiku-5-5`. A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](<https://platform.claude.com/docs/en/about-claude/pricing>) for both rates. Sessions auto-compact at about 967K tokens by default. To compact earlier, set a smaller auto-compact window for the model. -## - -​ - -Context window and auto-compaction +## Context window and auto-compaction The auto-compact window is how full the context window can get before Claude Code compacts the conversation. For what compaction keeps and drops per mechanism, see [What survives compaction](</docs/en/context-window#what-survives-compaction>). -### - -​ - -Set the auto-compact window +### Set the auto-compact window If Claude Code warned about the value of `CLAUDE_CODE_AUTO_COMPACT_WINDOW`, see the variable’s values and warnings. @@ -819,11 +627,7 @@ Whichever way you set the window, Claude Code caps it at the model’s context window. -#### - -​ - -Values and warnings for `CLAUDE_CODE_AUTO_COMPACT_WINDOW` +#### Values and warnings for `CLAUDE_CODE_AUTO_COMPACT_WINDOW` A warning that quotes your `CLAUDE_CODE_AUTO_COMPACT_WINDOW` value means the value falls outside 100,000 to 1,000,000 or isn’t a token count. To stop the warning, set a number in that range, such as `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`. On Claude Code v2.1.304 or later, you can also write the number with `k` for thousands or `M` for millions, as in `200k` or `1M`. Find your warning’s wording in the first column, then read across for the window your session uses and what to change: @@ -835,11 +639,7 @@ A number with no suffix is read as that many tokens, so `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200` means 200 tokens even though `/autocompact 200` means 200,000. -### - -​ - -Default auto-compact thresholds +### Default auto-compact thresholds If you don’t set an auto-compact window, Claude Code compacts when the conversation reaches the model’s context limit, except in these sessions: @@ -851,13 +651,9 @@ See the [`idleCompaction`](</docs/en/settings-reference#idlecompaction>) setting for when Claude Code also compacts a conversation you leave idle. -### - -​ - -Correct the window for a gateway or custom model ID - -Either of these startup warnings means Claude Code doesn’t recognize your session’s model ID, so it can’t tell the model’s context window and assumes 200K tokens: +### Correct the window for a gateway or custom model ID + +Either of these warnings means Claude Code doesn’t recognize your session’s model ID, so it can’t tell the model’s context window and assumes 200K tokens: ⚠ Model "my-gateway-opus" isn't recognized · context assumed to be 200k tokens · ... Claude Code doesn't recognize the model "my-gateway-opus", so it assumes a context window of 200k tokens. Update Claude Code, or see https://code.claude.com/docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id to set the window. @@ -871,11 +667,7 @@ Once Claude Code recognizes the ID or uses the window you gave it, the warning no longer appears when you start a session on that ID. -#### - -​ - -Which IDs `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies to +#### Which IDs `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies to On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. Set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window Claude Code should assume instead. How the variable applies depends on the ID. Claude Code treats an ID as a provider or custom spelling when it doesn’t start with `claude-`, in any casing, or when it carries a suffix that Claude Code strips when reading the ID, such as the `@YYYYMMDD` date used on Google Cloud’s Agent Platform. Before v2.1.259, Claude Code didn’t count a stripped suffix, so an unrecognized `claude-` ID with a date suffix was treated as a bare `claude-` name. An unrecognized provider or custom spelling, the same spelling with `[1m]`, and every other ID are three separate cases: @@ -885,22 +677,14 @@ For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with a [too-long error Claude Code recognizes](</docs/en/errors#prompt-is-too-long>). Claude Code doesn’t run that recovery when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>) to wording Claude Code doesn’t recognize. -## - -​ - -Checking your current model +## Checking your current model You can see which model you’re currently using in two places: * In the [status line](</docs/en/statusline>), if you have one configured * In `/status`, which also displays your account information -## - -​ - -Add a custom model option +## Add a custom model option Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). To list several models instead, in your own order and under labels you choose, set [`modelPicker`](</docs/en/settings-reference#modelpicker>). Its entry says which rows the picker keeps when that lineup replaces the built-in one. This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up: @@ -915,11 +699,7 @@ Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. -## - -​ - -Environment variables +## Environment variables Use the following environment variables to control the model names that the aliases map to. Each value must be a full model name, or the equivalent identifier for your API provider. To choose the model your sessions start on, set `ANTHROPIC_DEFAULT_MODEL`, which this table omits. @@ -933,11 +713,7 @@ On third-party providers, Customize pinned model display and capabilities describes what a pinned model’s row in the `/model` picker shows. Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`. -### - -​ - -Pin models for third-party deployments +### Pin models for third-party deployments When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. @@ -970,11 +746,7 @@ Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. -### - -​ - -Customize pinned model display and capabilities +### Customize pinned model display and capabilities When you pin a model on a third-party provider, its row in the `/model` picker shows the model’s name by default if Claude Code recognizes the pinned ID, and the raw ID otherwise: @@ -1007,11 +779,7 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION='Opus 4.7 routed through a Bedrock custom endpoint' export ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES='effort,xhigh_effort,max_effort,thinking,adaptive_thinking,interleaved_thinking' -### - -​ - -Override model IDs per version +### Override model IDs per version On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#where-settings-live>): @@ -1025,11 +793,7 @@ Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. To stop the `[claude-code:unrecognized_model]` [diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) for an ID such as a gateway alias, add an entry with that ID as its value. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from [managed settings](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/managed-settings>), only `modelOverrides` from managed settings apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. -### - -​ - -Prompt caching configuration +### Prompt caching configuration Claude Code automatically uses [prompt caching](</docs/en/prompt-caching>) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers: @@ -1043,11 +807,7 @@ To choose the cache TTL for the main conversation and for subagents separately, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). For what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>). -## - -​ - -Version history +## Version history This table lists the Claude Code version at which each model alias changed the model it resolves to, newest first.
modified
--- a/model-config.md +++ b/model-config.md @@ -126,7 +126,7 @@ * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. -See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t reject a mistyped value up front. The session starts, and the first request produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>). On the Anthropic API, a value that doesn’t start with `claude-` and nearly spells a model name or alias can also produce a startup warning that suggests it. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: +See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t reject a mistyped value up front. The session starts, and the first request produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>). On the Anthropic API, you can see a warning that suggests the closest name if the value nearly spells a model name or alias and doesn’t start with `claude-`. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: claude --model opus @@ -142,6 +142,20 @@ }, "model": "opus" } + +#### + +​ + +Fix a mistyped model name + +Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize: + + ⚠ Model "<model>" isn't recognized · did you mean "<suggestion>"? + Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"? + + * **You mistyped the ID** : change it to the suggestion wherever you set the model + * **The ID is deliberate** : leave it as it is. The session sends it as you wrote it. If the context window Claude Code assumes for it is wrong, correct the window #### @@ -856,20 +870,6 @@ * **Any other window** : set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window size in tokens in the environment that starts Claude Code, such as `CLAUDE_CODE_MAX_CONTEXT_TOKENS=400000`. For an unrecognized ID that doesn’t start with `claude-` and has no `[1m]` suffix, the variable takes effect on its own. For any other ID, check which IDs it applies to first. Once Claude Code recognizes the ID or uses the window you gave it, the warning no longer appears when you start a session on that ID. - -#### - -​ - -Fix a mistyped model name - -Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize: - - ⚠ Model "<model>" isn't recognized · did you mean "<suggestion>"? - Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"? - - * **You mistyped the ID** : change it to the suggestion wherever you set the model - * **The ID is deliberate** : leave it as it is. The session sends it as you wrote it. If the context window Claude Code assumes for it is wrong, correct the window ####
modified
--- a/model-config.md +++ b/model-config.md @@ -61,9 +61,9 @@ * **Fable 5.2** : run `/model fable`, or launch with `claude --model fable`. In [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, run `/model claude-fable-5-2` instead. * **Fable 5.1 or Fable 5** : select it by model ID. On the Anthropic API, run `/model claude-fable-5-1` or `/model claude-fable-5`, or launch with `claude --model claude-fable-5-1`. On other providers, use your provider’s model ID or pin it with `ANTHROPIC_DEFAULT_FABLE_MODEL`. -On Pro, Max, Team, and Enterprise plans, a `claude-fable-5-1` model saved in your user settings moves to the `fable` alias: - - * **Pro or Max plan** : the move happens the first time you run v2.1.321 or later. In the terminal, the startup model line can show `(auto-updated)` once. +On Pro, Max, Ultra, Team, and Enterprise plans, a `claude-fable-5-1` model saved in your user settings moves to the `fable` alias: + + * **Pro, Max, or Ultra plan** : the move happens the first time you run v2.1.321 or later. In the terminal, the startup model line can show `(auto-updated)` once. * **Team or Enterprise plan** : the move waits for your organization’s settings, so it can come at a later startup, or not at all. It applies from the next session, with no `(auto-updated)` line. To check your model, run `/model`. After the move, sessions start at Fable 5.2’s default effort unless you’ve set a level for it. Console accounts, third-party providers, and project, local, or managed settings keep `claude-fable-5-1`. Requests that a Fable model’s safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable: @@ -700,9 +700,20 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think - -You can’t turn thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>) + +Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set [`showThinkingSummaries: true`](</docs/en/settings-reference#showthinkingsummaries>) in settings if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. + +#### + +​ + +Where you can’t turn thinking off + +You can’t turn thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. To stop or reduce thinking, use the step for your provider: + + * **Anthropic API** : you can turn thinking off on models such as `claude-opus-5`, `claude-sonnet-5`, and `claude-haiku-4-5`. Aliases such as `sonnet` select models where you can’t, so set the model by its ID. + * **[Third-party providers](</docs/en/third-party-integrations>)** : on providers such as Amazon Bedrock and Microsoft Foundry, models with adaptive reasoning may still think with thinking off. Lower the effort level to reduce thinking. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -83,7 +83,7 @@ Fable and usage credits -Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: +Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: * When you select a Fable model with `/model`, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. @@ -126,7 +126,7 @@ * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. -See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t check it up front, and a mistyped value produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: +See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t reject a mistyped value up front. The session starts, and the first request produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>). On the Anthropic API, a value that doesn’t start with `claude-` and nearly spells a model name or alias can also produce a startup warning that suggests it. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: claude --model opus @@ -845,6 +845,20 @@ * **Any other window** : set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window size in tokens in the environment that starts Claude Code, such as `CLAUDE_CODE_MAX_CONTEXT_TOKENS=400000`. For an unrecognized ID that doesn’t start with `claude-` and has no `[1m]` suffix, the variable takes effect on its own. For any other ID, check which IDs it applies to first. Once Claude Code recognizes the ID or uses the window you gave it, the warning no longer appears when you start a session on that ID. + +#### + +​ + +Fix a mistyped model name + +Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize: + + ⚠ Model "<model>" isn't recognized · did you mean "<suggestion>"? + Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"? + + * **You mistyped the ID** : change it to the suggestion wherever you set the model + * **The ID is deliberate** : leave it as it is. The session sends it as you wrote it. If the context window Claude Code assumes for it is wrong, correct the window ####
modified
Show diff (170 lines)
--- a/model-config.md +++ b/model-config.md @@ -28,7 +28,7 @@ Model alias| Behavior ---|--- **`default`**| Special value that clears any model override and reverts to the runtime default for your account. Not itself a model alias -**`best`**| Uses the model the `fable` alias resolves to where Fable is available to you, otherwise the same model as `opus` +**`best`**| Uses the same model as `opus` **`fable`**| Uses the Fable model for your provider for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks @@ -46,7 +46,7 @@ Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5| Haiku 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5| Haiku 4.5 -Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where `opus` or `sonnet` resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5 in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions and to Fable 5.2 everywhere else. A gateway that isn’t configured to serve `claude-fable-5-2` rejects requests for that model. To use Fable 5.2 through a gateway that serves it, select it with `/model claude-fable-5-2`. Where `opus` or `sonnet` resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Use v2.1.293 or later with Haiku 5.5. Run `claude update` to upgrade. @@ -56,19 +56,24 @@ Work with Fable -[Claude Fable 5.1](<https://platform.claude.com/docs/en/about-claude/models/overview>) and Claude Fable 5 are the most capable models in Claude Code, suited to tasks larger than a single sitting. They sustain long autonomous sessions, investigate before acting, and verify their work more often than smaller models. Fable 5.1 is the newer release. Neither Fable model is the account-type default on any plan or provider. Select one explicitly: - - * **Fable 5.1** : run `/model fable`, or launch with `claude --model fable`. In [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where the alias resolves to Fable 5, run `/model claude-fable-5-1` instead. - * **Fable 5** : select it by model ID. On the Anthropic API, run `/model claude-fable-5` or launch with `claude --model claude-fable-5`. On other providers, use your provider’s Fable 5 model ID or pin it with `ANTHROPIC_DEFAULT_FABLE_MODEL`. - -If you connect to the Anthropic API directly and your user settings hold `claude-fable-5` or `claude-fable-5[1m]` as the model, for example because you selected Fable in the `/model` picker before v2.1.257, Claude Code changes that saved value to the `fable` or `fable[1m]` alias the first time you run v2.1.257 or later. The startup model line shows `(auto-updated)` once. A `claude-fable-5` value in project, local, or managed settings stays as it is. Requests that a Fable model’s safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable: +[Claude Fable models](<https://platform.claude.com/docs/en/about-claude/models/overview>) are the most capable models in Claude Code, suited to tasks larger than a single sitting. They sustain long autonomous sessions, investigate before acting, and verify their work more often than smaller models. No Fable model is the account-type default on any plan or provider. Select one explicitly: + + * **Fable 5.2** : run `/model fable`, or launch with `claude --model fable`. In [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, run `/model claude-fable-5-2` instead. + * **Fable 5.1 or Fable 5** : select it by model ID. On the Anthropic API, run `/model claude-fable-5-1` or `/model claude-fable-5`, or launch with `claude --model claude-fable-5-1`. On other providers, use your provider’s model ID or pin it with `ANTHROPIC_DEFAULT_FABLE_MODEL`. + +On Pro, Max, Team, and Enterprise plans, a `claude-fable-5-1` model saved in your user settings moves to the `fable` alias: + + * **Pro or Max plan** : the move happens the first time you run v2.1.321 or later. In the terminal, the startup model line can show `(auto-updated)` once. + * **Team or Enterprise plan** : the move waits for your organization’s settings, so it can come at a later startup, or not at all. It applies from the next session, with no `(auto-updated)` line. To check your model, run `/model`. + +After the move, sessions start at Fable 5.2’s default effort unless you’ve set a level for it. Console accounts, third-party providers, and project, local, or managed settings keep `claude-fable-5-1`. Requests that a Fable model’s safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable: * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working toward that outcome, [set a goal](</docs/en/goal>). * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off. * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread. -Fable 5.1 requires Claude Code v2.1.257 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). +Fable 5.2 requires Claude Code v2.1.321 or later, and Fable 5.1 requires v2.1.257 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). On the Anthropic API, a Fable model appears in the `/model` picker unless `availableModels` or organization model restrictions exclude it. When your organization can’t use Fable at all, for example under [zero data retention](</docs/en/zero-data-retention#model-availability-under-zdr>), the row stays in the picker grayed out, with a note on why. @@ -179,7 +184,13 @@ Restrict model selection -Administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Each entry matches one of these: + + * A model family such as `sonnet` + * A version prefix such as `claude-sonnet-4-5`. It also matches later model IDs that extend it with another segment. For example, `claude-fable-5` permits Fable 5, Fable 5.1, and Fable 5.2, while `claude-fable-5-1` permits Fable 5.1 only + * A full model ID such as `claude-sonnet-4-5-20250929` + +To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -399,7 +410,9 @@ * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. +Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. + +Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it, apart from the one-time change to a saved Fable 5.1 pick. ### @@ -445,7 +458,7 @@ This section covers content-based fallback from Fable models, Opus 5.5, Sonnet 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. For those two categories, the fallback model depends on which model refused: - * **Fable 5.1, Fable 5, and Opus 5.5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. + * **Fable models and Opus 5.5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. * **Sonnet 5.5** : cybersecurity-flagged requests re-run on Sonnet 5. Biology-flagged requests end with a refusal instead, because Sonnet 5.5 has no biology fallback model. * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. @@ -508,7 +521,7 @@ On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify each model involved: - * Claude Code must recognize the current model as a fallback source. Fable 5.1 and Fable 5 are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5, Sonnet 5.5, and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping. + * Claude Code must recognize the current model as a fallback source. Fable models are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5, Sonnet 5.5, and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping. * An Opus target must resolve in your deployment, whichever model refused: set `ANTHROPIC_DEFAULT_OPUS_MODEL`, or keep an Opus 4.8 entry in the provider’s model list. Without one, fallback stays off for every source model, including Sonnet 5.5, and flagged requests end with a refusal. * The flagged category’s fallback model must resolve in your deployment. From a Fable model, Opus 5.5, or Opus 5, if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on the Opus 4.8 entry, and biology-flagged requests from a Fable model or Opus 5.5 on an Opus 5 entry. From Sonnet 5.5, cybersecurity-flagged requests re-run on the model you set in `ANTHROPIC_DEFAULT_SONNET_MODEL`, or on a Sonnet 5 entry in the provider’s model list if you don’t set it. @@ -526,7 +539,7 @@ Security research and biology workloads -Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1, Fable 5, or Opus 5.5, the first flagged request that switches models moves the session to Opus 5, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5 and Sonnet 5.5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. For substantive biology work on a Fable model or Opus 5.5, the first flagged request that switches models moves the session to Opus 5. Later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5 and Sonnet 5.5, those refusals start with the first flagged request. ### @@ -538,7 +551,7 @@ Model| Levels ---|--- -Fable 5.1 and Fable 5| `low`, `medium`, `high`, `xhigh`, `max` +Fable models| `low`, `medium`, `high`, `xhigh`, `max` Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` @@ -548,7 +561,7 @@ 2. A level you pick in the session, such as with `/effort`, the `/model` picker, or [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) 3. Launching with `--effort` 4. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) - 5. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium` and Opus 4.7 defaults to `xhigh`. If your organization sets a default effort level for its organization default model, that level is the default when you run that model. + 5. The model’s default effort: Fable 5.2, Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium`, and Opus 4.7 defaults to `xhigh`. Other models in the effort levels table default to `high`. If your organization sets a default effort level for its organization default model, that level is the default when you run that model. After an automatic model fallback, see Effort level after a fallback for the level that applies. For subagents and teammates, see Effort level of subagents and teammates. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: @@ -583,8 +596,8 @@ Level| When to use it ---|--- `low`| Quick exchanges where you review each result, such as brainstorming, a first sketch, or a small change like a rename -`medium`| The default on Opus 5.5, Sonnet 5.5, and Haiku 5.5. On Opus 5.5 and Sonnet 5.5, it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On models with a higher default, reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on every model except Opus 5.5, Sonnet 5.5, Haiku 5.5, and Opus 4.7 +`medium`| The default on the Fable 5.2, Opus 5.5, Sonnet 5.5, and Haiku 5.5 models. On Opus 5.5 and Sonnet 5.5, it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On models with a higher default, reduces token usage for cost-sensitive work that can trade off some intelligence +`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on the other models in the effort table `xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 `max`| Hard problems you want Claude to work through without you, such as finding security vulnerabilities. `max` may show diminishing returns and is prone to overthinking, so test before adopting it broadly `ultracode`| A Claude Code setting rather than a level: plans a [dynamic workflow](</docs/en/workflows>) for each substantive task at any effort level @@ -601,7 +614,7 @@ * Retype it outside anything such as quotes, brackets, a path, or a command, in a prompt that doesn’t start with `/` * Unset `CLAUDE_CODE_EFFORT_LEVEL` if it’s set below `xhigh`, raise your own [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) to `xhigh` or above, or ask an organization admin to raise your organization’s limit - * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, set the effort level instead + * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, set the effort level instead #### @@ -697,7 +710,7 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. To run them with a 200K window instead, see Turn off 1M context. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Ultra, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max and Ultra. +Long sessions with large codebases can use a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). Fable models, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support it. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. To run them with a 200K window instead, see Turn off 1M context. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Ultra, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max and Ultra. Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -728,7 +741,7 @@ Context window behind an LLM gateway -If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. +If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant. A model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. #### @@ -1015,6 +1028,8 @@ Version| Change ---|--- +v2.1.321| `fable` resolves to Fable 5.2, except in Claude apps gateway sessions +v2.1.321| `best` resolves to the same model as `opus`. Earlier versions use the model `fable` resolves to, where Fable is available v2.1.293| `haiku` resolves to Haiku 5.5 on the Anthropic API v2.1.284| `sonnet` resolves to Sonnet 5.5 on the Anthropic API v2.1.280| `opus` resolves to Opus 5.5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform
modified
--- a/model-config.md +++ b/model-config.md @@ -484,8 +484,21 @@ * If both models flag the same request, you can edit the prompt and retry, or start a new session. * In [cloud sessions](</docs/en/claude-code-on-the-web>) on the mobile app, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. - * In a [subagent](</docs/en/sub-agents>), Claude Code doesn’t show the prompt, and a flagged request that would switch models re-runs on the fallback model. + * In a subagent that Claude starts with the [Agent tool](</docs/en/tools-reference#agent-tool-behavior>), Claude Code doesn’t pause to ask, and the subagent fails instead of switching models. See Subagents switch or fail without asking. * When the fallback target is blocked by `availableModels`, Claude Code doesn’t show the prompt. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked. + +#### + +​ + +Subagents switch or fail without asking + +In a built-in or custom [subagent](</docs/en/sub-agents>) that Claude starts with the [Agent tool](</docs/en/tools-reference#agent-tool-behavior>), Claude Code doesn’t pause to ask at a flagged request. If a fallback model is available, the request re-runs on it or the subagent fails, according to your **Switch models when a message is flagged** choice in `/config`: + + * **Switch automatically** , or no choice yet: the request re-runs on the fallback model, and your session’s model is unchanged + * **Ask each time** : the subagent fails with [`Agent terminated early due to an API error`](</docs/en/errors#agent-terminated-early-due-to-an-api-error>) and the refusal message. Claude receives that error and decides what to do about the unfinished task. To let subagents switch models, choose **Switch automatically**. Your main conversation then switches without asking too. + +When no fallback model is available, the subagent fails the same way with either choice. Before v2.1.318, a subagent’s flagged request re-ran on an available fallback model whichever you chose. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -537,7 +537,7 @@ 4. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) 5. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium` and Opus 4.7 defaults to `xhigh`. If your organization sets a default effort level for its organization default model, that level is the default when you run that model. -After an automatic model fallback, see Effort level after a fallback for the level that applies. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: +After an automatic model fallback, see Effort level after a fallback for the level that applies. For subagents and teammates, see Effort level of subagents and teammates. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: * `Enter` in the `/effort` slider or the `/model` picker, or a level typed after `/effort`: save the level as your default and apply it in later sessions * `s` in the `/effort` slider or the `/model` picker: apply the level to this session only. Requires Claude Code v2.1.257 or later @@ -607,6 +607,14 @@ * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs A skill’s `effort` applies until the end of the turn it runs in, or for the forked subagent’s run with `context: fork`. A subagent’s `effort` applies while the subagent runs, unless [its invocation overrides it](</docs/en/sub-agents#choose-an-effort-level>). While either one applies, the skill or subagent runs at its level, whatever level you launch with, save, or pick. If `CLAUDE_CODE_EFFORT_LEVEL` is set, that level applies instead. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). + +#### + +​ + +Effort level of subagents and teammates + +On the main conversation’s model, a [subagent](</docs/en/sub-agents#choose-an-effort-level>) or [teammate](</docs/en/agent-teams#specify-teammates-and-models>) with no `effort` of its own runs at the level you pick in the session or set with `--effort`. On another model, that level doesn’t apply. To pick a subagent’s level, set `effort` in its definition. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -869,7 +869,7 @@ `ANTHROPIC_DEFAULT_FABLE_MODEL`| The model to use for `fable`, and the model ID Claude Code recognizes as a Fable model for automatic model fallback on third-party providers `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. -`ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) +`ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or background functionality `CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#run-every-subagent-on-one-model>) On third-party providers, Customize pinned model display and capabilities describes what a pinned model’s row in the `/model` picker shows. Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
modified
--- a/model-config.md +++ b/model-config.md @@ -395,11 +395,11 @@ The behavior of `default` depends on your account type: - * **Pro, Max, Team, Enterprise, and Anthropic API** : defaults to Opus 5.5 + * **Pro, Max, Ultra, Team, Enterprise, and Anthropic API** : defaults to Opus 5.5 * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. +Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. ### @@ -676,11 +676,11 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. To run them with a 200K window instead, see Turn off 1M context. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. To run them with a 200K window instead, see Turn off 1M context. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Ultra, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max and Ultra. Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- -Max, Team, and Enterprise| Included with subscription| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +Max, Ultra, Team, and Enterprise| Included with subscription| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access
modified
--- a/model-config.md +++ b/model-config.md @@ -78,7 +78,7 @@ Fable and usage credits -Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code shows a consent prompt before a Fable request bills usage credits. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: +Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: * When you select a Fable model with `/model`, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. @@ -462,7 +462,7 @@ * **Your own change** : once you choose an effort level, pick a model in `/model`, or resume the session later, the flagged request’s level no longer carries over. * **Effort set for one turn** : if you raised the flagged turn with `ultrathink`, or a skill’s `effort` frontmatter set its level, that level applies to that turn. Later turns run at the level the effort resolution order gives the fallback model. -In the session, run `/effort status` to see the level in effect, or `/effort` to change it. +To see the level set for your session after a fallback, run `/effort status`. To change it, run `/effort`. #### @@ -531,9 +531,11 @@ If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization or your own settings can also cap the levels a model offers; see Organization effort limits. Claude Code resolves the session’s effort level in this order, taking the first that applies: - 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) - 2. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) - 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model + 1. The [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable + 2. A level you pick in the session, such as with `/effort`, the `/model` picker, or [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) + 3. Launching with `--effort` + 4. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) + 5. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium` and Opus 4.7 defaults to `xhigh`. If your organization sets a default effort level for its organization default model, that level is the default when you run that model. After an automatic model fallback, see Effort level after a fallback for the level that applies. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: @@ -597,14 +599,14 @@ You can change effort through any of the following: * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to clear your saved level for the active model - * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model + * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model. The new level starts with your next message at the latest. Until then, Claude can keep working at the old level, even on a new model. While a source that outranks your pick applies, such as `CLAUDE_CODE_EFFORT_LEVEL`, Claude works at that source’s level instead. * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name. To have Claude Code send no effort level, set it to `auto` or `unset` instead * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted as a level in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). +A skill’s `effort` applies until the end of the turn it runs in, or for the forked subagent’s run with `context: fork`. A subagent’s `effort` applies while the subagent runs, unless [its invocation overrides it](</docs/en/sub-agents#choose-an-effort-level>). While either one applies, the skill or subagent runs at its level, whatever level you launch with, save, or pick. If `CLAUDE_CODE_EFFORT_LEVEL` is set, that level applies instead. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). #### @@ -612,7 +614,7 @@ Check the effort level you set -The effort slider appears in `/model` when a supported model is selected. A level in the session header, for example “with low effort”, comes from your effort setting, even if Claude is still working at the old level. The footer also briefly shows the effort level at startup and when it changes. +The effort slider appears in `/model` when a supported model is selected. A level in the session header, for example “with low effort”, comes from your effort setting, even if Claude is still working at the old level. At startup and when you change it, the footer also briefly shows the level set for your session. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -599,7 +599,7 @@ * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to clear your saved level for the active model * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code - * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` + * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name. To have Claude Code send no effort level, set it to `auto` or `unset` instead * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted as a level in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs @@ -626,6 +626,23 @@ * **While Claude is still working** : type a message, such as `keep going`, and press `Enter` to queue it without interrupting the turn. Claude gets it when its current tool calls finish, or when the turn ends at the latest, and works at the new level from then on. Before v2.1.242, Claude Code could queue `/effort` itself until the turn finished, and always did in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). + +#### + +​ + +Send no effort level + +When Claude Code sends no effort level to a supported model, the [API’s default](<https://platform.claude.com/docs/en/build-with-claude/effort>) applies instead of Claude Code’s. To have Claude Code send none, start `claude` from a shell that exports `CLAUDE_CODE_EFFORT_LEVEL` with the value `auto` or the value `unset`, which do the same thing: + + export CLAUDE_CODE_EFFORT_LEVEL=auto + +The session header and footer show no effort level while none is sent. To confirm that none is sent, run `/effort status` at the Claude Code prompt: + + * **`Effort level: auto`** : no effort level is sent. + * **`Effort level: auto (currently<level>)`**: a level is still sent. If a [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) setting below `max` applies to the active model, Claude Code sends its own default for the model, lowered to that cap. Remove the setting or set it to `max`. + +Before v2.1.304, `/effort status` printed `Effort level: auto (currently high)` even while no level was sent. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -460,7 +460,7 @@ When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: * **Your own change** : once you choose an effort level, pick a model in `/model`, or resume the session later, the flagged request’s level no longer carries over. - * **Skill effort** : a level that a skill’s `effort` frontmatter set for the flagged request applies to that turn, and later turns run at the level the effort resolution order gives the fallback model. + * **Effort set for one turn** : if you raised the flagged turn with `ultrathink`, or a skill’s `effort` frontmatter set its level, that level applies to that turn. Later turns run at the level the effort resolution order gives the fallback model. In the session, run `/effort status` to see the level in effect, or `/effort` to change it. @@ -582,7 +582,11 @@ Use ultrathink for one-off deep reasoning -Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. The effort level sent to the API is unchanged. Claude Code passes other phrases such as “think”, “think hard”, and “think more” through as ordinary prompt text and doesn’t recognize them as keywords. +Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. Claude Code passes other phrases such as “think”, “think hard”, and “think more” through as ordinary prompt text and doesn’t recognize them as keywords. Typed in the terminal prompt, the word can also raise that turn to `xhigh` effort. When it can, the word shows in rainbow colors. Requires Claude Code v2.1.311 or later. If the word isn’t rainbow when you start a new turn, try one of these: + + * Retype it outside anything such as quotes, brackets, a path, or a command, in a prompt that doesn’t start with `/` + * Unset `CLAUDE_CODE_EFFORT_LEVEL` if it’s set below `xhigh`, raise your own [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) to `xhigh` or above, or ask an organization admin to raise your organization’s limit + * Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.1 model. Where the word can’t raise a turn, such as on Amazon Bedrock, set the effort level instead #### @@ -592,7 +596,7 @@ You can change effort through any of the following: - * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to clear your saved level for the active model. You can run it while Claude is working, and once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in the turn + * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to clear your saved level for the active model * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` @@ -600,7 +604,28 @@ * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. +Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). + +#### + +​ + +Check the effort level you set + +The effort slider appears in `/model` when a supported model is selected. A level in the session header, for example “with low effort”, comes from your effort setting, even if Claude is still working at the old level. The footer also briefly shows the effort level at startup and when it changes. + +#### + +​ + +When a new effort level starts + +In a terminal session, once `/effort` confirms the new level, the next message you send runs at that level. You can send it after the turn in progress ends or [while Claude is still working](</docs/en/interactive-mode#queue-messages-while-claude-works>): + + * **After the turn ends** : you don’t have to do anything until then, and it’s expected if the turn finishes at the old level + * **While Claude is still working** : type a message, such as `keep going`, and press `Enter` to queue it without interrupting the turn. Claude gets it when its current tool calls finish, or when the turn ends at the latest, and works at the new level from then on. + +Before v2.1.242, Claude Code could queue `/effort` itself until the turn finished, and always did in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). ####
modified
--- a/model-config.md +++ b/model-config.md @@ -295,7 +295,7 @@ Merge behavior -When the managed settings Claude Code applies define `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#exceptions-to-managed-settings-precedence>): entries in user, project, or local settings cannot extend it, and Claude Code never merges `availableModels` across managed sources either; [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s list applies. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. Before Claude Code v2.1.175, entries from lower-precedence scopes merged into the managed list instead of being replaced by it. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. +When the managed settings Claude Code applies define `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#exceptions-to-managed-settings-precedence>): entries in user, project, or local settings cannot extend it, and Claude Code never merges `availableModels` across managed sources either; [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s list applies. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. Before Claude Code v2.1.175, entries from lower-precedence scopes merged into the managed list instead of being replaced by it. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry. For example, with `["sonnet", "claude-sonnet-4-5"]`, users can pick only the model IDs that `claude-sonnet-4-5` matches, not every Sonnet model. ### @@ -860,7 +860,12 @@ When you set an `ANTHROPIC_DEFAULT_*_MODEL` variable, the `/model` picker shows one row for that model in place of the family’s built-in rows, including any 1M context rows. To reach the 1M window without adding the suffix to that variable, your users run `/model opus[1m]`, and Claude Code applies the suffix to the model the variable names. `/model sonnet[1m]` works the same way. -An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list its full provider-form ID, or map it through `modelOverrides`. For a pinned model, that ID is the value you set in its `ANTHROPIC_DEFAULT_*_MODEL` variable. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. +An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, map it through `modelOverrides` or list its full provider-form ID: + + * **Google Cloud’s Agent Platform** : when the ID Claude Code requests carries an `@` date, such as `claude-sonnet-4-5@20250929`, include the date in your allowlist entry. On its own, `claude-sonnet-4-5` doesn’t match that ID under either [`availableModelsMatch`](</docs/en/settings-reference#availablemodelsmatch>) setting. + * **Pinned models** : list the value you set in the model’s `ANTHROPIC_DEFAULT_*_MODEL` variable + +Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -871,7 +871,7 @@ When you pin a model on a third-party provider, its row in the `/model` picker shows the model’s name by default if Claude Code recognizes the pinned ID, and the raw ID otherwise: * **Recognized** : the exact ID of a model Claude Code knows, such as its Anthropic API ID or your provider’s or gateway’s form of it, with or without the `[1m]` suffix. Pin `us.anthropic.claude-sonnet-4-5-20250929-v1:0` and the row reads `Sonnet 4.5`. - * **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that exact string. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default. + * **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that ID. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default. When a row shows the model’s name, its default description includes the pinned ID so you can still see which ID is pinned. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`.
modified
--- a/model-config.md +++ b/model-config.md @@ -373,7 +373,13 @@ Organization effort limits -Your organization can cap the effort level in two ways. On a Claude Enterprise plan, organization admins set per-role effort limits, described below. On any plan and any provider, including Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) managed setting caps effort on the client instead. When both apply to a model, the lower cap applies. Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. In interactive sessions and plain-text `--print` runs, a warning names the requested and applied levels; with `json` or `stream-json` output or in background agents, the clamp applies silently. Caps are per model, so switching models can change which levels are available. When several of your roles grant the same model, the least restrictive cap applies. Requires Claude Code v2.1.195 or later. Effort limits are delivered together with organization model restrictions and reach the same sessions. +Your organization can cap the effort level in two ways. On a Claude Enterprise plan, organization admins set per-role effort limits, described below. On any plan and any provider, including Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) managed setting caps effort on the client instead. When both apply to a model, the lower cap applies. Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Requires Claude Code v2.1.195 or later. + + * Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. If you start a plain-text `--print` run with `--effort` above the cap, a warning on stderr names the requested and applied levels. In interactive sessions, with `json` or `stream-json` output, or in background agents, that warning goes to the [debug log](</docs/en/errors#configuration-warnings>) instead. + * Caps are per model, so switching models can change which levels are available. + * When several of your roles grant the same model, the least restrictive cap applies. + +Effort limits are delivered together with organization model restrictions and reach the same sessions. ## @@ -771,7 +777,7 @@ On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. Set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window Claude Code should assume instead. How the variable applies depends on the ID. Claude Code treats an ID as a provider or custom spelling when it doesn’t start with `claude-`, in any casing, or when it carries a suffix that Claude Code strips when reading the ID, such as the `@YYYYMMDD` date used on Google Cloud’s Agent Platform. Before v2.1.259, Claude Code didn’t count a stripped suffix, so an unrecognized `claude-` ID with a date suffix was treated as a bare `claude-` name. An unrecognized provider or custom spelling, the same spelling with `[1m]`, and every other ID are three separate cases: * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID doesn’t contain `[1m]`, the variable applies directly and proactive compaction continues at the declared window. - * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID contains `[1m]`, in any casing, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With that variable set, Claude Code sizes the ID like the same spelling without `[1m]`, so `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies when it would apply to that untagged spelling. With a declared window above 200K, Claude Code then shows a [startup warning](</docs/en/errors#the-200k-limit-isnt-enforced>) that the 200K limit isn’t enforced. The warning is expected in this configuration. + * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID contains `[1m]`, in any casing, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With that variable set, Claude Code sizes the ID like the same spelling without `[1m]`, so `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies when it would apply to that untagged spelling. With a declared window above 200K, the warning that [the 200K limit isn’t enforced](</docs/en/errors#the-200k-limit-isnt-enforced>) is expected in this configuration. * If the ID resolves to a model Claude Code recognizes, or the ID is a bare `claude-` name with no suffix for Claude Code to strip, in any casing, the variable takes effect only when you also set [`DISABLE_COMPACT`](</docs/en/env-vars>), which disables all compaction. For example, an ID that contains a Claude model name that Claude Code knows, such as `anthropic/claude-opus-4-8`, `us.anthropic.claude-…-v1:0`, or the dated `claude-sonnet-4-5@20250929`, resolves to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with a [too-long error Claude Code recognizes](</docs/en/errors#prompt-is-too-long>). Claude Code doesn’t run that recovery when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>) to wording Claude Code doesn’t recognize.
modified
--- a/model-config.md +++ b/model-config.md @@ -198,6 +198,7 @@ * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting + * **`CLAUDE_CODE_AUTO_MODE_MODEL`** : Claude Code ignores the variable and picks the model for its [auto mode classifier requests](</docs/en/permission-modes#default-classifier-model>) as if you hadn’t set it Claude Code hides excluded models from the `/model` picker. Whether a model ID you list also gets a row of its own differs by provider: @@ -209,7 +210,7 @@ * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead - * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on a Fable model. On providers other than the Anthropic API, that Opus fallback runs on the model you set in `ANTHROPIC_DEFAULT_OPUS_MODEL` or otherwise on Opus 5, without consulting the allowlist. Requires Claude Code v2.1.210 or later + * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : when the allowlist excludes the [default classifier model](</docs/en/permission-modes#default-classifier-model>), classifier requests that would use that model run on the session model, or an Opus model in Fable sessions. On providers other than the Anthropic API, that Opus fallback runs on the model you set in `ANTHROPIC_DEFAULT_OPUS_MODEL` or otherwise on Opus 5, without consulting the allowlist. Requires Claude Code v2.1.210 or later * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist * **Availability fallback on Amazon Bedrock and Google Cloud’s Agent Platform** : when your account loses access to a model mid-session, the switch to another model skips excluded models. The startup model checks on [Amazon Bedrock](</docs/en/amazon-bedrock#when-your-organization-enforces-a-model-allowlist>) and [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-your-organization-enforces-a-model-allowlist>) skip excluded models only when managed settings also set `enforceAvailableModels` @@ -691,12 +692,14 @@ Set the auto-compact window +If Claude Code warned about the value of `CLAUDE_CODE_AUTO_COMPACT_WINDOW`, see the variable’s values and warnings. + You can set the auto-compact window in these places: * **For the current model, in this session and later ones** : run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings under the current model in [`modelSettings`](</docs/en/settings-reference#modelsettings>) and applies it to the current session. If a higher-priority [settings scope](</docs/en/settings#settings-precedence>) such as managed settings sets its own window for that model or for every model, the command saves your value but the session keeps that scope’s window, and the command says so. Run `/autocompact auto` to return to the window tuned for your model. Before v2.1.288, the command saved one window for every model, as the top-level `autoCompactWindow`. * **For every model** : set [`autoCompactWindow`](</docs/en/settings-reference#autocompactwindow>) in a settings file, such as `"autoCompactWindow": 200000` in `~/.claude/settings.json`. A window you saved for a model with `/autocompact` takes precedence over this key in the same file for that model. * **For one launch** : pass [`--autocompact`](</docs/en/cli-reference#cli-flags>) when starting Claude Code. The flag overrides your saved setting for that launch without changing it, and `claude --autocompact auto` runs the session at the tuned window even if your saved setting has a value. Unlike `/autocompact`, the flag isn’t preempted by a higher-priority settings scope such as managed settings. - * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). While it’s set, it takes precedence over the command, the flag, and the setting, and `/autocompact` reports the override instead of changing the window. + * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to a token count such as `200000`. Unless Claude Code ignores the value, the variable takes precedence over the command, the flag, and the `autoCompactWindow` setting. `/autocompact` then reports the override without saving. The status line’s `used_percentage` measures against the model’s full context window, so while the variable is set, that percentage doesn’t indicate when compaction will run. * **For one subagent** : see [Set the auto-compact window for one subagent](</docs/en/sub-agents#subagent-auto-compact-window>). The command and the flag accept a window size from 100K to 1M tokens, in any of these forms: @@ -705,7 +708,23 @@ * A `k` or `M` suffix, such as `500k` or `1M` * A bare number from 100 to 1000, meaning thousands, so `200` sets 200,000 -The environment variable accepts only the plain token count. Claude Code caps the window at the model’s context window. +Whichever way you set the window, Claude Code caps it at the model’s context window. + +#### + +​ + +Values and warnings for `CLAUDE_CODE_AUTO_COMPACT_WINDOW` + +A warning that quotes your `CLAUDE_CODE_AUTO_COMPACT_WINDOW` value means the value falls outside 100,000 to 1,000,000 or isn’t a token count. To stop the warning, set a number in that range, such as `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`. On Claude Code v2.1.304 or later, you can also write the number with `k` for thousands or `M` for millions, as in `200k` or `1M`. Find your warning’s wording in the first column, then read across for the window your session uses and what to change: + +Your warning contains| Window the session uses| What to change +---|---|--- +`reads as <N> tokens, so Claude Code treats it as the 100k minimum`| The smaller of 100,000 tokens and your model’s context window| Set at least `100000`, such as `200000`, or `200k` if you meant `200` as thousands +`is too large, so Claude Code treats it as the 1M maximum`| The smaller of 1,000,000 tokens and your model’s context window| You already have the largest window. To stop the warning, set `1M` or `1000000` +`isn't a usable size, so Claude Code ignores it`| The window from `--autocompact`, `/autocompact`, or `autoCompactWindow`, or the default when none is set| Set a number such as `200000`, or unset the variable + +A number with no suffix is read as that many tokens, so `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200` means 200 tokens even though `/autocompact 200` means 200,000. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -729,6 +729,26 @@ Correct the window for a gateway or custom model ID +Either of these startup warnings means Claude Code doesn’t recognize your session’s model ID, so it can’t tell the model’s context window and assumes 200K tokens: + + ⚠ Model "my-gateway-opus" isn't recognized · context assumed to be 200k tokens · ... + Claude Code doesn't recognize the model "my-gateway-opus", so it assumes a context window of 200k tokens. Update Claude Code, or see https://code.claude.com/docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id to set the window. + +Claude Code auto-compacts the conversation at the assumed 200K, so if the model’s real context window is 200K, there is nothing to correct. Otherwise, give Claude Code the real window in whichever of these ways fits your ID: + + * **A model newer than your Claude Code version** : run `claude update` in your shell. If Claude Code recognizes the ID after the update, you don’t need to configure anything else. + * **Your gateway’s or provider’s name for a model Claude Code knows** : add a `modelOverrides` entry that maps the Anthropic model ID to your ID, such as `"claude-opus-4-8": "my-gateway-opus"`. You can instead list your ID in a [`modelPicker`](</docs/en/settings-reference#fields-for-modelpicker>) row with `behavesAs` set to that model. Either way, Claude Code then treats the ID as that model. + * **A model with a 1M window** : append `[1m]` to the ID where you set the model, such as `claude --model 'my-gateway-opus[1m]'` in your shell. If you turned off 1M context, you get the same window with or without the suffix. + * **Any other window** : set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window size in tokens in the environment that starts Claude Code, such as `CLAUDE_CODE_MAX_CONTEXT_TOKENS=400000`. For an unrecognized ID that doesn’t start with `claude-` and has no `[1m]` suffix, the variable takes effect on its own. For any other ID, check which IDs it applies to first. + +Once Claude Code recognizes the ID or uses the window you gave it, the warning no longer appears when you start a session on that ID. + +#### + +​ + +Which IDs `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies to + On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. Set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window Claude Code should assume instead. How the variable applies depends on the ID. Claude Code treats an ID as a provider or custom spelling when it doesn’t start with `claude-`, in any casing, or when it carries a suffix that Claude Code strips when reading the ID, such as the `@YYYYMMDD` date used on Google Cloud’s Agent Platform. Before v2.1.259, Claude Code didn’t count a stripped suffix, so an unrecognized `claude-` ID with a date suffix was treated as a bare `claude-` name. An unrecognized provider or custom spelling, the same spelling with `[1m]`, and every other ID are three separate cases: * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID doesn’t contain `[1m]`, the variable applies directly and proactive compaction continues at the declared window.
modified
--- a/model-config.md +++ b/model-config.md @@ -697,6 +697,7 @@ * **For every model** : set [`autoCompactWindow`](</docs/en/settings-reference#autocompactwindow>) in a settings file, such as `"autoCompactWindow": 200000` in `~/.claude/settings.json`. A window you saved for a model with `/autocompact` takes precedence over this key in the same file for that model. * **For one launch** : pass [`--autocompact`](</docs/en/cli-reference#cli-flags>) when starting Claude Code. The flag overrides your saved setting for that launch without changing it, and `claude --autocompact auto` runs the session at the tuned window even if your saved setting has a value. Unlike `/autocompact`, the flag isn’t preempted by a higher-priority settings scope such as managed settings. * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). While it’s set, it takes precedence over the command, the flag, and the setting, and `/autocompact` reports the override instead of changing the window. + * **For one subagent** : see [Set the auto-compact window for one subagent](</docs/en/sub-agents#subagent-auto-compact-window>). The command and the flag accept a window size from 100K to 1M tokens, in any of these forms:
modified
--- a/model-config.md +++ b/model-config.md @@ -720,6 +720,8 @@ * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. These include the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID +See the [`idleCompaction`](</docs/en/settings-reference#idlecompaction>) setting for when Claude Code also compacts a conversation you leave idle. + ### ​
modified
Show diff (171 lines)
--- a/model-config.md +++ b/model-config.md @@ -34,7 +34,7 @@ **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks **`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5.5 or Sonnet 5 with their native 1M window -**`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions +**`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `opus` already resolves to Opus 4.7 or later with its native 1M window **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution The `opus`, `sonnet`, and `haiku` aliases resolve to the newest version on the Anthropic API and to an earlier version on some other providers: @@ -234,7 +234,7 @@ * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. When the `availableModels` list in your server-managed settings is non-empty and a user picks a model outside it, the server rejects that model for a remote Cowork session. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. - * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. + * Delivery from the admin console also requires the session to fetch with an [eligible login](</docs/en/server-managed-settings#platform-availability>) to your organization or an OAuth token issued for it. For fleets that authenticate with API keys, whether configured directly or generated by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script, deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. @@ -436,13 +436,13 @@ Automatic model fallback -This section covers content-based fallback from Fable models, Opus 5.5, Sonnet 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. For those two categories, the fallback model depends on which model refused: +This section covers content-based fallback from Fable models, Opus 5.5, Sonnet 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. For those two categories, the fallback model depends on which model refused: * **Fable 5.1, Fable 5, and Opus 5.5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. * **Sonnet 5.5** : cybersecurity-flagged requests re-run on Sonnet 5. Biology-flagged requests end with a refusal instead, because Sonnet 5.5 has no biology fallback model. * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. -On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment’s model IDs instead. See Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment’s model IDs instead. See Enable fallback on Bedrock, Agent Platform, and Foundry. When Claude Code switches a flagged request to the fallback model for its category, it re-runs the request on that model. In your main conversation, it shows a notice in the transcript. To be asked first, see Ask before switching. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. #### @@ -471,12 +471,13 @@ Ask before switching -To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off **Switch models when a message is flagged** , or set [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) to `false` in your settings file. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: +To decide what happens each time a request is flagged, run `/config`, select **Switch models when a message is flagged** , and choose **Ask each time**. You can also set [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) to `false` in your settings file. Claude Code then pauses at a flagged request that would switch models and gives you two options: switch to the fallback model, or edit the prompt and retry. The first time a flagged request would switch models in an interactive session, Claude Code may ask whether to switch automatically from then on. It asks only if you haven’t set `switchModelsOnFlag`, and it saves your choice as that key in your user settings. If you choose to stay on the current model instead, the saved value is `false`, the same as **Ask each time**. If you dismiss the question, Claude Code saves nothing and asks again the next time a flagged request would switch models. When you’ve chosen **Ask each time** , some cases behave differently: * When the flagged category has no fallback model, such as a biology flag on Opus 5 or Sonnet 5.5, Claude Code doesn’t show the prompt and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session. * In [cloud sessions](</docs/en/claude-code-on-the-web>) on the mobile app, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. + * In a [subagent](</docs/en/sub-agents>), Claude Code doesn’t show the prompt, and a flagged request that would switch models re-runs on the fallback model. * When the fallback target is blocked by `availableModels`, Claude Code doesn’t show the prompt. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked. #### @@ -497,13 +498,15 @@ * **Every source model** : set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID to turn fallback on and give the flagged categories a target. A pin that names a model outside the Opus family, or the model that refused, leaves the refusal standing. * **Sonnet 5.5** : in addition to the Opus pin, set `ANTHROPIC_DEFAULT_SONNET_MODEL` or keep a Sonnet 5 entry in the provider’s model list to supply the model the request re-runs on. A Sonnet pin that names a model outside the Sonnet family, or Sonnet 5.5 itself, leaves the refusal standing. +The fallback model must also have a context window at least as large as the session’s, or Claude Code doesn’t switch and the flagged request ends with the same refusal. On these providers the source models run with the 1M context window by default. Pin a model that also does, such as Opus 4.8 in `ANTHROPIC_DEFAULT_OPUS_MODEL` or Sonnet 5 in `ANTHROPIC_DEFAULT_SONNET_MODEL`, by an ID Claude Code can match to that model. + #### ​ Security research and biology workloads -Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1, Fable 5, or Opus 5.5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5 and Sonnet 5.5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1, Fable 5, or Opus 5.5, the first flagged request that switches models moves the session to Opus 5, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5 and Sonnet 5.5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -622,7 +625,7 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. To run them with a 200K window instead, see Turn off 1M context. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -630,29 +633,41 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. On the Anthropic API, the 1M context window uses standard model pricing with no premium for tokens beyond 200K, except on Haiku 5.5, which costs more on prompts longer than 100K tokens. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. + +#### + +​ + +Select 1M context for Opus 4.6 or Sonnet 4.6 + +To select a 1M variant by name, append the `[1m]` suffix to a model alias or a full model name: + + # Append [1m] to a full model name + /model claude-opus-4-6[1m] + /model claude-sonnet-4-6[1m] + + # Or to an alias: the suffix applies to the model the alias resolves to + /model opus[1m] + +#### + +​ + +Context window behind an LLM gateway + +If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. + +#### + +​ + +Turn off 1M context + +To keep sessions at a 200K window, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1` in your shell or in a [settings file](</docs/en/env-vars#set-environment-variables>). Claude Code removes the `[1m]` model variants from the model picker. On models that run with the 1M window by default, such as the Fable models, Sonnet 5 and later, and Opus 4.7 and later, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. - -Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K, except on Haiku 5.5, which costs more on prompts longer than 100K tokens. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: - - # Use the opus[1m] or sonnet[1m] alias - /model opus[1m] - /model sonnet[1m] - - # Or append [1m] to a full model name - /model claude-opus-4-8[1m] - -#### - -​ - -Sonnet 5.5 and Sonnet 5 context window - -On the Anthropic API, Sonnet 5.5 and Sonnet 5 always run with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Claude Code gives Sonnet 5.5 and Sonnet 5 the same 1M window behind an [LLM gateway](</docs/en/llm-gateway>) or another custom `ANTHROPIC_BASE_URL`. If your gateway enforces a lower limit, see the context window behind a gateway. This setting budgets the window at 200K instead: - - * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : holds sessions on every model with a native 1M window to a 200K window; see Extended context for how the hold is enforced. Useful for deployments that need to cap context. #### @@ -700,9 +715,9 @@ If you don’t set an auto-compact window, Claude Code compacts when the conversation reaches the model’s context limit, except in these sessions: * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit - * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and later when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry + * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. On the Anthropic API, these include Sonnet 5, Haiku 5.5, the Fable models, and Opus 4.7 and later. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, see Pin models for third-party deployments for which models run with that window. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway + * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. These include the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID ### @@ -785,15 +800,15 @@ Google Cloud’s Agent Platform| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Microsoft Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, or `ANTHROPIC_DEFAULT_FABLE_MODEL`: - - export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' +Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. A pinned model with a native 1M window, such as Opus 4.8 or Sonnet 5, runs with the 1M context window without any suffix when Claude Code can match the pinned ID to that model. The ID matches when it contains the model’s Anthropic API ID, as `us.anthropic.claude-opus-4-8` contains `claude-opus-4-8`, or when a `modelOverrides` entry maps the model to it. On a pinned ID that Claude Code can’t match to a model, sessions run with a 200K window by default unless the ID carries the `[1m]` suffix. For a model that reaches 1M through its `[1m]` variant, such as Opus 4.6 or Sonnet 4.6, enable extended context by appending `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: + + export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]' With the `[1m]` suffix, the 1M context window applies to all usage of the pinned alias, including the plan-mode Opus phase of `opusplan` and [subagents](</docs/en/sub-agents#choose-a-model>) whose `model` frontmatter names the alias. * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). - * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. + * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, an Opus 4.6 or Sonnet 4.6 ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. When you set an `ANTHROPIC_DEFAULT_*_MODEL` variable, the `/model` picker shows one row for that model in place of the family’s built-in rows, including any 1M context rows. To reach the 1M window without adding the suffix to that variable, your users run `/model opus[1m]`, and Claude Code applies the suffix to the model the variable names. `/model sonnet[1m]` works the same way.
modified
Show diff (175 lines)
--- a/model-config.md +++ b/model-config.md @@ -37,18 +37,18 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -The version that the `opus` and `sonnet` aliases resolve to depends on the provider: - -Provider| `opus`| `sonnet` ----|---|--- -Anthropic API| Opus 5.5| Sonnet 5.5 -[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6 -Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5 -Microsoft Foundry| Opus 4.6| Sonnet 4.5 - -Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. +The `opus`, `sonnet`, and `haiku` aliases resolve to the newest version on the Anthropic API and to an earlier version on some other providers: + +Provider| `opus`| `sonnet`| `haiku` +---|---|---|--- +Anthropic API| Opus 5.5| Sonnet 5.5| Haiku 5.5 +[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6| Haiku 4.5 +Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5| Haiku 4.5 +Microsoft Foundry| Opus 4.6| Sonnet 4.5| Haiku 4.5 + +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where `opus` or `sonnet` resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Use v2.1.293 or later with Haiku 5.5. Run `claude update` to upgrade. ### @@ -116,7 +116,7 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. If your `model` setting is `haiku`, a session saved on a Haiku model resumes on the model that `haiku` resolves to now. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. @@ -450,13 +450,12 @@ Effort level after a fallback -When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at in place of that model’s default effort. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: - - * **Settings or organization default** : a level in your settings that applies to the fallback model, or a default effort your organization set for it, applies instead. +When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: + * **Your own change** : once you choose an effort level, pick a model in `/model`, or resume the session later, the flagged request’s level no longer carries over. * **Skill effort** : a level that a skill’s `effort` frontmatter set for the flagged request applies to that turn, and later turns run at the level the effort resolution order gives the fallback model. -The session header shows the level in effect next to the model name. To change it, run `/effort` in the session. +In the session, run `/effort status` to see the level in effect, or `/effort` to change it. #### @@ -517,16 +516,16 @@ Model| Levels ---|--- Fable 5.1 and Fable 5| `low`, `medium`, `high`, `xhigh`, `max` -Opus 5.5, Sonnet 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization or your own settings can also cap the levels a model offers; see Organization effort limits. Claude Code resolves the session’s effort level in this order, taking the first that applies: 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) 2. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) - 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 and Sonnet 5.5 default to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model. After an automatic model fallback, see Effort level after a fallback for the level that applies. - -Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: + 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model + +After an automatic model fallback, see Effort level after a fallback for the level that applies. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: * `Enter` in the `/effort` slider or the `/model` picker, or a level typed after `/effort`: save the level as your default and apply it in later sessions * `s` in the `/effort` slider or the `/model` picker: apply the level to this session only. Requires Claude Code v2.1.257 or later @@ -559,8 +558,8 @@ Level| When to use it ---|--- `low`| Quick exchanges where you review each result, such as brainstorming, a first sketch, or a small change like a rename -`medium`| The default on Opus 5.5 and Sonnet 5.5, where it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On other models, reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on every model except Opus 5.5, Sonnet 5.5, and Opus 4.7 +`medium`| The default on Opus 5.5, Sonnet 5.5, and Haiku 5.5. On Opus 5.5 and Sonnet 5.5, it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On models with a higher default, reduces token usage for cost-sensitive work that can trade off some intelligence +`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on every model except Opus 5.5, Sonnet 5.5, Haiku 5.5, and Opus 4.7 `xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 `max`| Hard problems you want Claude to work through without you, such as finding security vulnerabilities. `max` may show diminishing returns and is prone to overthinking, so test before adopting it broadly `ultracode`| A Claude Code setting rather than a level: plans a [dynamic workflow](</docs/en/workflows>) for each substantive task at any effort level @@ -599,7 +598,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5 and later, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -613,9 +612,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think - -You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think + +You can’t turn thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -623,7 +622,7 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5 and later, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -631,12 +630,12 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. -Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: +Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K, except on Haiku 5.5, which costs more on prompts longer than 100K tokens. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -654,6 +653,14 @@ On the Anthropic API, Sonnet 5.5 and Sonnet 5 always run with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Claude Code gives Sonnet 5.5 and Sonnet 5 the same 1M window behind an [LLM gateway](</docs/en/llm-gateway>) or another custom `ANTHROPIC_BASE_URL`. If your gateway enforces a lower limit, see the context window behind a gateway. This setting budgets the window at 200K instead: * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : holds sessions on every model with a native 1M window to a 200K window; see Extended context for how the hold is enforced. Useful for deployments that need to cap context. + +#### + +​ + +Haiku 5.5 context window and pricing + +On the Anthropic API, Haiku 5.5 runs with the 1M context window on every plan, with no `[1m]` suffix to select. Its model ID is `claude-haiku-5-5`. To use it, run `/model claude-haiku-5-5` in a session, or start Claude Code from your shell with `claude --model claude-haiku-5-5`. A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](<https://platform.claude.com/docs/en/about-claude/pricing>) for both rates. Sessions auto-compact at about 967K tokens by default. To compact earlier, set a smaller auto-compact window for the model. ## @@ -695,7 +702,7 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and later when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. On the Anthropic API, these include Sonnet 5, the Fable models, and Opus 4.7 and later. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, see Pin models for third-party deployments for which models run with that window. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway + * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. On the Anthropic API, these include Sonnet 5, Haiku 5.5, the Fable models, and Opus 4.7 and later. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, see Pin models for third-party deployments for which models run with that window. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID ### @@ -875,6 +882,7 @@ Version| Change ---|--- +v2.1.293| `haiku` resolves to Haiku 5.5 on the Anthropic API v2.1.284| `sonnet` resolves to Sonnet 5.5 on the Anthropic API v2.1.280| `opus` resolves to Opus 5.5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform v2.1.257| `fable` resolves to Fable 5.1, except in Claude apps gateway sessions @@ -882,4 +890,4 @@ v2.1.207| `opus` resolves to Opus 4.8 on Claude Platform on AWS, Amazon Bedrock, and Agent Platform v2.1.197| `sonnet` resolves to Sonnet 5 on the Anthropic API v2.1.154| `opus` resolves to Opus 4.8 on the Anthropic API -Earlier| `opus` resolves to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Agent Platform. `fable` resolves to Fable 5 on every provider +Earlier| `opus` resolves to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Agent Platform. `fable` resolves to Fable 5 and `haiku` resolves to Haiku 4.5 on every provider
modified
--- a/model-config.md +++ b/model-config.md @@ -211,6 +211,7 @@ * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on a Fable model. On providers other than the Anthropic API, that Opus fallback runs on the model you set in `ANTHROPIC_DEFAULT_OPUS_MODEL` or otherwise on Opus 5, without consulting the allowlist. Requires Claude Code v2.1.210 or later * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist + * **Availability fallback on Amazon Bedrock and Google Cloud’s Agent Platform** : when your account loses access to a model mid-session, the switch to another model skips excluded models. The startup model checks on [Amazon Bedrock](</docs/en/amazon-bedrock#when-your-organization-enforces-a-model-allowlist>) and [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-your-organization-enforces-a-model-allowlist>) skip excluded models only when managed settings also set `enforceAvailableModels` { "availableModels": ["sonnet", "haiku"] @@ -612,7 +613,7 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted.
modified
--- a/model-config.md +++ b/model-config.md @@ -199,7 +199,12 @@ * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting -Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row, unless Claude Code replaces the built-in options with a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: +Claude Code hides excluded models from the `/model` picker. Whether a model ID you list also gets a row of its own differs by provider: + + * **Anthropic API,[Claude Platform on AWS](</docs/en/claude-platform-on-aws>), [Claude apps gateway](</docs/en/claude-apps-gateway>), or an [LLM gateway](</docs/en/llm-gateway>) set through `ANTHROPIC_BASE_URL`**: an Anthropic model ID you list that has no built-in picker row appears as its own labeled row. Claude Code adds such a row for Opus, Sonnet, and Haiku versions, such as an older version that the list pins. If you set `replaceBuiltInOptions` in a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, that row doesn’t appear. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. + * **Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry** : unless a model ID you list starts with `anthropic.`, Claude Code doesn’t add a row for it, whether it’s an Anthropic model ID or a provider-specific one. Mantle model IDs carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, which accepts IDs in your provider’s format. + +Model changes that Claude Code makes on your behalf are checked the same way: * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model @@ -296,7 +301,7 @@ Mantle model IDs -When the [Amazon Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. +Entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options. This is an exception to the alias matching described in Pin models for third-party deployments. With the [Amazon Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) enabled, Claude Code routes the entries that match the Mantle format to that endpoint. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. ### @@ -625,7 +630,7 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, run `/autocompact 200k` so sessions compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. @@ -663,9 +668,10 @@ Set the auto-compact window -You can set the auto-compact window in three places: - - * **For this session and later ones** : run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings as [`autoCompactWindow`](</docs/en/settings-reference#autocompactwindow>) and applies it to the current session; if a higher-priority [settings scope](</docs/en/settings#settings-precedence>) such as managed settings sets the key, the command saves your value but the session keeps that scope’s window, and the command says so. Run `/autocompact auto` to return to the window tuned for your model. +You can set the auto-compact window in these places: + + * **For the current model, in this session and later ones** : run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings under the current model in [`modelSettings`](</docs/en/settings-reference#modelsettings>) and applies it to the current session. If a higher-priority [settings scope](</docs/en/settings#settings-precedence>) such as managed settings sets its own window for that model or for every model, the command saves your value but the session keeps that scope’s window, and the command says so. Run `/autocompact auto` to return to the window tuned for your model. Before v2.1.288, the command saved one window for every model, as the top-level `autoCompactWindow`. + * **For every model** : set [`autoCompactWindow`](</docs/en/settings-reference#autocompactwindow>) in a settings file, such as `"autoCompactWindow": 200000` in `~/.claude/settings.json`. A window you saved for a model with `/autocompact` takes precedence over this key in the same file for that model. * **For one launch** : pass [`--autocompact`](</docs/en/cli-reference#cli-flags>) when starting Claude Code. The flag overrides your saved setting for that launch without changing it, and `claude --autocompact auto` runs the session at the tuned window even if your saved setting has a value. Unlike `/autocompact`, the flag isn’t preempted by a higher-priority settings scope such as managed settings. * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). While it’s set, it takes precedence over the command, the flag, and the setting, and `/autocompact` reports the override instead of changing the window.
modified
--- a/model-config.md +++ b/model-config.md @@ -204,7 +204,7 @@ * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead - * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on a Fable model. On providers other than the Anthropic API, that Opus fallback runs on the provider’s default Opus model without consulting the allowlist. Requires Claude Code v2.1.210 or later + * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on a Fable model. On providers other than the Anthropic API, that Opus fallback runs on the model you set in `ANTHROPIC_DEFAULT_OPUS_MODEL` or otherwise on Opus 5, without consulting the allowlist. Requires Claude Code v2.1.210 or later * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist { @@ -351,7 +351,7 @@ * a `model` value in [managed settings](</docs/en/managed-settings>) or supplied through `--settings` * a `model` value in your user, project, or local settings, including a model you save with `/model` -Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. Override is available to a limited set of organizations; ask your Anthropic account team about availability. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: +Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: * With the default prefix matching, `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry as well * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted @@ -437,6 +437,20 @@ * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment’s model IDs instead. See Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. + +#### + +​ + +Effort level after a fallback + +When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at in place of that model’s default effort. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: + + * **Settings or organization default** : a level in your settings that applies to the fallback model, or a default effort your organization set for it, applies instead. + * **Your own change** : once you choose an effort level, pick a model in `/model`, or resume the session later, the flagged request’s level no longer carries over. + * **Skill effort** : a level that a skill’s `effort` frontmatter set for the flagged request applies to that turn, and later turns run at the level the effort resolution order gives the fallback model. + +The session header shows the level in effect next to the model name. To change it, run `/effort` in the session. #### @@ -504,7 +518,7 @@ 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) 2. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) - 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 and Sonnet 5.5 default to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model + 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 and Sonnet 5.5 default to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model. After an automatic model fallback, see Effort level after a fallback for the level that applies. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it:
modified
--- a/model-config.md +++ b/model-config.md @@ -33,7 +33,7 @@ **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks -**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5.5 or Sonnet 5 with their native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for that model +**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5.5 or Sonnet 5 with their native 1M window **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution @@ -407,7 +407,7 @@ Fallback model chains -When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors, and a [denial by your organization’s policy check](</docs/en/errors#automatic-retries>), never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: +When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors, and a [denial by your organization’s policy check](</docs/en/errors#automatic-retries>), never trigger a switch; those follow their normal retry and error handling. It does switch when [Amazon Bedrock](</docs/en/amazon-bedrock#when-a-model-is-disabled-mid-session>) or [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-a-model-is-disabled-mid-session>) refuses a model your account can’t invoke, which Claude Code treats as the model being unavailable rather than as an authentication error. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: claude --fallback-model sonnet,haiku @@ -611,7 +611,7 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, run `/autocompact 200k` so sessions compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. @@ -631,9 +631,8 @@ Sonnet 5.5 and Sonnet 5 context window -On the Anthropic API, Sonnet 5.5 and Sonnet 5 always run with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead: - - * **LLM gateway** : when `ANTHROPIC_BASE_URL` points at a [gateway](</docs/en/llm-gateway>), Claude Code can’t verify 1M support. To use the full window, select Sonnet 5.5 (1M context) in the model picker, which maps to `sonnet[1m]`, or run `/model claude-sonnet-5[1m]` for Sonnet 5. +On the Anthropic API, Sonnet 5.5 and Sonnet 5 always run with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Claude Code gives Sonnet 5.5 and Sonnet 5 the same 1M window behind an [LLM gateway](</docs/en/llm-gateway>) or another custom `ANTHROPIC_BASE_URL`. If your gateway enforces a lower limit, see the context window behind a gateway. This setting budgets the window at 200K instead: + * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : holds sessions on every model with a native 1M window to a 200K window; see Extended context for how the hold is enforced. Useful for deployments that need to cap context. ## @@ -675,7 +674,7 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and later when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Models running with a native 1M window, such as Sonnet 5, the Fable models, and Opus 4.7 and later on the Anthropic API, compact before the window fills, at about 967K tokens by default. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Pin models for third-party deployments says which models run with that window; for the configurations that budget Sonnet 5.5 and Sonnet 5 at 200K instead, see Sonnet 5.5 and Sonnet 5 context window + * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. On the Anthropic API, these include Sonnet 5, the Fable models, and Opus 4.7 and later. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, see Pin models for third-party deployments for which models run with that window. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID ###
modified
Show diff (112 lines)
--- a/model-config.md +++ b/model-config.md @@ -48,7 +48,7 @@ Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. -Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. Run `claude update` to upgrade. +Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. ### @@ -80,7 +80,7 @@ Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code shows a consent prompt before a Fable request bills usage credits. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: - * In the `/model` picker, you keep your current model. + * When you select a Fable model with `/model`, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. After you choose to continue on Fable using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: @@ -89,7 +89,7 @@ * In a background session, answer before the deadline. * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it. -In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable request there would bill to usage credits, Claude Code bills it without asking. +In a session another application hosts through the [Agent SDK](</docs/en/agent-sdk/overview>), whether the prompt appears is up to that application. If it appears and nobody answers before the same [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, Claude Code ends the turn without sending the request. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking. ### @@ -116,14 +116,12 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: - - * a model alias - * an entry from the `/model` picker - * any name that starts with `claude-` - * a value you configured yourself as a custom model option or in `modelOverrides` - -Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. Claude Code can still write the [unrecognized-model diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) at request time, on every provider. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: + + * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. + * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. + +See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t check it up front, and a mistyped value produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: claude --model opus @@ -181,7 +179,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -223,12 +221,12 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- -[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Enforced| Not delivered +[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Enforced| Remote Cowork sessions: the server checks the model. On the user’s machine: not delivered. [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. - * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. + * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. When the `availableModels` list in your server-managed settings is non-empty and a user picks a model outside it, the server rejects that model for a remote Cowork session. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). @@ -597,7 +595,7 @@ Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget -You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -618,7 +616,7 @@ * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. -Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: +Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -769,6 +767,8 @@ * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. + +When you set an `ANTHROPIC_DEFAULT_*_MODEL` variable, the `/model` picker shows one row for that model in place of the family’s built-in rows, including any 1M context rows. To reach the 1M window without adding the suffix to that variable, your users run `/model opus[1m]`, and Claude Code applies the suffix to the model the variable names. `/model sonnet[1m]` works the same way. An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list its full provider-form ID, or map it through `modelOverrides`. For a pinned model, that ID is the value you set in its `ANTHROPIC_DEFAULT_*_MODEL` variable. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. @@ -839,8 +839,8 @@ ---|--- `DISABLE_PROMPT_CACHING`| Set to `1` to disable prompt caching for all models. Takes precedence over the per-model settings `DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for the [default Haiku model](</docs/en/prompt-caching#disable-prompt-caching>) -`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models only -`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only +`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for the [default Sonnet model](</docs/en/prompt-caching#disable-prompt-caching>) +`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for the [default Opus model](</docs/en/prompt-caching#disable-prompt-caching>) `DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only To choose the cache TTL for the main conversation and for subagents separately, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). For what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
modified
Show diff (280 lines)
--- a/model-config.md +++ b/model-config.md @@ -33,7 +33,7 @@ **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks -**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5 with its native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for Sonnet 5 +**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5.5 or Sonnet 5 with their native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for that model **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution @@ -41,14 +41,14 @@ Provider| `opus`| `sonnet` ---|---|--- -Anthropic API| Opus 5.5| Sonnet 5 +Anthropic API| Opus 5.5| Sonnet 5.5 [Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6 Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5 -Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. Before v2.1.257, `fable` resolved to Fable 5 on every provider. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.280, `opus` resolved to Opus 5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Opus 5.5 requires Claude Code v2.1.280 or later. Opus 5 requires v2.1.219 or later. Sonnet 5 requires v2.1.197 or later. Run `claude update` to upgrade. +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. Run `claude update` to upgrade. ### @@ -110,7 +110,13 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only and leave your default unchanged. To use a different key, rebind [`modelPicker:thisSessionOnly`](</docs/en/keybindings#model-picker-actions>) -Typing `/model <name>` directly behaves like `Enter`. To switch for this session only, open the picker with `/model` and press `s` on the model’s row. If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. To switch for this session only, open the picker with `/model` and press `s` on the model’s row. On an Enterprise plan, when you’re logged in with your claude.ai account and save a default with `/model`, Claude Code also records the choice on that account. This requires Claude Code v2.1.280 or later. + + * When your admin hasn’t set an organization default model, the Default option can resolve to the recorded model, and when it does, the picker’s Default row shows that model’s name. + * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. + * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. + +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -217,10 +223,11 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- -[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered +[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Enforced| Not delivered [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed - * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a user’s request to start a cloud session on a model the list excludes. + * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. + * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. @@ -248,7 +255,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys together in the highest-ranked managed source you deliver. By default Claude Code reads only that source, so a pair placed in a managed settings file is ignored when the admin console delivers any settings; under the opt-in merge in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code still ignores a `modelOverrides` map from a source ranked below the one that sets `availableModels`. +For a member with no model recorded on their account, the Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. A model recorded on a member’s account is checked against `availableModels` too; Setting your model describes how the Default option treats it. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys together in the highest-ranked managed source you deliver. By default Claude Code reads only that source, so a pair placed in a managed settings file is ignored when the admin console delivers any settings; under the opt-in merge in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code still ignores a `modelOverrides` map from a source ranked below the one that sets `availableModels`. ### @@ -381,7 +388,7 @@ * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. +Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. ### @@ -425,12 +432,13 @@ Automatic model fallback -This section covers content-based fallback from Fable models, Opus 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. For those two categories, the fallback model depends on which model refused: +This section covers content-based fallback from Fable models, Opus 5.5, Sonnet 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. For those two categories, the fallback model depends on which model refused: * **Fable 5.1, Fable 5, and Opus 5.5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. + * **Sonnet 5.5** : cybersecurity-flagged requests re-run on Sonnet 5. Biology-flagged requests end with a refusal instead, because Sonnet 5.5 has no biology fallback model. * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. -On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment instead, and if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, categories that have a fallback re-run on the pinned model; see Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment’s model IDs instead. See Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. #### @@ -448,7 +456,7 @@ To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off **Switch models when a message is flagged** , or set [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) to `false` in your settings file. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: - * When the flagged category has no fallback model, such as a biology flag on Opus 5, Claude Code doesn’t show the prompt and the request ends with the refusal. + * When the flagged category has no fallback model, such as a biology flag on Opus 5 or Sonnet 5.5, Claude Code doesn’t show the prompt and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session. * In [cloud sessions](</docs/en/claude-code-on-the-web>) on the mobile app, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. @@ -460,12 +468,17 @@ Enable fallback on Bedrock, Agent Platform, and Foundry -On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: - - * Claude Code must recognize the current model as a fallback source. Fable 5.1 and Fable 5 are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5 and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping. - * The fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on an Opus 4.8 entry in the provider’s model list, and biology-flagged requests from a Fable model or Opus 5.5 on an Opus 5 entry. - -If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. Setting `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID enables Fable recognition. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID gives the flagged categories a fallback target, unless the pin names a model outside the Opus family or the model that refused; then Claude Code doesn’t switch and the refusal stands. +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify each model involved: + + * Claude Code must recognize the current model as a fallback source. Fable 5.1 and Fable 5 are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5, Sonnet 5.5, and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping. + * An Opus target must resolve in your deployment, whichever model refused: set `ANTHROPIC_DEFAULT_OPUS_MODEL`, or keep an Opus 4.8 entry in the provider’s model list. Without one, fallback stays off for every source model, including Sonnet 5.5, and flagged requests end with a refusal. + * The flagged category’s fallback model must resolve in your deployment. From a Fable model, Opus 5.5, or Opus 5, if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on the Opus 4.8 entry, and biology-flagged requests from a Fable model or Opus 5.5 on an Opus 5 entry. From Sonnet 5.5, cybersecurity-flagged requests re-run on the model you set in `ANTHROPIC_DEFAULT_SONNET_MODEL`, or on a Sonnet 5 entry in the provider’s model list if you don’t set it. + +If either model can’t be identified, Claude Code doesn’t switch. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. To make both models identifiable, set the pins for your source model: + + * **Fable models** : set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID so Claude Code recognizes it as a fallback source. + * **Every source model** : set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID to turn fallback on and give the flagged categories a target. A pin that names a model outside the Opus family, or the model that refused, leaves the refusal standing. + * **Sonnet 5.5** : in addition to the Opus pin, set `ANTHROPIC_DEFAULT_SONNET_MODEL` or keep a Sonnet 5 entry in the provider’s model list to supply the model the request re-runs on. A Sonnet pin that names a model outside the Sonnet family, or Sonnet 5.5 itself, leaves the refusal standing. #### @@ -473,7 +486,7 @@ Security research and biology workloads -Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1, Fable 5, or Opus 5.5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1, Fable 5, or Opus 5.5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5 and Sonnet 5.5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -486,14 +499,14 @@ Model| Levels ---|--- Fable 5.1 and Fable 5| `low`, `medium`, `high`, `xhigh`, `max` -Opus 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 5.5, Sonnet 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization or your own settings can also cap the levels a model offers; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies: +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization or your own settings can also cap the levels a model offers; see Organization effort limits. Claude Code resolves the session’s effort level in this order, taking the first that applies: 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) 2. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) - 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 defaults to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model + 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 and Sonnet 5.5 default to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: @@ -504,18 +517,16 @@ A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. -When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only and doesn’t save it as your default. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: - - * **`/effort`** : run `/effort ultracode`, or select it from the menu +When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only and doesn’t save it as your default. The `/effort` slider also has an **Ultracode** toggle. Ultracode is a Claude Code setting rather than a model effort level: with it on, Claude orchestrates [dynamic workflows](</docs/en/workflows>) for substantive tasks, at whichever effort level the session runs at. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. Turning ultracode on or off with `/effort` or the `ultracode` setting leaves the effort level unchanged. The `--effort ultracode` flag and the Agent SDK `effortLevel: "ultracode"` value turn it on and also set the level to `xhigh`. Picking a level in the `/effort` slider or the `/model` picker leaves ultracode as it was. You can turn on ultracode through any of the following: + + * **`/effort`** : run `/effort ultracode` to turn it on for the current session or `/effort ultracode off` to turn it off. In the `/effort` slider, press `Tab` to flip the **Ultracode** toggle, then `Enter` to apply it * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on - * **`ultracode` setting**: set [`"ultracode": true`](</docs/en/settings-reference#ultracode>) in a settings file, with `--settings`, or in an Agent SDK control request. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` - * **`/model` picker**: move the effort slider to `ultracode` with the arrow keys while you choose a model. Claude Code turns it on for the current session, even when you save that model as your default - -Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. Ultracode is unavailable when: + * **`ultracode` setting**: set [`"ultracode": true`](</docs/en/settings-reference#ultracode>) in a settings file, with `--settings`, or in an Agent SDK control request. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"`, which turns it on and sets the effort level to `xhigh` + +The `/effort ultracode off` form, the slider toggle, and keeping ultracode on at effort levels other than `xhigh` require Claude Code v2.1.284 or later. Before v2.1.284, turning on ultracode set the session to `xhigh` effort, picking another level turned it off, and an effort cap below `xhigh` made it unavailable. Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. If `CLAUDE_CODE_EFFORT_LEVEL` or an effort cap sets the session’s level, ultracode stays on at that level. Ultracode is unavailable when: * [Workflows are turned off](</docs/en/workflows#turn-workflows-off>) * The model doesn’t support `xhigh` effort - * An effort cap below `xhigh` applies to the model In those cases `--effort ultracode` starts the session with ultracode off, at the highest effort level the model and any cap allow, up to `xhigh`. @@ -529,14 +540,14 @@ Level| When to use it ---|--- -`low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive -`medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence. The default on Opus 5.5 -`high`| Balances token usage and intelligence. The default on every model except Opus 5.5 and Opus 4.7 +`low`| Quick exchanges where you review each result, such as brainstorming, a first sketch, or a small change like a rename +`medium`| The default on Opus 5.5 and Sonnet 5.5, where it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On other models, reduces token usage for cost-sensitive work that can trade off some intelligence +`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on every model except Opus 5.5, Sonnet 5.5, and Opus 4.7 `xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 -`max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly -`ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning - -The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. Opus 5.5 defaults to `medium`, one level below Opus 5’s default of `high`. In Anthropic’s testing, Opus 5.5 at `medium` matches or exceeds Opus 5 at `high` on coding and knowledge-work evaluations. At a given level, Opus 5.5 tends to think more per turn than Opus 5. When you move from Opus 5 to Opus 5.5, start at `medium` rather than carrying over the level you used on Opus 5. To test levels against your own work, see [Calibrate effort](<https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#calibrate-effort>) in the Opus 5.5 prompting guide. +`max`| Hard problems you want Claude to work through without you, such as finding security vulnerabilities. `max` may show diminishing returns and is prone to overthinking, so test before adopting it broadly +`ultracode`| A Claude Code setting rather than a level: plans a [dynamic workflow](</docs/en/workflows>) for each substantive task at any effort level + +In tests on Opus 5.5 and Fable 5.1, Claude at a higher level tested more edge cases and verified more of its work before answering. It also made more choices on its own. At a lower level, Claude returned a starting point sooner, which fits work where you review each result and steer the next step. To see the same tasks run at each level, read [Using Claude Code: Spending your effort](<https://claude.dev/blog/spending-your-effort/>) on the blog. The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. Opus 5.5 defaults to `medium`, one level below Opus 5’s default of `high`. In Anthropic’s testing, Opus 5.5 at `medium` matches or exceeds Opus 5 at `high` on coding and knowledge-work evaluations. At a given level, Opus 5.5 tends to think more per turn than Opus 5. When you move from Opus 5 to Opus 5.5, start at `medium` rather than carrying over the level you used on Opus 5. To test levels against your own work, see [Calibrate effort](<https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#calibrate-effort>) in the Opus 5.5 prompting guide. #### @@ -570,7 +581,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5 and later, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -584,9 +595,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5 and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget - -You can’t turn thinking off on Opus 5.5 or the Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget + +You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -594,7 +605,7 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5.1, Fable 5, Sonnet 5 and later, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -620,11 +631,11 @@ ​ -Sonnet 5 context window - -On the Anthropic API, Sonnet 5 always runs with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead: - - * **LLM gateway** : when `ANTHROPIC_BASE_URL` points at a [gateway](</docs/en/llm-gateway>), Claude Code can’t verify 1M support. To use the full window, select Sonnet 5 (1M context) in the model picker, which maps to `sonnet[1m]`. +Sonnet 5.5 and Sonnet 5 context window + +On the Anthropic API, Sonnet 5.5 and Sonnet 5 always run with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead: + + * **LLM gateway** : when `ANTHROPIC_BASE_URL` points at a [gateway](</docs/en/llm-gateway>), Claude Code can’t verify 1M support. To use the full window, select Sonnet 5.5 (1M context) in the model picker, which maps to `sonnet[1m]`, or run `/model claude-sonnet-5[1m]` for Sonnet 5. * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : holds sessions on every model with a native 1M window to a 200K window; see Extended context for how the hold is enforced. Useful for deployments that need to cap context. ## @@ -666,7 +677,7 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and later when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Models running with a native 1M window, such as Sonnet 5, the Fable models, and Opus 4.7 and later on the Anthropic API, compact before the window fills, at about 967K tokens by default. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Pin models for third-party deployments says which models run with that window; for the configurations that budget Sonnet 5 at 200K instead, see Sonnet 5 context window + * Models running with a native 1M window, such as Sonnet 5, the Fable models, and Opus 4.7 and later on the Anthropic API, compact before the window fills, at about 967K tokens by default. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Pin models for third-party deployments says which models run with that window; for the configurations that budget Sonnet 5.5 and Sonnet 5 at 200K instead, see Sonnet 5.5 and Sonnet 5 context window * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID ### @@ -833,3 +844,22 @@ `DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only To choose the cache TTL for the main conversation and for subagents separately, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). For what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>). + +## + +​ + +Version history + +This table lists the Claude Code version at which each model alias changed the model it resolves to, newest first. + +Version| Change +---|--- +v2.1.284| `sonnet` resolves to Sonnet 5.5 on the Anthropic API +v2.1.280| `opus` resolves to Opus 5.5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform +v2.1.257| `fable` resolves to Fable 5.1, except in Claude apps gateway sessions +v2.1.219| `opus` resolves to Opus 5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Agent Platform +v2.1.207| `opus` resolves to Opus 4.8 on Claude Platform on AWS, Amazon Bedrock, and Agent Platform +v2.1.197| `sonnet` resolves to Sonnet 5 on the Anthropic API +v2.1.154| `opus` resolves to Opus 4.8 on the Anthropic API +Earlier| `opus` resolves to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Agent Platform. `fable` resolves to Fable 5 on every provider
modified
Show diff (122 lines)
--- a/model-config.md +++ b/model-config.md @@ -151,7 +151,7 @@ * You set it to `default`, `inherit`, `opusplan`, or `haiku` * `enforceAvailableModels` is on - * `availableModels` or organization model restrictions exclude the model + * Your organization’s model restrictions exclude the model * The model isn’t available to your account When a new session would start on the variable’s model, a session you resume with `claude --resume`, `--continue`, or the `/resume` picker starts on it too. Claude Code doesn’t restore the model saved in that session’s transcript. Otherwise Claude Code doesn’t use the variable when you resume a session. @@ -175,7 +175,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -233,7 +233,7 @@ Default model behavior -On its own, `availableModels` leaves the Default option on the system’s runtime default for the account until you also set `enforceAvailableModels`. If that default is a model you intend to restrict, set `enforceAvailableModels` as well. An empty `availableModels` array never engages the Default-model enforcement: with `availableModels: []`, named model selections are blocked but the Default model for the account type remains usable regardless of `enforceAvailableModels`. +With the default prefix matching, `availableModels` on its own leaves the Default option on the system’s runtime default for the account until you also set `enforceAvailableModels`. If that default is a model you intend to restrict, set `enforceAvailableModels` as well, or block that model. With `availableModels: []`, named model selections are blocked and `enforceAvailableModels` has no effect. ### @@ -248,7 +248,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. With `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys together in the highest-ranked managed source you deliver. By default Claude Code reads only that source, so a pair placed in a managed settings file is ignored when the admin console delivers any settings; under the opt-in merge in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code still ignores a `modelOverrides` map from a source ranked below the one that sets `availableModels`. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys together in the highest-ranked managed source you deliver. By default Claude Code reads only that source, so a pair placed in a managed settings file is ignored when the admin console delivers any settings; under the opt-in merge in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code still ignores a `modelOverrides` map from a source ranked below the one that sets `availableModels`. ### @@ -256,10 +256,11 @@ Control the model users run on -The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system’s runtime default regardless of what `model` is set to, unless `enforceAvailableModels` redirects it. To fully control the model experience, combine these settings: +The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system’s runtime default regardless of what `model` is set to, unless `enforceAvailableModels` or the keys that block specific versions apply to it. To fully control the model experience, combine these settings: * **`availableModels`** : restricts which named models users can switch to * **`enforceAvailableModels`** : extends the `availableModels` allowlist to the Default option, so Default cannot resolve to a model outside the list + * **`deniedModels`** and **`availableModelsMatch`** : block specific versions that an `availableModels` entry would otherwise permit * **`model`** : sets the initial model selection when a session starts * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to, and which version the account-type default uses @@ -296,6 +297,32 @@ ​ +Block specific models or versions + +An `availableModels` entry such as `claude-opus-5` also permits later releases that extend it, such as Opus 5.5, as soon as Claude Code supports them. Two managed settings let you hold a release back, and both require Claude Code v2.1.283 or later: + + * [`deniedModels`](</docs/en/settings-reference#deniedmodels>): list the models to block. A listed model is blocked even when `availableModels` permits it, and the key also works with no allowlist at all. A release that no entry blocks stays permitted + * [`availableModelsMatch`](</docs/en/settings-reference#availablemodelsmatch>): set it to `"exact"` so that each model ID in `availableModels` permits only the version it names. A newer version of a listed model ID then stays blocked until you add it to the list + +Earlier versions ignore both keys, so also set [`requiredMinimumVersion`](</docs/en/settings-reference#requiredminimumversion>) to keep those versions from starting. This example permits Opus and Sonnet models and blocks Opus 5.5 in every spelling, including dated and provider-specific IDs: + + { + "availableModels": ["opus", "sonnet"], + "deniedModels": ["claude-opus-5-5"] + } + +A blocked model, whether `deniedModels` names it or an `"exact"` list omits it, is treated as a blocked selection everywhere the allowlist applies. It is hidden from the `/model` picker, and `/model <name>` rejects it. If you name a blocked model ID with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, Claude Code drops it at startup and resolves the Default option instead. If a [hook](</docs/en/hooks>) or background request names a model that `deniedModels` blocks, such as an agent hook’s `model` field, that request runs on the session’s model instead. The Default option follows both keys too, whether or not you set `enforceAvailableModels`. If you set it with a non-empty `availableModels`, a blocked default counts as a model outside the allowlist. Otherwise, a Default option that would resolve to a blocked model steps down in this order: + + 1. The newest permitted version of the same family + 2. The newest permitted model of each lower-cost family in turn: Sonnet, then Haiku + 3. The first `availableModels` entry that names a permitted model + +If none of those is permitted, a session starting on the Default option [refuses to start](</docs/en/errors#managed-settings-block-the-default-model>) with an error that names the key to fix. An `"exact"` list affects the Default option only when the managed `availableModels` list names at least one model or family. Claude Code reads both keys from managed settings only. If you set either one in user, project, or local settings or with `--settings`, Claude Code ignores it with a warning. + +### + +​ + Organization model restrictions Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. Surface coverage says how each surface receives and enforces these settings. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to its usual model when the organization permits it. When the organization restricts that model, Claude Code substitutes the newest version of the family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: @@ -321,8 +348,9 @@ Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. Override is available to a limited set of organizations; ask your Anthropic account team about availability. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: - * `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry, like any other Default + * With the default prefix matching, `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry as well * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted + * for an organization default that `deniedModels` or an `"exact"` list blocks, see Block specific models or versions * an organization default that isn’t available to your account at all is skipped, and the Default option resolves as it would without an organization default As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/managed-settings>) instead. @@ -508,7 +536,7 @@ `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly `ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning -The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. +The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. Opus 5.5 defaults to `medium`, one level below Opus 5’s default of `high`. In Anthropic’s testing, Opus 5.5 at `medium` matches or exceeds Opus 5 at `high` on coding and knowledge-work evaluations. At a given level, Opus 5.5 tends to think more per turn than Opus 5. When you move from Opus 5 to Opus 5.5, start at `medium` rather than carrying over the level you used on Opus 5. To test levels against your own work, see [Calibrate effort](<https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#calibrate-effort>) in the Opus 5.5 prompting guide. #### @@ -701,7 +729,7 @@ `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) `CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#run-every-subagent-on-one-model>) -Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`. +On third-party providers, Customize pinned model display and capabilities describes what a pinned model’s row in the `/model` picker shows. Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`. ### @@ -799,7 +827,7 @@ Environment variable| Description ---|--- `DISABLE_PROMPT_CACHING`| Set to `1` to disable prompt caching for all models. Takes precedence over the per-model settings -`DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for Haiku models only +`DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for the [default Haiku model](</docs/en/prompt-caching#disable-prompt-caching>) `DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models only `DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only `DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only
modified
Show diff (179 lines)
--- a/model-config.md +++ b/model-config.md @@ -41,14 +41,14 @@ Provider| `opus`| `sonnet` ---|---|--- -Anthropic API| Opus 5| Sonnet 5 -[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5| Sonnet 4.6 -Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5| Sonnet 4.5 +Anthropic API| Opus 5.5| Sonnet 5 +[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6 +Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5 -Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. Before v2.1.257, `fable` resolved to Fable 5 on every provider. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Opus 5 requires Claude Code v2.1.219 or later. Sonnet 5 requires v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. Before v2.1.257, `fable` resolved to Fable 5 on every provider. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.280, `opus` resolved to Opus 5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Opus 5.5 requires Claude Code v2.1.280 or later. Opus 5 requires v2.1.219 or later. Sonnet 5 requires v2.1.197 or later. Run `claude update` to upgrade. ### @@ -110,7 +110,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only and leave your default unchanged. To use a different key, rebind [`modelPicker:thisSessionOnly`](</docs/en/keybindings#model-picker-actions>) -Typing `/model <name>` directly behaves like `Enter`. To switch for this session only, open the picker with `/model` and press `s` on the model’s row. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. To switch for this session only, open the picker with `/model` and press `s` on the model’s row. If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -349,12 +349,11 @@ The behavior of `default` depends on your account type: - * **Max, Team Premium, Enterprise, and Anthropic API** : defaults to Opus 5 - * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5 - * **Pro and Team Standard** : defaults to Sonnet 5 + * **Pro, Max, Team, Enterprise, and Anthropic API** : defaults to Opus 5.5 + * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. +Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. ### @@ -398,9 +397,9 @@ Automatic model fallback -This section covers content-based fallback from Fable models and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. For those two categories, the fallback model depends on which model refused: - - * **Fable 5.1 and Fable 5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. +This section covers content-based fallback from Fable models, Opus 5.5, and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models, Opus 5.5, and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. For those two categories, the fallback model depends on which model refused: + + * **Fable 5.1, Fable 5, and Opus 5.5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment instead, and if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, categories that have a fallback re-run on the pinned model; see Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. @@ -435,8 +434,8 @@ On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: - * Claude Code must recognize the current model as a fallback source. Fable 5.1 and Fable 5 are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5 is recognized by its provider model ID or a `modelOverrides` mapping. - * The fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on an Opus 4.8 entry in the provider’s model list, and biology-flagged requests from a Fable model on an Opus 5 entry. + * Claude Code must recognize the current model as a fallback source. Fable 5.1 and Fable 5 are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5 and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping. + * The fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on an Opus 4.8 entry in the provider’s model list, and biology-flagged requests from a Fable model or Opus 5.5 on an Opus 5 entry. If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. Setting `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID enables Fable recognition. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID gives the flagged categories a fallback target, unless the pin names a model outside the Opus family or the model that refused; then Claude Code doesn’t switch and the refusal stands. @@ -446,7 +445,7 @@ Security research and biology workloads -Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1 or Fable 5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1, Fable 5, or Opus 5.5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -459,19 +458,16 @@ Model| Levels ---|--- Fable 5.1 and Fable 5| `low`, `medium`, `high`, `xhigh`, `max` -Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization or your own settings can also cap the levels a model offers; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies: 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) - 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level. Opus 5 and Fable 5.1 have no such hold. Whether a level you set ends the hold depends on how you set it, for example: - * **Ends the hold** : confirming a level interactively, with `Enter` in the `/effort` slider or the `/model` picker or with a level typed after `/effort`, or picking a level from a connected device’s [Remote Control](</docs/en/remote-control#what-connected-devices-see>) effort control - * **Leaves the hold in place for later sessions** : `--effort` at launch, or `s` in the `/effort` slider or the `/model` picker - 3. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) - 4. The model’s default effort: `high` on every model that supports effort, except that Opus 4.7 defaults to `xhigh` and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model - -When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: + 2. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) + 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 defaults to `medium`, Opus 4.7 defaults to `xhigh`, and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model + +Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: * `Enter` in the `/effort` slider or the `/model` picker, or a level typed after `/effort`: save the level as your default and apply it in later sessions * `s` in the `/effort` slider or the `/model` picker: apply the level to this session only. Requires Claude Code v2.1.257 or later @@ -480,7 +476,7 @@ A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. -When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only and doesn’t save it as your default. On Fable 5, Opus 4.8, and Opus 4.7, that level also neither ends the hold on the model’s default effort nor overrides it for the session. While that hold is in effect, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: +When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only and doesn’t save it as your default. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on @@ -506,8 +502,8 @@ Level| When to use it ---|--- `low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive -`medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Balances token usage and intelligence. The default on every model except Opus 4.7 +`medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence. The default on Opus 5.5 +`high`| Balances token usage and intelligence. The default on every model except Opus 5.5 and Opus 4.7 `xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly `ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning @@ -535,10 +531,10 @@ * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted as a level in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key - * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only, though it also ends the hold on the model’s default effort. Requires Claude Code v2.1.234 or later + * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. On Fable 5, Opus 4.8, and Opus 4.7, frontmatter effort also applies while the hold on the model’s default effort is in effect. Before v2.1.267, the hold took precedence and Claude Code ignored the frontmatter level while the hold was active. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. +Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. #### @@ -560,9 +556,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget - -You can’t turn thinking off on Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and a Fable model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5 and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget + +You can’t turn thinking off on Opus 5.5 or the Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -640,7 +636,7 @@ If you don’t set an auto-compact window, Claude Code compacts when the conversation reaches the model’s context limit, except in these sessions: * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit - * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and Opus 5 when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry + * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and later when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary * Models running with a native 1M window, such as Sonnet 5, the Fable models, and Opus 4.7 and later on the Anthropic API, compact before the window fills, at about 967K tokens by default. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Pin models for third-party deployments says which models run with that window; for the configurations that budget Sonnet 5 at 200K instead, see Sonnet 5 context window * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID @@ -678,7 +674,7 @@ Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). To list several models instead, in your own order and under labels you choose, set [`modelPicker`](</docs/en/settings-reference#modelpicker>). Its entry says which rows the picker keeps when that lineup replaces the built-in one. This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up: - export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-5" + export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-5-5" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" @@ -687,7 +683,7 @@ * If you omit the name, the entry shows the model’s name when Claude Code recognizes the ID, and the model ID otherwise. * If you omit the description, Claude Code uses `Custom model (<model-id>)`. -Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. +Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ##
modified
--- a/model-config.md +++ b/model-config.md @@ -70,7 +70,7 @@ Fable 5.1 requires Claude Code v2.1.257 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). -On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so a typed selection can succeed even when the picker doesn’t list the entry. +On the Anthropic API, a Fable model appears in the `/model` picker unless `availableModels` or organization model restrictions exclude it. When your organization can’t use Fable at all, for example under [zero data retention](</docs/en/zero-data-retention#model-availability-under-zdr>), the row stays in the picker grayed out, with a note on why. #### @@ -367,7 +367,7 @@ * **In plan mode** : uses `opus` for complex reasoning and architecture decisions * **In execution mode** : automatically switches to `sonnet` for code generation and implementation -This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you aren’t on an auto-upgrade tier, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting, and the execution phase uses the same window as `sonnet`. When `opus` and `sonnet` resolve to models that run with the 1M context window by default, as the current models do on the Anthropic API, both phases run with it. To request 1M context for both phases where they don’t, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### @@ -570,9 +570,9 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5, and Opus 4.7 and later run with the 1M window by default. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus is automatically upgraded to 1M context with no additional configuration. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. - -Plan| Opus with 1M context| Sonnet 4.6 with 1M context +Fable 5.1, Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. + +Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- Max, Team, and Enterprise| Included with subscription| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)
modified
--- a/model-config.md +++ b/model-config.md @@ -220,12 +220,12 @@ [Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed - * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. + * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a user’s request to start a cloud session on a model the list excludes. * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). - * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; enforcement happens in the session. + * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. ### @@ -298,7 +298,7 @@ Organization model restrictions -Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to its usual model when the organization permits it. When the organization restricts that model, Claude Code substitutes the newest version of the family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: +Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. Surface coverage says how each surface receives and enforces these settings. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to its usual model when the organization permits it. When the organization restricts that model, Claude Code substitutes the newest version of the family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: * Disabling a model at the organization level removes it for every member. * Role-level access grants different models to different custom roles, and a member who holds several roles can use any model that one of their roles grants. @@ -423,7 +423,7 @@ * When the flagged category has no fallback model, such as a biology flag on Opus 5, Claude Code doesn’t show the prompt and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session. - * On mobile [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. + * In [cloud sessions](</docs/en/claude-code-on-the-web>) on the mobile app, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. * When the fallback target is blocked by `availableModels`, Claude Code doesn’t show the prompt. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked.
modified
--- a/model-config.md +++ b/model-config.md @@ -108,9 +108,9 @@ `/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: * `Enter`: switch model and save as your default - * `s`: switch model for this session only - -Typing `/model <name>` directly behaves like `Enter`. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: + * `s`: switch model for this session only and leave your default unchanged. To use a different key, rebind [`modelPicker:thisSessionOnly`](</docs/en/keybindings#model-picker-actions>) + +Typing `/model <name>` directly behaves like `Enter`. To switch for this session only, open the picker with `/model` and press `s` on the model’s row. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker
modified
--- a/model-config.md +++ b/model-config.md @@ -68,7 +68,7 @@ * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread. -Fable 5.1 requires Claude Code v2.1.257 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Fable 5 requires v2.1.170 or later. Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). +Fable 5.1 requires Claude Code v2.1.257 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so a typed selection can succeed even when the picker doesn’t list the entry. @@ -487,7 +487,13 @@ * **`ultracode` setting**: set [`"ultracode": true`](</docs/en/settings-reference#ultracode>) in a settings file, with `--settings`, or in an Agent SDK control request. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` * **`/model` picker**: move the effort slider to `ultracode` with the arrow keys while you choose a model. Claude Code turns it on for the current session, even when you save that model as your default -Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only. +Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. Ultracode is unavailable when: + + * [Workflows are turned off](</docs/en/workflows#turn-workflows-off>) + * The model doesn’t support `xhigh` effort + * An effort cap below `xhigh` applies to the model + +In those cases `--effort ultracode` starts the session with ultracode off, at the highest effort level the model and any cap allow, up to `xhigh`. #### @@ -532,7 +538,7 @@ * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only, though it also ends the hold on the model’s default effort. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. +Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) or organization effort cap still limits the level the skill or subagent runs at. On Fable 5, Opus 4.8, and Opus 4.7, frontmatter effort also applies while the hold on the model’s default effort is in effect. Before v2.1.267, the hold took precedence and Claude Code ignored the frontmatter level while the hold was active. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. ####
modified
Show diff (193 lines)
--- a/model-config.md +++ b/model-config.md @@ -28,8 +28,8 @@ Model alias| Behavior ---|--- **`default`**| Special value that clears any model override and reverts to the runtime default for your account. Not itself a model alias -**`best`**| Uses the latest Fable model where it’s available to you, otherwise the same model as `opus` -**`fable`**| Uses the latest Fable model for your hardest and longest-running tasks +**`best`**| Uses the model the `fable` alias resolves to where Fable is available to you, otherwise the same model as `opus` +**`fable`**| Uses the Fable model for your provider for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks @@ -46,7 +46,7 @@ Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5| Sonnet 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5 -Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1. Before v2.1.255, it resolved to Fable 5. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. Before v2.1.257, `fable` resolved to Fable 5 on every provider. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Opus 5 requires Claude Code v2.1.219 or later. Sonnet 5 requires v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. @@ -58,17 +58,17 @@ [Claude Fable 5.1](<https://platform.claude.com/docs/en/about-claude/models/overview>) and Claude Fable 5 are the most capable models in Claude Code, suited to tasks larger than a single sitting. They sustain long autonomous sessions, investigate before acting, and verify their work more often than smaller models. Fable 5.1 is the newer release. Neither Fable model is the account-type default on any plan or provider. Select one explicitly: - * **Fable 5.1** : run `/model fable`, or launch with `claude --model fable`. + * **Fable 5.1** : run `/model fable`, or launch with `claude --model fable`. In [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where the alias resolves to Fable 5, run `/model claude-fable-5-1` instead. * **Fable 5** : select it by model ID. On the Anthropic API, run `/model claude-fable-5` or launch with `claude --model claude-fable-5`. On other providers, use your provider’s Fable 5 model ID or pin it with `ANTHROPIC_DEFAULT_FABLE_MODEL`. -If your user settings hold `claude-fable-5` or `claude-fable-5[1m]` as the model, for example because you selected Fable in the `/model` picker before v2.1.255, and you connect to the Anthropic API directly, Claude Code changes that saved value to the `fable` or `fable[1m]` alias the first time you run v2.1.255 or later, and the startup model line shows `(auto-updated)` once. A `claude-fable-5` value in project, local, or managed settings is left as it is. Requests that a Fable model’s safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable: +If you connect to the Anthropic API directly and your user settings hold `claude-fable-5` or `claude-fable-5[1m]` as the model, for example because you selected Fable in the `/model` picker before v2.1.257, Claude Code changes that saved value to the `fable` or `fable[1m]` alias the first time you run v2.1.257 or later. The startup model line shows `(auto-updated)` once. A `claude-fable-5` value in project, local, or managed settings stays as it is. Requests that a Fable model’s safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable: * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working toward that outcome, [set a goal](</docs/en/goal>). * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off. * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread. -Fable 5.1 requires Claude Code v2.1.255 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Fable 5 requires v2.1.170 or later. Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). +Fable 5.1 requires Claude Code v2.1.257 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Fable 5 requires v2.1.170 or later. Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so a typed selection can succeed even when the picker doesn’t list the entry. @@ -110,7 +110,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -333,7 +333,7 @@ Organization effort limits -Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. In interactive sessions and plain-text `--print` runs, a warning names the requested and applied levels; with `json` or `stream-json` output or in background agents, the clamp applies silently. Caps are per model, so switching models can change which levels are available. When several of your roles grant the same model, the least restrictive cap applies. Requires Claude Code v2.1.195 or later. Effort limits are delivered together with organization model restrictions and reach the same sessions. +Your organization can cap the effort level in two ways. On a Claude Enterprise plan, organization admins set per-role effort limits, described below. On any plan and any provider, including Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) managed setting caps effort on the client instead. When both apply to a model, the lower cap applies. Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. In interactive sessions and plain-text `--print` runs, a warning names the requested and applied levels; with `json` or `stream-json` output or in background agents, the clamp applies silently. Caps are per model, so switching models can change which levels are available. When several of your roles grant the same model, the least restrictive cap applies. Requires Claude Code v2.1.195 or later. Effort limits are delivered together with organization model restrictions and reach the same sessions. ## @@ -354,7 +354,7 @@ * **Pro and Team Standard** : defaults to Sonnet 5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.255, see Work with Fable. +Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.257, see Work with Fable. ### @@ -367,7 +367,7 @@ * **In plan mode** : uses `opus` for complex reasoning and architecture decisions * **In execution mode** : automatically switches to `sonnet` for code generation and implementation -This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you aren’t on an auto-upgrade tier, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### @@ -462,18 +462,25 @@ Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies: +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization or your own settings can also cap the levels a model offers; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies: 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) - 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level, until you change effort once, for example with an interactive `/effort`, the `/model` picker’s effort slider, or `--effort` at launch. Opus 5 and Fable 5.1 have no such hold + 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level. Opus 5 and Fable 5.1 have no such hold. Whether a level you set ends the hold depends on how you set it, for example: + * **Ends the hold** : confirming a level interactively, with `Enter` in the `/effort` slider or the `/model` picker or with a level typed after `/effort`, or picking a level from a connected device’s [Remote Control](</docs/en/remote-control#what-connected-devices-see>) effort control + * **Leaves the hold in place for later sessions** : `--effort` at launch, or `s` in the `/effort` slider or the `/model` picker 3. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) 4. The model’s default effort: `high` on every model that supports effort, except that Opus 4.7 defaults to `xhigh` and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model -When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, Claude Code saves the level and applies it in later sessions. It saves the level per model, under the [`modelSettings`](</docs/en/settings-reference#modelsettings>) key in your user settings, so each model keeps its own saved level. `max` is the deepest reasoning level. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, Claude Code applies `max` to the current session only. +When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: + + * `Enter` in the `/effort` slider or the `/model` picker, or a level typed after `/effort`: save the level as your default and apply it in later sessions + * `s` in the `/effort` slider or the `/model` picker: apply the level to this session only. Requires Claude Code v2.1.257 or later + +Claude Code saves the level per model, under the [`modelSettings`](</docs/en/settings-reference#modelsettings>) key in your user settings, so each model keeps its own saved level. `max` is the deepest reasoning level. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, Claude Code applies `max` to the current session only. A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. -A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also doesn’t count as the one change that ends the model-default step above on Fable 5, Opus 4.8, or Opus 4.7: while that step is in effect, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: +When you set a level with `/effort` in a [`-p` run](</docs/en/headless>), Claude Code applies it to that session only and doesn’t save it as your default. On Fable 5, Opus 4.8, and Opus 4.7, that level also neither ends the hold on the model’s default effort nor overrides it for the session. While that hold is in effect, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on @@ -521,11 +528,11 @@ * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` - * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key - * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later + * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted as a level in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key + * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only, though it also ends the hold on the model’s default effort. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/managed-settings>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. +Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. If you set `effortLevel` in [managed settings](</docs/en/managed-settings>), Claude Code applies it at the settings step of the effort resolution order, and users can still change the level with `/effort` or `--effort`. To keep users at or below a level, set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>). The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. #### @@ -533,7 +540,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable 5.1, Fable 5, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -547,9 +554,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5.1 and Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget - -Thinking cannot be turned off on Fable 5.1 or Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget + +You can’t turn thinking off on Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and a Fable model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -629,7 +636,7 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and Opus 5 when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Sonnet 5 compacts at the threshold for its configuration + * Models running with a native 1M window, such as Sonnet 5, the Fable models, and Opus 4.7 and later on the Anthropic API, compact before the window fills, at about 967K tokens by default. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Pin models for third-party deployments says which models run with that window; for the configurations that budget Sonnet 5 at 200K instead, see Sonnet 5 context window * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID ### @@ -638,11 +645,11 @@ Correct the window for a gateway or custom model ID -On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) declares the window Claude Code should assume instead. How the variable applies depends on the ID. An unrecognized ID, an unrecognized `[1m]` ID, and an ID that starts with `claude-` or resolves to a Claude model are three separate cases: - - * If the ID doesn’t start with `claude-` or contain `[1m]`, in any casing, and Claude Code can’t resolve it to a Claude model, the variable applies directly and proactive compaction continues at the declared window. - * If the ID doesn’t start with `claude-` but contains `[1m]`, in any casing, and Claude Code can’t resolve it to a Claude model, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With a declared window above 200K, Claude Code then shows a [startup warning](</docs/en/errors#the-200k-limit-isnt-enforced>) that the 200K limit isn’t enforced. The warning is expected in this configuration. - * If the ID starts with `claude-` in any casing or resolves to a Claude model, the variable takes effect only when [`DISABLE_COMPACT`](</docs/en/env-vars>) is also set, which disables all compaction. For example, Claude Code resolves an ID that contains a Claude model name, such as `anthropic/claude-opus-4-8` or `us.anthropic.claude-…-v1:0`, to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. +On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. Set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window Claude Code should assume instead. How the variable applies depends on the ID. Claude Code treats an ID as a provider or custom spelling when it doesn’t start with `claude-`, in any casing, or when it carries a suffix that Claude Code strips when reading the ID, such as the `@YYYYMMDD` date used on Google Cloud’s Agent Platform. Before v2.1.259, Claude Code didn’t count a stripped suffix, so an unrecognized `claude-` ID with a date suffix was treated as a bare `claude-` name. An unrecognized provider or custom spelling, the same spelling with `[1m]`, and every other ID are three separate cases: + + * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID doesn’t contain `[1m]`, the variable applies directly and proactive compaction continues at the declared window. + * If Claude Code can’t resolve a provider or custom spelling to a model it recognizes and the ID contains `[1m]`, in any casing, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With that variable set, Claude Code sizes the ID like the same spelling without `[1m]`, so `CLAUDE_CODE_MAX_CONTEXT_TOKENS` applies when it would apply to that untagged spelling. With a declared window above 200K, Claude Code then shows a [startup warning](</docs/en/errors#the-200k-limit-isnt-enforced>) that the 200K limit isn’t enforced. The warning is expected in this configuration. + * If the ID resolves to a model Claude Code recognizes, or the ID is a bare `claude-` name with no suffix for Claude Code to strip, in any casing, the variable takes effect only when you also set [`DISABLE_COMPACT`](</docs/en/env-vars>), which disables all compaction. For example, an ID that contains a Claude model name that Claude Code knows, such as `anthropic/claude-opus-4-8`, `us.anthropic.claude-…-v1:0`, or the dated `claude-sonnet-4-5@20250929`, resolves to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with a [too-long error Claude Code recognizes](</docs/en/errors#prompt-is-too-long>). Claude Code doesn’t run that recovery when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>) to wording Claude Code doesn’t recognize. @@ -712,17 +719,17 @@ Google Cloud’s Agent Platform| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Microsoft Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: +Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, or `ANTHROPIC_DEFAULT_FABLE_MODEL`: export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' -The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases, including the plan-mode Opus phase of `opusplan`. +With the `[1m]` suffix, the 1M context window applies to all usage of the pinned alias, including the plan-mode Opus phase of `opusplan` and [subagents](</docs/en/sub-agents#choose-a-model>) whose `model` frontmatter names the alias. * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. -An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list its full provider-form ID, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. +An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list its full provider-form ID, or map it through `modelOverrides`. For a pinned model, that ID is the value you set in its `ANTHROPIC_DEFAULT_*_MODEL` variable. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -669,7 +669,12 @@ export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" -`ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If you omit the name, Claude Code uses the model ID; if you omit the description, Claude Code uses `Custom model (<model-id>)`. Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. +`ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional: + + * If you omit the name, the entry shows the model’s name when Claude Code recognizes the ID, and the model ID otherwise. + * If you omit the description, Claude Code uses `Custom model (<model-id>)`. + +Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ## @@ -717,7 +722,7 @@ * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. -An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. +An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list its full provider-form ID, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. ### @@ -725,12 +730,17 @@ Customize pinned model display and capabilities -When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. +When you pin a model on a third-party provider, its row in the `/model` picker shows the model’s name by default if Claude Code recognizes the pinned ID, and the raw ID otherwise: + + * **Recognized** : the exact ID of a model Claude Code knows, such as its Anthropic API ID or your provider’s or gateway’s form of it, with or without the `[1m]` suffix. Pin `us.anthropic.claude-sonnet-4-5-20250929-v1:0` and the row reads `Sonnet 4.5`. + * **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that exact string. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default. + +When a row shows the model’s name, its default description includes the pinned ID so you can still see which ID is pinned. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. Environment variable| Description ---|--- -`ANTHROPIC_DEFAULT_OPUS_MODEL_NAME`| Display name for the pinned Opus model in the `/model` picker. Defaults to the model ID when not set -`ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. When not set, defaults to `Custom Opus model`, or `Custom Opus model (1M context)` if the pinned model ID has the `[1m]` suffix and `CLAUDE_CODE_DISABLE_1M_CONTEXT` isn’t turned on +`ANTHROPIC_DEFAULT_OPUS_MODEL_NAME`| Display name for the pinned Opus model in the `/model` picker. When not set, the row shows the model’s name if Claude Code recognizes the pinned ID, and the pinned ID otherwise +`ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. When not set, the row shows a default description that begins `Custom Opus model` `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Amazon Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports:
modified
--- a/model-config.md +++ b/model-config.md @@ -70,7 +70,7 @@ Fable 5.1 requires Claude Code v2.1.255 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Fable 5 requires v2.1.170 or later. Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). -On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so the selection can succeed before the picker lists the entry. +On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so a typed selection can succeed even when the picker doesn’t list the entry. #### @@ -155,6 +155,19 @@ * The model isn’t available to your account When a new session would start on the variable’s model, a session you resume with `claude --resume`, `--continue`, or the `/resume` picker starts on it too. Claude Code doesn’t restore the model saved in that session’s transcript. Otherwise Claude Code doesn’t use the variable when you resume a session. + +#### + +​ + +A new session starts on a different model than you picked + +When you pick a model with `/model` and your next session starts on something else, these are the usual causes: + + * **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone. + * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file. + * **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>). + * **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default. ##
modified
--- a/model-config.md +++ b/model-config.md @@ -672,7 +672,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#choose-a-model>) +`CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#run-every-subagent-on-one-model>) Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
modified
Show diff (252 lines)
--- a/model-config.md +++ b/model-config.md @@ -28,8 +28,8 @@ Model alias| Behavior ---|--- **`default`**| Special value that clears any model override and reverts to the runtime default for your account. Not itself a model alias -**`best`**| Uses Fable 5 where your organization has access to it, otherwise the latest Opus model -**`fable`**| Uses Claude Fable 5 for your hardest and longest-running tasks +**`best`**| Uses the latest Fable model where it’s available to you, otherwise the same model as `opus` +**`fable`**| Uses the latest Fable model for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks @@ -46,7 +46,7 @@ Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5| Sonnet 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5 -Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1. Before v2.1.255, it resolved to Fable 5. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Opus 5 requires Claude Code v2.1.219 or later. Sonnet 5 requires v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. @@ -54,37 +54,42 @@ ​ -Work with Fable 5 - -[Claude Fable 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5>) is the most capable model in Claude Code, suited to tasks larger than a single sitting. It sustains long autonomous sessions, investigates before acting, and verifies its work more often than smaller models. Fable 5 is not the default model. Select it with `/model fable`. Requests that its safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable 5: +Work with Fable + +[Claude Fable 5.1](<https://platform.claude.com/docs/en/about-claude/models/overview>) and Claude Fable 5 are the most capable models in Claude Code, suited to tasks larger than a single sitting. They sustain long autonomous sessions, investigate before acting, and verify their work more often than smaller models. Fable 5.1 is the newer release. Neither Fable model is the account-type default on any plan or provider. Select one explicitly: + + * **Fable 5.1** : run `/model fable`, or launch with `claude --model fable`. + * **Fable 5** : select it by model ID. On the Anthropic API, run `/model claude-fable-5` or launch with `claude --model claude-fable-5`. On other providers, use your provider’s Fable 5 model ID or pin it with `ANTHROPIC_DEFAULT_FABLE_MODEL`. + +If your user settings hold `claude-fable-5` or `claude-fable-5[1m]` as the model, for example because you selected Fable in the `/model` picker before v2.1.255, and you connect to the Anthropic API directly, Claude Code changes that saved value to the `fable` or `fable[1m]` alias the first time you run v2.1.255 or later, and the startup model line shows `(auto-updated)` once. A `claude-fable-5` value in project, local, or managed settings is left as it is. Requests that a Fable model’s safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable: * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working toward that outcome, [set a goal](</docs/en/goal>). * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off. * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread. -Fable 5 requires Claude Code v2.1.170 or later. Older versions do not show Fable 5 in the model picker and cannot select it. Run `claude update` to upgrade. Fable 5 is not available under [zero data retention](</docs/en/zero-data-retention>), where the `/model` picker either omits it or shows it disabled. - -On the Anthropic API, the `/model` picker lists Fable 5 only after the server reports it available for your organization. When you type `/model fable`, Claude Code checks availability with the server directly, so the selection can succeed before the picker lists the entry. - -#### - -​ - -Fable 5 and usage credits - -Depending on your plan and seat tier, Fable 5 usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable 5 row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code shows a consent prompt before a Fable 5 request bills usage credits. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable 5 using usage credits or switch to your default model. You can also dismiss the prompt: +Fable 5.1 requires Claude Code v2.1.255 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Fable 5 requires v2.1.170 or later. Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>). + +On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so the selection can succeed before the picker lists the entry. + +#### + +​ + +Fable and usage credits + +Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code shows a consent prompt before a Fable request bills usage credits. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: * In the `/model` picker, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. -After you choose to continue on Fable 5 using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: +After you choose to continue on Fable using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: * With Remote Control connected or in a teammate’s session, press any key at the terminal to cancel the deadline, and Claude Code waits for your answer. * In a background session, answer before the deadline. * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it. -In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable 5 request there would bill to usage credits, Claude Code bills it without asking. +In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable request there would bill to usage credits, Claude Code bills it without asking. ### @@ -157,7 +162,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -167,7 +172,7 @@ * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) -On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Claude Code handles any other blocked selection according to where the model was set: +On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to its usual model when the allowlist permits that model. When the allowlist blocks that model, Claude Code substitutes the newest version of the family that the allowlist permits and shows a notice naming both the requested and substituted models. With `["sonnet", "claude-opus-4-6"]`, for example, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Claude Code handles any other blocked selection according to where the model was set: * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model @@ -182,7 +187,7 @@ * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead - * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on Fable 5. On providers other than the Anthropic API, that Opus fallback runs on the provider’s default Opus model without consulting the allowlist. Requires Claude Code v2.1.210 or later + * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on a Fable model. On providers other than the Anthropic API, that Opus fallback runs on the provider’s default Opus model without consulting the allowlist. Requires Claude Code v2.1.210 or later * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist { @@ -280,7 +285,7 @@ Organization model restrictions -Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to the newest version of its family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: +Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to its usual model when the organization permits it. When the organization restricts that model, Claude Code substitutes the newest version of the family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: * Disabling a model at the organization level removes it for every member. * Role-level access grants different models to different custom roles, and a member who holds several roles can use any model that one of their roles grants. @@ -305,7 +310,7 @@ * `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry, like any other Default * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted - * an organization default that isn’t available to your account at all, such as Fable 5 under [zero data retention](</docs/en/zero-data-retention>), is skipped, and the Default option resolves as it would without an organization default + * an organization default that isn’t available to your account at all is skipped, and the Default option resolves as it would without an organization default As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/managed-settings>) instead. @@ -336,7 +341,7 @@ * **Pro and Team Standard** : defaults to Sonnet 5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, for example with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable models are not the account-type default on any plan or provider. Choosing one with `/model` saves it as the selected model in your user settings, so later sessions start on it. For the one-time change Claude Code makes to a saved Fable 5 selection in v2.1.255, see Work with Fable. ### @@ -380,9 +385,9 @@ Automatic model fallback -This section covers content-based fallback from Fable 5 and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 and Opus 5 run with safety classifiers for cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. The fallback model depends on which model refused and which category was flagged: - - * **Fable 5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. +This section covers content-based fallback from Fable models and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable models and Opus 5 run with safety classifiers, which most often flag cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. For those two categories, the fallback model depends on which model refused: + + * **Fable 5.1 and Fable 5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment instead, and if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, categories that have a fallback re-run on the pinned model; see Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. @@ -417,10 +422,10 @@ On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: - * Claude Code must recognize the current model as a fallback source. Fable 5 is recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5 is recognized by its provider model ID or a `modelOverrides` mapping. - * The fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on an Opus 4.8 entry in the provider’s model list, and biology-flagged requests from Fable 5 on an Opus 5 entry. - -If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. Setting `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable 5 model ID enables Fable 5 recognition. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID gives the flagged categories a fallback target, unless the pin names a model outside the Opus family or the model that refused; then Claude Code doesn’t switch and the refusal stands. + * Claude Code must recognize the current model as a fallback source. Fable 5.1 and Fable 5 are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5 is recognized by its provider model ID or a `modelOverrides` mapping. + * The fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on an Opus 4.8 entry in the provider’s model list, and biology-flagged requests from a Fable model on an Opus 5 entry. + +If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. Setting `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID enables Fable recognition. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID gives the flagged categories a fallback target, unless the pin names a model outside the Opus family or the model that refused; then Claude Code doesn’t switch and the refusal stands. #### @@ -428,7 +433,7 @@ Security research and biology workloads -Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5.1 or Fable 5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -440,14 +445,14 @@ Model| Levels ---|--- -Fable 5| `low`, `medium`, `high`, `xhigh`, `max` +Fable 5.1 and Fable 5| `low`, `medium`, `high`, `xhigh`, `max` Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies: 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) - 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level, until you change effort once, for example with an interactive `/effort`, the `/model` picker’s effort slider, or `--effort` at launch. Opus 5 has no such hold + 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level, until you change effort once, for example with an interactive `/effort`, the `/model` picker’s effort slider, or `--effort` at launch. Opus 5 and Fable 5.1 have no such hold 3. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) 4. The model’s default effort: `high` on every model that supports effort, except that Opus 4.7 defaults to `xhigh` and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model @@ -515,7 +520,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable 5, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable 5.1, Fable 5, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -529,9 +534,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget - -Thinking cannot be turned off on Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and Fable 5 decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5.1 and Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget + +Thinking cannot be turned off on Fable 5.1 or Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -539,7 +544,7 @@ Extended context -Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, and Opus 4.7 and later always run with the 1M window. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus is automatically upgraded to 1M context with no additional configuration. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5.1, Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5, and Opus 4.7 and later run with the 1M window by default. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus is automatically upgraded to 1M context with no additional configuration. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -547,7 +552,7 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and Fable 5, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. @@ -610,7 +615,7 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and Opus 5 when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry - * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and Fable 5, compact at the 200K boundary + * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary * Sonnet 5 compacts at the threshold for its configuration * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID @@ -663,11 +668,11 @@ Environment variable| Description ---|--- -`ANTHROPIC_DEFAULT_FABLE_MODEL`| The model to use for `fable`, and the model ID Claude Code recognizes as Fable 5 for automatic model fallback on third-party providers +`ANTHROPIC_DEFAULT_FABLE_MODEL`| The model to use for `fable`, and the model ID Claude Code recognizes as a Fable model for automatic model fallback on third-party providers `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence +`CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#choose-a-model>) Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
modified
--- a/model-config.md +++ b/model-config.md @@ -172,7 +172,7 @@ * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model * **`ANTHROPIC_DEFAULT_MODEL`** : Claude Code ignores the variable - * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [lead’s model for a teammate](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider + * **Subagent or teammate override** : Claude Code runs the subagent or teammate on a fallback model rather than failing the request. See [Choose a model](</docs/en/sub-agents#choose-a-model>) for the subagent fallback and [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>) for the teammate fallback. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead. Before v2.1.222, an alias fell back like any other blocked value on every provider * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting @@ -331,12 +331,12 @@ The behavior of `default` depends on your account type: - * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 5 + * **Max, Team Premium, Enterprise, and Anthropic API** : defaults to Opus 5 * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5 - * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 + * **Pro and Team Standard** : defaults to Sonnet 5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, for example with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, for example with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -444,15 +444,23 @@ Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, `max` applies to the current session only. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies: + + 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect) + 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level, until you change effort once, for example with an interactive `/effort`, the `/model` picker’s effort slider, or `--effort` at launch. Opus 5 has no such hold + 3. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>) + 4. The model’s default effort: `high` on every model that supports effort, except that Opus 4.7 defaults to `xhigh` and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model + +When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, Claude Code saves the level and applies it in later sessions. It saves the level per model, under the [`modelSettings`](</docs/en/settings-reference#modelsettings>) key in your user settings, so each model keeps its own saved level. `max` is the deepest reasoning level. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, Claude Code applies `max` to the current session only. A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. -A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: +A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also doesn’t count as the one change that ends the model-default step above on Fable 5, Opus 4.8, or Opus 4.7: while that step is in effect, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on * **`ultracode` setting**: set [`"ultracode": true`](</docs/en/settings-reference#ultracode>) in a settings file, with `--settings`, or in an Agent SDK control request. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` + * **`/model` picker**: move the effort slider to `ultracode` with the arrow keys while you choose a model. Claude Code turns it on for the current session, even when you save that model as your default Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only. @@ -491,15 +499,15 @@ You can change effort through any of the following: - * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to reset to the model default. You can run it while Claude is working, and once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in the turn + * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to clear your saved level for the active model. You can run it while Claude is working, and once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in the turn * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` - * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` isn’t accepted here, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key + * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/managed-settings>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. +Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/managed-settings>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. #### @@ -659,7 +667,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The model Claude Code uses for all [subagents](</docs/en/sub-agents#choose-a-model>), [agent teams](</docs/en/agent-teams>), and agents in a [workflow](</docs/en/workflows>). Accepts an alias such as `haiku` or a full model name, and overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead +`CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
modified
--- a/model-config.md +++ b/model-config.md @@ -100,7 +100,7 @@ 4. **Settings** : configure permanently in your settings file using the `model` field 5. **Default for new sessions** : set `ANTHROPIC_DEFAULT_MODEL=<alias|name>` -As of v2.1.153, `/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: +`/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: * `Enter`: switch model and save as your default * `s`: switch model for this session only @@ -491,7 +491,7 @@ You can change effort through any of the following: - * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to reset to the model default + * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to reset to the model default. You can run it while Claude is working, and once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in the turn * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` @@ -515,13 +515,13 @@ Extended thinking -Extended thinking is the reasoning Claude emits before responding. On models that support adaptive reasoning, the effort level is the primary control for how much thinking happens; the settings below turn thinking on or off and control how it displays. +Extended thinking is the reasoning Claude emits before responding. On models that support adaptive reasoning, the effort level is the primary control for how much thinking happens; the settings below turn thinking on or off and control how it displays. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. Control| How to set it ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget Thinking cannot be turned off on Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and Fable 5 decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted.
modified
--- a/model-config.md +++ b/model-config.md @@ -200,10 +200,10 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- [Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered -[MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image when server-managed settings deliver no keys| Enforced| Enforced where deployed - - * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and fall back to the managed settings file in the runner image when your organization delivers no server-managed settings; when both exist, the server-managed payload takes precedence, apart from the [keys Claude Code reads from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>). A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. - * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. +[MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed + + * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. + * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). @@ -230,7 +230,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. With `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/managed-settings#precedence-within-the-managed-tier>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. With `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys together in the highest-ranked managed source you deliver. By default Claude Code reads only that source, so a pair placed in a managed settings file is ignored when the admin console delivers any settings; under the opt-in merge in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code still ignores a `modelOverrides` map from a source ranked below the one that sets `availableModels`. ### @@ -264,7 +264,7 @@ Merge behavior -When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#exceptions-to-managed-settings-precedence>): entries in user, project, or local settings cannot extend it, and `availableModels` doesn’t merge across admin-deployed managed sources, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. +When the managed settings Claude Code applies define `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#exceptions-to-managed-settings-precedence>): entries in user, project, or local settings cannot extend it, and Claude Code never merges `availableModels` across managed sources either; [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s list applies. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. Before Claude Code v2.1.175, entries from lower-precedence scopes merged into the managed list instead of being replaced by it. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. ### @@ -371,6 +371,8 @@ * **Outside the allowlist** : Claude Code drops any entry not permitted by `availableModels` when it reads the chain. * **Smaller context window during compaction** : the chain also covers [compaction](</docs/en/context-window#what-survives-compaction>), but Claude Code won’t fall back to a model with a smaller context window than the primary’s, since summarizing there would cut off part of the conversation first. If every fallback is smaller, compaction shows the original error and you can retry. + +Claude Code also applies the chain to [subagents](</docs/en/sub-agents>). When a subagent’s request fails over, Claude Code tries your configured fallback models in order, and the subagent continues on the model that accepts the request. Your session’s model is unchanged. Before v2.1.247, a failure the chain covers ended the subagent instead. ### @@ -739,7 +741,7 @@ } } -Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. To stop the `[claude-code:unrecognized_model]` [diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) for an ID such as a gateway alias, add an entry with that ID as its value. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/managed-settings>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. To stop the `[claude-code:unrecognized_model]` [diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) for an ID such as a gateway alias, add an entry with that ID as its value. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from [managed settings](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/managed-settings>), only `modelOverrides` from managed settings apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -177,7 +177,7 @@ * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting -Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: +Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row, unless Claude Code replaces the built-in options with a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model @@ -357,7 +357,7 @@ Fallback model chains -When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: +When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors, and a [denial by your organization’s policy check](</docs/en/errors#automatic-retries>), never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: claude --fallback-model sonnet,haiku @@ -635,13 +635,13 @@ Add a custom model option -Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up: +Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). To list several models instead, in your own order and under labels you choose, set [`modelPicker`](</docs/en/settings-reference#modelpicker>). Its entry says which rows the picker keeps when that lineup replaces the built-in one. This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up: export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-5" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" -The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If you omit the name, Claude Code uses the model ID; if you omit the description, Claude Code uses `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. +`ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If you omit the name, Claude Code uses the model ID; if you omit the description, Claude Code uses `Custom model (<model-id>)`. Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ## @@ -757,4 +757,4 @@ `DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only `DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only -To change the cache TTL or learn what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>). +To choose the cache TTL for the main conversation and for subagents separately, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). For what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
modified
--- a/model-config.md +++ b/model-config.md @@ -202,7 +202,7 @@ [Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image when server-managed settings deliver no keys| Enforced| Enforced where deployed - * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and fall back to the managed settings file in the runner image when your organization delivers no server-managed settings; when both exist, the server-managed payload takes precedence, with the per-key `env` merge exception described in [settings precedence](</docs/en/server-managed-settings#settings-precedence>). A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. + * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and fall back to the managed settings file in the runner image when your organization delivers no server-managed settings; when both exist, the server-managed payload takes precedence, apart from the [keys Claude Code reads from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>). A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files.
modified
Show diff (162 lines)
--- a/model-config.md +++ b/model-config.md @@ -78,7 +78,7 @@ * In the `/model` picker, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. -After you choose to continue on Fable 5 using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings#available-settings>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: +After you choose to continue on Fable 5 using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: * With Remote Control connected or in a teammate’s session, press any key at the terminal to cancel the deadline, and Claude Code waits for your answer. * In a background session, answer before the deadline. @@ -105,7 +105,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -157,7 +157,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -200,12 +200,12 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- [Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered -[MDM or managed settings files](</docs/en/settings#settings-files>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image when server-managed settings deliver no keys| Enforced| Enforced where deployed +[MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image when server-managed settings deliver no keys| Enforced| Enforced where deployed * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and fall back to the managed settings file in the runner image when your organization delivers no server-managed settings; when both exist, the server-managed payload takes precedence, with the per-key `env` merge exception described in [settings precedence](</docs/en/server-managed-settings#settings-precedence>). A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. - * Server-managed delivery also requires the session to authenticate with an organization login or a directly configured API key. Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings#available-settings>) script should deliver the allowlist through MDM or managed settings files. + * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; enforcement happens in the session. @@ -230,7 +230,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. With `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#precedence-within-the-managed-tier>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. With `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/managed-settings#precedence-within-the-managed-tier>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. ### @@ -280,7 +280,7 @@ Organization model restrictions -Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/settings#settings-files>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to the newest version of its family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: +Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/managed-settings>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to the newest version of its family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: * Disabling a model at the organization level removes it for every member. * Role-level access grants different models to different custom roles, and a member who holds several roles can use any model that one of their roles grants. @@ -298,7 +298,7 @@ Organization admins on Claude Enterprise plans can set a default model for Claude Code members from the claude.ai admin console, for the whole organization or per custom role. When one is set, the Default option resolves to that model. Requires Claude Code v2.1.196 or later. The Default row in the `/model` picker shows the organization default’s name with the label Org default. The label reads Org default whether the admin set the default for the whole organization or for your role. A role default covers members of that custom role and takes precedence over the organization-wide default; when several of your roles set different defaults, the most capable model applies. The organization default is a starting point, not a restriction. These selections take precedence over it: * the `--model` flag and the `ANTHROPIC_MODEL` environment variable - * a `model` value in [managed settings](</docs/en/settings#settings-files>) or supplied through `--settings` + * a `model` value in [managed settings](</docs/en/managed-settings>) or supplied through `--settings` * a `model` value in your user, project, or local settings, including a model you save with `/model` Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. Override is available to a limited set of organizations; ask your Anthropic account team about availability. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: @@ -307,7 +307,7 @@ * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted * an organization default that isn’t available to your account at all, such as Fable 5 under [zero data retention](</docs/en/zero-data-retention>), is skipped, and the Default option resolves as it would without an organization default -As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/settings#settings-files>) instead. +As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/managed-settings>) instead. ## @@ -399,7 +399,7 @@ Ask before switching -To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off **Switch models when a message is flagged** , or set [`switchModelsOnFlag`](</docs/en/settings#available-settings>) to `false` in your settings file. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: +To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off **Switch models when a message is flagged** , or set [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) to `false` in your settings file. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: * When the flagged category has no fallback model, such as a biology flag on Opus 5, Claude Code doesn’t show the prompt and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session. @@ -446,11 +446,11 @@ A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. -A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: +A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on - * **`--settings` or an Agent SDK control request**: pass `"ultracode": true`. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` + * **`ultracode` setting**: set [`"ultracode": true`](</docs/en/settings-reference#ultracode>) in a settings file, with `--settings`, or in an Agent SDK control request. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only. @@ -469,7 +469,7 @@ `high`| Balances token usage and intelligence. The default on every model except Opus 4.7 `xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly -`ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only +`ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. @@ -493,11 +493,11 @@ * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` - * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` and `ultracode` are session-only and are not accepted here + * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` isn’t accepted here, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/settings#settings-precedence>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. +The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/managed-settings>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. #### @@ -578,7 +578,7 @@ You can set the auto-compact window in three places: - * **For this session and later ones** : run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings as [`autoCompactWindow`](</docs/en/settings#available-settings>) and applies it to the current session; if a higher-priority [settings scope](</docs/en/settings#settings-precedence>) such as managed settings sets the key, the command saves your value but the session keeps that scope’s window, and the command says so. Run `/autocompact auto` to return to the window tuned for your model. + * **For this session and later ones** : run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings as [`autoCompactWindow`](</docs/en/settings-reference#autocompactwindow>) and applies it to the current session; if a higher-priority [settings scope](</docs/en/settings#settings-precedence>) such as managed settings sets the key, the command saves your value but the session keeps that scope’s window, and the command says so. Run `/autocompact auto` to return to the window tuned for your model. * **For one launch** : pass [`--autocompact`](</docs/en/cli-reference#cli-flags>) when starting Claude Code. The flag overrides your saved setting for that launch without changing it, and `claude --autocompact auto` runs the session at the tuned window even if your saved setting has a value. Unlike `/autocompact`, the flag isn’t preempted by a higher-priority settings scope such as managed settings. * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). While it’s set, it takes precedence over the command, the flag, and the setting, and `/autocompact` reports the override instead of changing the window. @@ -689,7 +689,7 @@ * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. -An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/settings#settings-files>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. +An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. ### @@ -729,7 +729,7 @@ Override model IDs per version -On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): +On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#where-settings-live>): { "modelOverrides": { @@ -739,7 +739,7 @@ } } -Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. To stop the `[claude-code:unrecognized_model]` [diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) for an ID such as a gateway alias, add an entry with that ID as its value. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/settings#settings-files>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. To stop the `[claude-code:unrecognized_model]` [diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) for an ID such as a gateway alias, add an entry with that ID as its value. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/managed-settings>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -78,7 +78,13 @@ * In the `/model` picker, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. -After you choose to continue on Fable 5 using usage credits, Claude Code doesn’t show the prompt again. In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable 5 request there would bill to usage credits, Claude Code bills it without asking. +After you choose to continue on Fable 5 using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings#available-settings>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: + + * With Remote Control connected or in a teammate’s session, press any key at the terminal to cancel the deadline, and Claude Code waits for your answer. + * In a background session, answer before the deadline. + * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it. + +In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable 5 request there would bill to usage credits, Claude Code bills it without asking. ### @@ -88,7 +94,7 @@ You can configure your model in several ways, listed in order of priority: - 1. **During session** : use `/model <alias|name>` to switch immediately, or run `/model` with no argument to open the picker. The picker asks for confirmation when the conversation has prior output, since the next response re-reads the full history without cached context + 1. **During session** : use `/model <alias|name>` to switch immediately, or run `/model` with no argument to open the picker. See [when Claude Code asks you to confirm the switch](</docs/en/prompt-caching#switching-models>) 2. **At startup** : launch with `claude --model <alias|name>` 3. **Environment variable** : set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** : configure permanently in your settings file using the `model` field
modified
Show diff (189 lines)
--- a/model-config.md +++ b/model-config.md @@ -27,7 +27,7 @@ Model alias| Behavior ---|--- -**`default`**| Special value that clears any model override and reverts to the recommended model for your account type, or to the organization default model when an admin has set one. Not itself a model alias +**`default`**| Special value that clears any model override and reverts to the runtime default for your account. Not itself a model alias **`best`**| Uses Fable 5 where your organization has access to it, otherwise the latest Opus model **`fable`**| Uses Claude Fable 5 for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks @@ -92,13 +92,14 @@ 2. **At startup** : launch with `claude --model <alias|name>` 3. **Environment variable** : set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** : configure permanently in your settings file using the `model` field + 5. **Default for new sessions** : set `ANTHROPIC_DEFAULT_MODEL=<alias|name>` As of v2.1.153, `/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -122,6 +123,28 @@ "model": "opus" } +#### + +​ + +Set a default model for new sessions + +Set `ANTHROPIC_DEFAULT_MODEL=<alias|name>` to choose the model your sessions start on by default. Requires Claude Code v2.1.236 or later. Claude Code starts a new session on the variable’s model only when none of these selects a model: + + * The `--model` flag + * `ANTHROPIC_MODEL` + * A `model` value in any settings file, including the choice you save with `/model` + * An organization default model + +A choice you save with `/model` takes precedence over the variable on later launches too. With `ANTHROPIC_MODEL` set instead, Claude Code returns to that variable’s model on the next launch, whatever you saved with `/model`. Claude Code also resolves the Default option to the variable’s model, unless an organization default model applies. When the Default option resolves to the variable’s model, the Default row in the `/model` picker shows the label Set by ANTHROPIC_DEFAULT_MODEL. Claude Code ignores the variable in these cases, and the Default option resolves as if you hadn’t set it: + + * You set it to `default`, `inherit`, `opusplan`, or `haiku` + * `enforceAvailableModels` is on + * `availableModels` or organization model restrictions exclude the model + * The model isn’t available to your account + +When a new session would start on the variable’s model, a session you resume with `claude --resume`, `--continue`, or the `/resume` picker starts on it too. Claude Code doesn’t restore the model saved in that session’s transcript. Otherwise Claude Code doesn’t use the variable when you resume a session. + ## ​ @@ -130,7 +153,7 @@ Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When `availableModels` is set, the allowlist applies everywhere a user can specify a model: - * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, and the model restored when resuming a session + * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” * **Subagent and teammate models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammate models, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard @@ -142,6 +165,7 @@ * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model + * **`ANTHROPIC_DEFAULT_MODEL`** : Claude Code ignores the variable * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [lead’s model for a teammate](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session @@ -185,7 +209,7 @@ Default model behavior -The Default option in the model picker is not affected by `availableModels` unless `enforceAvailableModels` is also set. On its own, `availableModels` leaves Default available, resolving to the system’s runtime default for the account. If that default is a model you intend to restrict, set `enforceAvailableModels` as well. An empty `availableModels` array never engages the Default-model enforcement: with `availableModels: []`, named model selections are blocked but the Default model for the account type remains usable regardless of `enforceAvailableModels`. +On its own, `availableModels` leaves the Default option on the system’s runtime default for the account until you also set `enforceAvailableModels`. If that default is a model you intend to restrict, set `enforceAvailableModels` as well. An empty `availableModels` array never engages the Default-model enforcement: with `availableModels: []`, named model selections are blocked but the Default model for the account type remains usable regardless of `enforceAvailableModels`. ### @@ -200,7 +224,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#precedence-within-the-managed-tier>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` remaps the Default option only when `availableModels` is non-empty. With `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#precedence-within-the-managed-tier>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. ### @@ -213,7 +237,7 @@ * **`availableModels`** : restricts which named models users can switch to * **`enforceAvailableModels`** : extends the `availableModels` allowlist to the Default option, so Default cannot resolve to a model outside the list * **`model`** : sets the initial model selection when a session starts - * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the Default option and the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to + * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to, and which version the account-type default uses This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and ensures Default resolves to a model on the allowlist rather than the tier default: @@ -226,7 +250,7 @@ } } -Without `enforceAvailableModels` or the `env` block, a user who selects Default in the picker would get the latest release for their tier, bypassing the version pin in `model` and `availableModels`. The two settings cover different scopes: `enforceAvailableModels` makes Default obey the allowlist, while the `env` block pins which version a permitted alias such as `sonnet` resolves to. Use `enforceAvailableModels` alone when restricting model families is enough; add the `env` block when you also need to pin a specific version. +Without `enforceAvailableModels` or the `env` block, a user who selects Default in the picker gets the runtime default rather than the version pinned in `model`. The two settings cover different scopes: `enforceAvailableModels` makes Default obey the allowlist, while the `env` block pins which version a permitted alias such as `sonnet` resolves to. Use `enforceAvailableModels` alone when restricting model families is enough; add the `env` block when you also need to pin a specific version. ### @@ -265,17 +289,17 @@ Organization default model -Organization admins on Claude Enterprise plans can set a default model for Claude Code members from the claude.ai admin console, for the whole organization or per custom role. When one is set, the Default option resolves to that model instead of the account-type default. Requires Claude Code v2.1.196 or later. The Default row in the `/model` picker shows the organization default’s name with the label Org default. The label reads Org default whether the admin set the default for the whole organization or for your role. A role default covers members of that custom role and takes precedence over the organization-wide default; when several of your roles set different defaults, the most capable model applies. The organization default is a starting point, not a restriction, and any other model selection takes precedence over it: +Organization admins on Claude Enterprise plans can set a default model for Claude Code members from the claude.ai admin console, for the whole organization or per custom role. When one is set, the Default option resolves to that model. Requires Claude Code v2.1.196 or later. The Default row in the `/model` picker shows the organization default’s name with the label Org default. The label reads Org default whether the admin set the default for the whole organization or for your role. A role default covers members of that custom role and takes precedence over the organization-wide default; when several of your roles set different defaults, the most capable model applies. The organization default is a starting point, not a restriction. These selections take precedence over it: * the `--model` flag and the `ANTHROPIC_MODEL` environment variable * a `model` value in [managed settings](</docs/en/settings#settings-files>) or supplied through `--settings` * a `model` value in your user, project, or local settings, including a model you save with `/model` -Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. Override is available to a limited set of organizations; ask your Anthropic account team about availability. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through the same restriction checks as any other Default model before it is adopted: - - * `availableModels` on its own never constrains the Default option, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry, like any other Default +Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. Override is available to a limited set of organizations; ask your Anthropic account team about availability. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted: + + * `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry, like any other Default * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted - * an organization default that isn’t available to your account at all, such as Fable 5 under [zero data retention](</docs/en/zero-data-retention>), is skipped, and the Default option resolves to the account-type default + * an organization default that isn’t available to your account at all, such as Fable 5 under [zero data retention](</docs/en/zero-data-retention>), is skipped, and the Default option resolves as it would without an organization default As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/settings#settings-files>) instead. @@ -306,7 +330,7 @@ * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, for example with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -412,7 +436,11 @@ Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, `max` applies to the current session only. A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, `max` applies to the current session only. + +A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only. + +A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on @@ -460,6 +488,7 @@ * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` and `ultracode` are session-only and are not accepted here + * **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/settings#settings-precedence>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. @@ -581,7 +610,7 @@ * If the ID doesn’t start with `claude-` but contains `[1m]`, in any casing, and Claude Code can’t resolve it to a Claude model, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With a declared window above 200K, Claude Code then shows a [startup warning](</docs/en/errors#the-200k-limit-isnt-enforced>) that the 200K limit isn’t enforced. The warning is expected in this configuration. * If the ID starts with `claude-` in any casing or resolves to a Claude model, the variable takes effect only when [`DISABLE_COMPACT`](</docs/en/env-vars>) is also set, which disables all compaction. For example, Claude Code resolves an ID that contains a Claude model name, such as `anthropic/claude-opus-4-8` or `us.anthropic.claude-…-v1:0`, to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. -For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with Anthropic’s too-long error; that recovery doesn’t run when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>). +For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with a [too-long error Claude Code recognizes](</docs/en/errors#prompt-is-too-long>). Claude Code doesn’t run that recovery when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>) to wording Claude Code doesn’t recognize. ## @@ -614,7 +643,7 @@ Environment variables -Use the following environment variables to control the model names that the aliases map to. Each value must be a full model name, or the equivalent identifier for your API provider. +Use the following environment variables to control the model names that the aliases map to. Each value must be a full model name, or the equivalent identifier for your API provider. To choose the model your sessions start on, set `ANTHROPIC_DEFAULT_MODEL`, which this table omits. Environment variable| Description ---|--- @@ -632,7 +661,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. +When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.
modified
--- a/model-config.md +++ b/model-config.md @@ -505,7 +505,7 @@ Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and Fable 5, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. - * With auto-compaction off, sessions stop at the 200K boundary with a [`Prompt is too long` error](</docs/en/errors#prompt-is-too-long>) instead of compacting. + * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names:
modified
--- a/model-config.md +++ b/model-config.md @@ -133,7 +133,7 @@ * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” - * **Subagent and teammate models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammate models including the `teammateDefaultModel` setting, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard + * **Subagent and teammate models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammate models, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard * **Skill and command models** : the `model` frontmatter in [skills and commands](</docs/en/skills>) * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) @@ -142,10 +142,10 @@ * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model - * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [default teammate model](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. When the blocked value is the **Default teammate model** setting itself, Claude Code runs the teammate on your provider’s default Opus model, or on the lead’s model when the allowlist blocks that too. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider + * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [lead’s model for a teammate](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session - * **`--advisor` flag**: Claude Code exits with an error at launch + * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way:
modified
--- a/model-config.md +++ b/model-config.md @@ -105,7 +105,7 @@ * any name that starts with `claude-` * a value you configured yourself as a custom model option or in `modelOverrides` -Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: +Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. Claude Code can still write the [unrecognized-model diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) at request time, on every provider. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: claude --model opus @@ -704,7 +704,7 @@ } } -Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/settings#settings-files>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. To stop the `[claude-code:unrecognized_model]` [diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) for an ID such as a gateway alias, add an entry with that ID as its value. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/settings#settings-files>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -58,7 +58,7 @@ [Claude Fable 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5>) is the most capable model in Claude Code, suited to tasks larger than a single sitting. It sustains long autonomous sessions, investigates before acting, and verifies its work more often than smaller models. Fable 5 is not the default model. Select it with `/model fable`. Requests that its safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable 5: - * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working until that outcome holds, [set a goal](</docs/en/goal>). + * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working toward that outcome, [set a goal](</docs/en/goal>). * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off. * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread.
modified
--- a/model-config.md +++ b/model-config.md @@ -138,7 +138,7 @@ * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) -On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) use provider-specific deployment IDs rather than Anthropic model IDs, so a blocked alias there follows the same behavior below. Claude Code handles any other blocked selection according to where the model was set: +On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Claude Code handles any other blocked selection according to where the model was set: * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model @@ -200,7 +200,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#settings-precedence>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#precedence-within-the-managed-tier>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. ### @@ -234,7 +234,7 @@ Merge behavior -When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#settings-precedence>): entries in user, project, or local settings cannot extend it, and `availableModels` doesn’t merge across admin-deployed managed sources, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. +When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#exceptions-to-managed-settings-precedence>): entries in user, project, or local settings cannot extend it, and `availableModels` doesn’t merge across admin-deployed managed sources, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. ### @@ -257,7 +257,7 @@ * Haiku models are always available and can’t be disabled, so every member keeps at least one usable model. * An access change takes effect on new requests within about a minute; the `/model` picker reflects it the next time a session starts. -Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. +Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions reach sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments only; on any other provider, use `availableModels` instead. ## @@ -277,7 +277,7 @@ * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted * an organization default that isn’t available to your account at all, such as Fable 5 under [zero data retention](</docs/en/zero-data-retention>), is skipped, and the Default option resolves to the account-type default -As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default is delivered to sessions authenticated with the Anthropic API. Sessions on [LLM gateway](</docs/en/llm-gateway>) deployments, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS don’t receive it. To set a default on those deployments, use the `model` key in [managed settings](</docs/en/settings#settings-files>) instead. +As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default reaches only sessions authenticated with the Anthropic API. To set a default anywhere else, including [LLM gateway](</docs/en/llm-gateway>) deployments, use the `model` key in [managed settings](</docs/en/settings#settings-files>) instead. ## @@ -285,7 +285,7 @@ Organization effort limits -Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. In interactive sessions and plain-text `--print` runs, a warning names the requested and applied levels; with `json` or `stream-json` output or in background agents, the clamp applies silently. Caps are per model, so switching models can change which levels are available. When several of your roles grant the same model, the least restrictive cap applies. Requires Claude Code v2.1.195 or later. Effort limits are delivered together with organization model restrictions and follow the same provider availability: sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS don’t receive them. +Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. In interactive sessions and plain-text `--print` runs, a warning names the requested and applied levels; with `json` or `stream-json` output or in background agents, the clamp applies silently. Caps are per model, so switching models can change which levels are available. When several of your roles grant the same model, the least restrictive cap applies. Requires Claude Code v2.1.195 or later. Effort limits are delivered together with organization model restrictions and reach the same sessions. ## @@ -502,7 +502,7 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and Fable 5, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and Fable 5, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with a [`Prompt is too long` error](</docs/en/errors#prompt-is-too-long>) instead of compacting.
modified
Show diff (223 lines)
--- a/model-config.md +++ b/model-config.md @@ -23,7 +23,7 @@ Model aliases -Model aliases provide a convenient way to select model settings without remembering exact version numbers: +Use a model alias to select model settings without remembering exact version numbers: Model alias| Behavior ---|--- @@ -67,6 +67,19 @@ On the Anthropic API, the `/model` picker lists Fable 5 only after the server reports it available for your organization. When you type `/model fable`, Claude Code checks availability with the server directly, so the selection can succeed before the picker lists the entry. +#### + +​ + +Fable 5 and usage credits + +Depending on your plan and seat tier, Fable 5 usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable 5 row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code shows a consent prompt before a Fable 5 request bills usage credits. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable 5 using usage credits or switch to your default model. You can also dismiss the prompt: + + * In the `/model` picker, you keep your current model. + * Mid-session, Claude Code continues the turn on your default model. + +After you choose to continue on Fable 5 using usage credits, Claude Code doesn’t show the prompt again. In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable 5 request there would bill to usage credits, Claude Code bills it without asking. + ### ​ @@ -127,14 +140,14 @@ On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) use provider-specific deployment IDs rather than Anthropic model IDs, so a blocked alias there follows the same behavior below. Claude Code handles any other blocked selection according to where the model was set: - * **`/model`** : the switch is rejected with an error - * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: the value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model - * **Subagent or teammate override** : the override falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [default teammate model](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. When the blocked value is the **Default teammate model** setting itself, Claude Code runs the teammate on your provider’s default Opus model, or on the lead’s model when the allowlist blocks that too. On the Anthropic API and Claude Platform on AWS, a blocked family alias instead follows the substitution above, so the subagent or teammate runs on the newest permitted version of its family; on the providers with provider-specific IDs, the alias falls back like any other blocked value. Before v2.1.222, a blocked family alias fell back like any other blocked value on every provider + * **`/model`** : Claude Code rejects the switch with an error + * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model + * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [default teammate model](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. When the blocked value is the **Default teammate model** setting itself, Claude Code runs the teammate on your provider’s default Opus model, or on the lead’s model when the allowlist blocks that too. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch -Excluded models are hidden from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: +Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model @@ -314,7 +327,7 @@ Fallback model chains -When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Chains are capped at three models after duplicate removal, and extra entries are ignored. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: +When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: claude --fallback-model sonnet,haiku @@ -324,9 +337,9 @@ "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"] } -The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each entry accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. When a request fails over, Claude Code tries each entry in order until one accepts it. An entry that can’t be reached either, such as a retired model pinned in settings, fails over to the next one the same way. Two kinds of entry are removed before that walk starts: - - * **Outside the allowlist** : any entry not permitted by `availableModels` is dropped when Claude Code reads the chain. +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each entry accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. When a request fails over, Claude Code tries each entry in order until one accepts it. An entry that can’t be reached either, such as a retired model pinned in settings, fails over to the next one the same way. Claude Code removes two kinds of entry before that walk starts: + + * **Outside the allowlist** : Claude Code drops any entry not permitted by `availableModels` when it reads the chain. * **Smaller context window during compaction** : the chain also covers [compaction](</docs/en/context-window#what-survives-compaction>), but Claude Code won’t fall back to a model with a smaller context window than the primary’s, since summarizing there would cut off part of the conversation first. If every fallback is smaller, compaction shows the original error and you can retry. ### @@ -358,11 +371,11 @@ To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off **Switch models when a message is flagged** , or set [`switchModelsOnFlag`](</docs/en/settings#available-settings>) to `false` in your settings file. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: - * When the flagged category has no fallback model, such as a biology flag on Opus 5, the prompt is not shown and the request ends with the refusal. + * When the flagged category has no fallback model, such as a biology flag on Opus 5, Claude Code doesn’t show the prompt and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session. * On mobile [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. - * When the fallback target is blocked by `availableModels`, the prompt is not shown. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked. + * When the fallback target is blocked by `availableModels`, Claude Code doesn’t show the prompt. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked. #### @@ -399,7 +412,7 @@ Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, `max` applies to the current session only. A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on @@ -432,7 +445,7 @@ Use ultrathink for one-off deep reasoning -Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. The effort level sent to the API is unchanged. Other phrases such as “think”, “think hard”, and “think more” are passed through as ordinary prompt text and are not recognized as keywords. +Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. The effort level sent to the API is unchanged. Claude Code passes other phrases such as “think”, “think hard”, and “think more” through as ordinary prompt text and doesn’t recognize them as keywords. #### @@ -473,7 +486,7 @@ Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget -Thinking cannot be turned off on Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and Fable 5 decides per step how much to think based on the effort level. Thinking output is collapsed by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Thinking cannot be turned off on Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and Fable 5 decides per step how much to think based on the effort level. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -489,7 +502,12 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: +To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and Fable 5, it also treats the model as having a 200K context window: + + * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. + * With auto-compaction off, sessions stop at the 200K boundary with a [`Prompt is too long` error](</docs/en/errors#prompt-is-too-long>) instead of compacting. + +Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -504,10 +522,66 @@ Sonnet 5 context window -On the Anthropic API, Sonnet 5 always runs with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead and auto-compact at that boundary: +On the Anthropic API, Sonnet 5 always runs with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead: * **LLM gateway** : when `ANTHROPIC_BASE_URL` points at a [gateway](</docs/en/llm-gateway>), Claude Code can’t verify 1M support. To use the full window, select Sonnet 5 (1M context) in the model picker, which maps to `sonnet[1m]`. - * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : treats Sonnet 5 sessions as having a 200K window, for deployments that need to cap context. + * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : holds sessions on every model with a native 1M window to a 200K window; see Extended context for how the hold is enforced. Useful for deployments that need to cap context. + +## + +​ + +Context window and auto-compaction + +The auto-compact window is how full the context window can get before Claude Code compacts the conversation. For what compaction keeps and drops per mechanism, see [What survives compaction](</docs/en/context-window#what-survives-compaction>). + +### + +​ + +Set the auto-compact window + +You can set the auto-compact window in three places: + + * **For this session and later ones** : run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings as [`autoCompactWindow`](</docs/en/settings#available-settings>) and applies it to the current session; if a higher-priority [settings scope](</docs/en/settings#settings-precedence>) such as managed settings sets the key, the command saves your value but the session keeps that scope’s window, and the command says so. Run `/autocompact auto` to return to the window tuned for your model. + * **For one launch** : pass [`--autocompact`](</docs/en/cli-reference#cli-flags>) when starting Claude Code. The flag overrides your saved setting for that launch without changing it, and `claude --autocompact auto` runs the session at the tuned window even if your saved setting has a value. Unlike `/autocompact`, the flag isn’t preempted by a higher-priority settings scope such as managed settings. + * **In scripts and cloud environments** : set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). While it’s set, it takes precedence over the command, the flag, and the setting, and `/autocompact` reports the override instead of changing the window. + +The command and the flag accept a window size from 100K to 1M tokens, in any of these forms: + + * A plain token count, such as `200000` + * A `k` or `M` suffix, such as `500k` or `1M` + * A bare number from 100 to 1000, meaning thousands, so `200` sets 200,000 + +The environment variable accepts only the plain token count. Claude Code caps the window at the model’s context window. + +### + +​ + +Default auto-compact thresholds + +If you don’t set an auto-compact window, Claude Code compacts when the conversation reaches the model’s context limit, except in these sessions: + + * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit + * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and Opus 5 when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry + * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and Fable 5, compact at the 200K boundary + * Sonnet 5 compacts at the threshold for its configuration + * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID + +### + +​ + +Correct the window for a gateway or custom model ID + +On an [LLM gateway](</docs/en/llm-gateway>) or other custom deployment, Claude Code can assume a context window for the model ID that differs from the model’s real window, whether or not it resolves the ID to a Claude model. [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) declares the window Claude Code should assume instead. How the variable applies depends on the ID. An unrecognized ID, an unrecognized `[1m]` ID, and an ID that starts with `claude-` or resolves to a Claude model are three separate cases: + + * If the ID doesn’t start with `claude-` or contain `[1m]`, in any casing, and Claude Code can’t resolve it to a Claude model, the variable applies directly and proactive compaction continues at the declared window. + * If the ID doesn’t start with `claude-` but contains `[1m]`, in any casing, and Claude Code can’t resolve it to a Claude model, Claude Code assumes a 1M window for it and the variable doesn’t apply on its own. To correct the window while keeping proactive compaction, also set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>). With a declared window above 200K, Claude Code then shows a [startup warning](</docs/en/errors#the-200k-limit-isnt-enforced>) that the 200K limit isn’t enforced. The warning is expected in this configuration. + * If the ID starts with `claude-` in any casing or resolves to a Claude model, the variable takes effect only when [`DISABLE_COMPACT`](</docs/en/env-vars>) is also set, which disables all compaction. For example, Claude Code resolves an ID that contains a Claude model name, such as `anthropic/claude-opus-4-8` or `us.anthropic.claude-…-v1:0`, to that model. This includes IDs that also contain `[1m]`: Claude Code resolves `claude-opus-4-8[1m]` to Opus 4.8 even with `CLAUDE_CODE_DISABLE_1M_CONTEXT` set. + +For a model ID Claude Code doesn’t recognize, set [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](</docs/en/env-vars>) to have Claude Code compact only after the API rejects the conversation with Anthropic’s too-long error; that recovery doesn’t run when a gateway [rewrites the error](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>). ## @@ -532,7 +606,7 @@ export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" -The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise the custom entry is filtered from the picker, and a `--model` selection of it is rejected like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. +The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If you omit the name, Claude Code uses the model ID; if you omit the description, Claude Code uses `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ## @@ -540,7 +614,7 @@ Environment variables -You can use the following environment variables to control the model names that the aliases map to. Each value must be a full model name, or the equivalent identifier for your API provider. +Use the following environment variables to control the model names that the aliases map to. Each value must be a full model name, or the equivalent identifier for your API provider. Environment variable| Description ---|--- @@ -607,7 +681,7 @@ `adaptive_thinking`| Adaptive reasoning that dynamically allocates thinking based on task complexity `interleaved_thinking`| Thinking between tool calls -When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to an Amazon Bedrock custom model ARN, sets a friendly name, and declares its capabilities: +When `_SUPPORTED_CAPABILITIES` is set, Claude Code enables the listed capabilities and disables the unlisted ones for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to an Amazon Bedrock custom model ARN, sets a friendly name, and declares its capabilities: export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc' export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock'
modified
--- a/model-config.md +++ b/model-config.md @@ -130,7 +130,7 @@ * **`/model`** : the switch is rejected with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: the value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model * **Subagent or teammate override** : the override falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [default teammate model](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. When the blocked value is the **Default teammate model** setting itself, Claude Code runs the teammate on your provider’s default Opus model, or on the lead’s model when the allowlist blocks that too. On the Anthropic API and Claude Platform on AWS, a blocked family alias instead follows the substitution above, so the subagent or teammate runs on the newest permitted version of its family; on the providers with provider-specific IDs, the alias falls back like any other blocked value. Before v2.1.222, a blocked family alias fell back like any other blocked value on every provider - * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model + * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch
modified
--- a/model-config.md +++ b/model-config.md @@ -157,9 +157,9 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- [Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered -[MDM or managed settings files](</docs/en/settings#settings-files>)| Enforced| Enforced| Not delivered| Enforced| Enforced where deployed - - * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. +[MDM or managed settings files](</docs/en/settings#settings-files>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image when server-managed settings deliver no keys| Enforced| Enforced where deployed + + * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and fall back to the managed settings file in the runner image when your organization delivers no server-managed settings; when both exist, the server-managed payload takes precedence, with the per-key `env` merge exception described in [settings precedence](</docs/en/server-managed-settings#settings-precedence>). A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an organization login or a directly configured API key. Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings#available-settings>) script should deliver the allowlist through MDM or managed settings files. @@ -187,7 +187,7 @@ "enforceAvailableModels": true } -The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#settings-precedence>): admin-deployed managed sources do not merge, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#settings-precedence>): these keys don’t merge across managed sources, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. ### @@ -221,7 +221,7 @@ Merge behavior -When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#settings-precedence>): entries in user, project, or local settings cannot extend it, and admin-deployed managed sources do not merge with each other, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. +When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#settings-precedence>): entries in user, project, or local settings cannot extend it, and `availableModels` doesn’t merge across admin-deployed managed sources, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -85,7 +85,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -115,21 +115,22 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” - * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard + * **Subagent and teammate models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammate models including the `teammateDefaultModel` setting, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard * **Skill and command models** : the `model` frontmatter in [skills and commands](</docs/en/skills>) * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) -On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) use provider-specific deployment IDs rather than Anthropic model IDs, so a blocked alias there follows the rejection and replacement behavior below. Claude Code handles any other blocked selection according to where the model was set: +On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) use provider-specific deployment IDs rather than Anthropic model IDs, so a blocked alias there follows the same behavior below. Claude Code handles any other blocked selection according to where the model was set: * **`/model`** : the switch is rejected with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: the value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model - * **Subagent, skill, or command override** : the override falls back to the inherited or default model rather than failing the request + * **Subagent or teammate override** : the override falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [default teammate model](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. When the blocked value is the **Default teammate model** setting itself, Claude Code runs the teammate on your provider’s default Opus model, or on the lead’s model when the allowlist blocks that too. On the Anthropic API and Claude Platform on AWS, a blocked family alias instead follows the substitution above, so the subagent or teammate runs on the newest permitted version of its family; on the providers with provider-specific IDs, the alias falls back like any other blocked value. Before v2.1.222, a blocked family alias fell back like any other blocked value on every provider + * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model * **`advisorModel` setting**: the advisor is disabled for the session * **`--advisor` flag**: Claude Code exits with an error at launch @@ -220,7 +221,7 @@ Merge behavior -When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies: entries in user, project, or local settings cannot extend it, and admin-deployed managed sources do not merge with each other, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. +When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies, apart from a [host platform that supplies its own](</docs/en/settings#settings-precedence>): entries in user, project, or local settings cannot extend it, and admin-deployed managed sources do not merge with each other, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. ### @@ -619,7 +620,7 @@ Override model IDs per version -The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): +On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; the key-level enumeration is under [Settings precedence](</docs/en/settings#settings-precedence>). The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): { "modelOverrides": {
modified
--- a/model-config.md +++ b/model-config.md @@ -355,7 +355,7 @@ Ask before switching -To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off “switch models when a message is flagged”. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: +To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off **Switch models when a message is flagged** , or set [`switchModelsOnFlag`](</docs/en/settings#available-settings>) to `false` in your settings file. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: * When the flagged category has no fallback model, such as a biology flag on Opus 5, the prompt is not shown and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session.
modified
--- a/model-config.md +++ b/model-config.md @@ -547,7 +547,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>), [agent teams](</docs/en/agent-teams>), and the agents a [workflow](</docs/en/workflows>) runs. Accepts an alias such as `haiku` or a full model name, and overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead +`CLAUDE_CODE_SUBAGENT_MODEL`| The model Claude Code uses for all [subagents](</docs/en/sub-agents#choose-a-model>), [agent teams](</docs/en/agent-teams>), and agents in a [workflow](</docs/en/workflows>). Accepts an alias such as `haiku` or a full model name, and overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`. @@ -592,7 +592,7 @@ Environment variable| Description ---|--- `ANTHROPIC_DEFAULT_OPUS_MODEL_NAME`| Display name for the pinned Opus model in the `/model` picker. Defaults to the model ID when not set -`ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set +`ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. When not set, defaults to `Custom Opus model`, or `Custom Opus model (1M context)` if the pinned model ID has the `[1m]` suffix and `CLAUDE_CODE_DISABLE_1M_CONTEXT` isn’t turned on `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Amazon Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports:
modified
Show diff (136 lines)
--- a/model-config.md +++ b/model-config.md @@ -41,14 +41,14 @@ Provider| `opus`| `sonnet` ---|---|--- -Anthropic API| Opus 4.8| Sonnet 5 -[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 4.8| Sonnet 4.6 -Amazon Bedrock, Google Cloud’s Agent Platform| Opus 4.8| Sonnet 4.5 +Anthropic API| Opus 5| Sonnet 5 +[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5| Sonnet 4.6 +Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5| Sonnet 4.5 Microsoft Foundry| Opus 4.6| Sonnet 4.5 -Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Sonnet 5 requires Claude Code v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. +Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.219, `opus` resolved to Opus 4.8 on the Anthropic API from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Opus 5 requires Claude Code v2.1.219 or later. Sonnet 5 requires v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. ### @@ -287,12 +287,12 @@ The behavior of `default` depends on your account type: - * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8 - * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 4.8 + * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 5 + * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5 * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -334,7 +334,12 @@ Automatic model fallback -This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on your provider’s default Opus model and shows a notice in the transcript. On the Anthropic API, [LLM gateway](</docs/en/llm-gateway>) deployments, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), that model is Opus 4.8. On the [Claude apps gateway](</docs/en/claude-apps-gateway>), it’s Opus 4.7 unless you point the `opus` alias at another model. The session then continues on that Opus model. To return to Fable 5, run `/model fable`. The fallback target is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. +This section covers content-based fallback from Fable 5 and Opus 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 and Opus 5 run with safety classifiers for cybersecurity and biology content. When a classifier flags a request and the flagged category has a fallback model, Claude Code re-runs the request on that model and shows a notice in the transcript. The fallback model depends on which model refused and which category was flagged: + + * **Fable 5** : biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8. + * **Opus 5** : cybersecurity-flagged requests re-run on Opus 4.8. Biology-flagged requests end with a refusal instead, because Opus 5 runs its own biology classifiers with no fallback model. + +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code resolves these targets through your deployment instead, and if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, categories that have a fallback re-run on the pinned model; see Enable fallback on Bedrock, Agent Platform, and Foundry. After a fallback, the session continues on the fallback model. To return to your original model, run `/model`. Category-based fallback requires Claude Code v2.1.219 or later. Before v2.1.219, every flagged Fable 5 request re-ran on your provider’s default Opus model, and Opus 5 was not a fallback source. The fallback model is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. #### @@ -350,8 +355,9 @@ Ask before switching -To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off “switch models when a message is flagged”. A flagged request then pauses the session with two options: switch to the Opus model, or edit the prompt and retry on Fable 5. Some cases behave differently: - +To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off “switch models when a message is flagged”. A flagged request then pauses the session with two options: switch to the fallback model, or edit the prompt and retry on the current model. Some cases behave differently: + + * When the flagged category has no fallback model, such as a biology flag on Opus 5, the prompt is not shown and the request ends with the refusal. * If both models flag the same request, you can edit the prompt and retry, or start a new session. * On mobile [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. @@ -365,10 +371,10 @@ On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: - * Claude Code must recognize the current model as Fable 5: the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. - * The fallback target must resolve to an Opus model: the value of `ANTHROPIC_DEFAULT_OPUS_MODEL` if set, otherwise an Opus 4.8 entry in the provider’s model list. - -If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. To enable automatic fallback on these providers, set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable 5 model ID and `ANTHROPIC_DEFAULT_OPUS_MODEL` to your Opus 4.8 model ID. + * Claude Code must recognize the current model as a fallback source. Fable 5 is recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5 is recognized by its provider model ID or a `modelOverrides` mapping. + * The fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on an Opus 4.8 entry in the provider’s model list, and biology-flagged requests from Fable 5 on an Opus 5 entry. + +If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. Setting `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable 5 model ID enables Fable 5 recognition. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID gives the flagged categories a fallback target, unless the pin names a model outside the Opus family or the model that refused; then Claude Code doesn’t switch and the refusal stands. #### @@ -376,7 +382,7 @@ Security research and biology workloads -Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work, expect nearly all requests to reroute. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work on Fable 5, Claude Code moves the session to Opus 5 at the first flagged request, and later biology-flagged requests end in refusals there, because Opus 5 has no biology fallback. On Opus 5, you get those refusals from the first flagged request. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -389,10 +395,10 @@ Model| Levels ---|--- Fable 5| `low`, `medium`, `high`, `xhigh`, `max` -Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. That default is held across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. A non-interactive `/effort` also can’t release the model-default hold above: on Fable 5, Opus 4.8, and Opus 4.7 it reports `Not applied` and the session stays at the model’s default effort, so pass `--effort` at launch instead. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on @@ -412,8 +418,8 @@ ---|--- `low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive `medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Balances token usage and intelligence. Default on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6 -`xhigh`| Deeper reasoning at higher token spend. Default on Opus 4.7 +`high`| Balances token usage and intelligence. The default on every model except Opus 4.7 +`xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly `ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only @@ -474,7 +480,7 @@ Extended context -Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, Opus 4.8, and Opus 4.7 always run with the 1M window. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, and Opus 4.7 and later always run with the 1M window. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus is automatically upgraded to 1M context with no additional configuration. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -521,11 +527,11 @@ Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up: - export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-8" + export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-5" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" -The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well: the custom entry is filtered from the picker and a `--model` selection of it is rejected like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-4-8`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. +The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise the custom entry is filtered from the picker, and a `--model` selection of it is rejected like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ##
modified
--- a/model-config.md +++ b/model-config.md @@ -135,7 +135,7 @@ Excluded models are hidden from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: - * **Fallback model chains** : elements outside the allowlist are dropped + * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on Fable 5. On providers other than the Anthropic API, that Opus fallback runs on the provider’s default Opus model without consulting the allowlist. Requires Claude Code v2.1.210 or later @@ -323,10 +323,10 @@ "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"] } -The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. Two cases cause an element to be skipped: - - * **Unavailable model** : a model that can’t be reached, such as a retired model pinned in settings, is skipped and Claude Code continues to the next element. - * **Outside the allowlist** : an element not permitted by `availableModels` is dropped when the chain is read and never tried. +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each entry accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. When a request fails over, Claude Code tries each entry in order until one accepts it. An entry that can’t be reached either, such as a retired model pinned in settings, fails over to the next one the same way. Two kinds of entry are removed before that walk starts: + + * **Outside the allowlist** : any entry not permitted by `availableModels` is dropped when Claude Code reads the chain. + * **Smaller context window during compaction** : the chain also covers [compaction](</docs/en/context-window#what-survives-compaction>), but Claude Code won’t fall back to a model with a smaller context window than the primary’s, since summarizing there would cut off part of the conversation first. If every fallback is smaller, compaction shows the original error and you can retry. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -442,7 +442,7 @@ * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` and `ultracode` are session-only and are not accepted here * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/settings#settings-precedence>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. +The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/settings#settings-precedence>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -65,6 +65,8 @@ Fable 5 requires Claude Code v2.1.170 or later. Older versions do not show Fable 5 in the model picker and cannot select it. Run `claude update` to upgrade. Fable 5 is not available under [zero data retention](</docs/en/zero-data-retention>), where the `/model` picker either omits it or shows it disabled. +On the Anthropic API, the `/model` picker lists Fable 5 only after the server reports it available for your organization. When you type `/model fable`, Claude Code checks availability with the server directly, so the selection can succeed before the picker lists the entry. + ### ​ @@ -83,26 +85,26 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker * any name that starts with `claude-` * a value you configured yourself as a custom model option or in `modelOverrides` -Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: - - # Start with Opus +Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: + claude --model opus - # Switch to Sonnet during session +Then switch models from within the session: + /model sonnet Example settings file: { "permissions": { - ... + "allow": ["Bash(npm run lint)"] }, "model": "opus" } @@ -136,6 +138,7 @@ * **Fallback model chains** : elements outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead + * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on Fable 5. On providers other than the Anthropic API, that Opus fallback runs on the provider’s default Opus model without consulting the allowlist. Requires Claude Code v2.1.210 or later * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist { @@ -320,7 +323,7 @@ "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"] } -The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Two cases cause an element to be skipped: +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. Two cases cause an element to be skipped: * **Unavailable model** : a model that can’t be reached, such as a retired model pinned in settings, is skipped and Claude Code continues to the next element. * **Outside the allowlist** : an element not permitted by `availableModels` is dropped when the chain is read and never tried. @@ -395,7 +398,7 @@ * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on * **`--settings` or an Agent SDK control request**: pass `"ultracode": true`. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` -Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only. +Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only. #### @@ -439,7 +442,7 @@ * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` and `ultracode` are session-only and are not accepted here * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. +The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/settings#settings-precedence>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. #### @@ -516,7 +519,7 @@ Add a custom model option -Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable: +Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up: export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-8" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" @@ -548,7 +551,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. +When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured. Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.
modified
--- a/model-config.md +++ b/model-config.md @@ -12,6 +12,8 @@ * Amazon Bedrock: an inference profile ARN * Microsoft Foundry: a deployment name * Google Cloud’s Agent Platform: a version name + +For guidance on which model and effort level fit different kinds of work, see [Choosing a Claude model and effort level in Claude Code](<https://claude.com/blog/claude-model-and-effort-level-in-claude-code>) on the blog. `ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateways](</docs/en/llm-gateway>). @@ -536,7 +538,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>) and [agent teams](</docs/en/agent-teams>). Overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead +`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>), [agent teams](</docs/en/agent-teams>), and the agents a [workflow](</docs/en/workflows>) runs. Accepts an alias such as `haiku` or a full model name, and overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
modified
--- a/model-config.md +++ b/model-config.md @@ -31,18 +31,20 @@ **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks -**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5 with its native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for Sonnet 5 -**`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions +**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5 with its native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for Sonnet 5 +**`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -What each alias resolves to depends on the provider: - - * **Anthropic API** : `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. - * **[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)** : `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. - * **Amazon Bedrock and Google Cloud’s Agent Platform** : `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.5. - * **Microsoft Foundry** : `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5. - -Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +The version that the `opus` and `sonnet` aliases resolve to depends on the provider: + +Provider| `opus`| `sonnet` +---|---|--- +Anthropic API| Opus 4.8| Sonnet 5 +[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 4.8| Sonnet 4.6 +Amazon Bedrock, Google Cloud’s Agent Platform| Opus 4.8| Sonnet 4.5 +Microsoft Foundry| Opus 4.6| Sonnet 4.5 + +Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Before v2.1.207, `opus` resolved to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Google Cloud’s Agent Platform. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Sonnet 5 requires Claude Code v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. @@ -79,7 +81,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -281,12 +283,11 @@ The behavior of `default` depends on your account type: * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8 - * **Claude Platform on AWS** : defaults to Opus 4.8 + * **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 4.8 * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 - * **Amazon Bedrock and Google Cloud’s Agent Platform** : defaults to Opus 4.8 * **Microsoft Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -328,7 +329,7 @@ Automatic model fallback -This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on Opus 4.8 and shows a notice in the transcript. The session then continues on that Opus model. To return to Fable 5, run `/model fable`. The fallback target is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. +This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on your provider’s default Opus model and shows a notice in the transcript. On the Anthropic API, [LLM gateway](</docs/en/llm-gateway>) deployments, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), that model is Opus 4.8. On the [Claude apps gateway](</docs/en/claude-apps-gateway>), it’s Opus 4.7 unless you point the `opus` alias at another model. The session then continues on that Opus model. To return to Fable 5, run `/model fable`. The fallback target is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. #### @@ -468,7 +469,7 @@ Extended context -Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, Opus 4.8, and Opus 4.7 always run with the 1M window. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, Opus 4.8, and Opus 4.7 always run with the 1M window. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -545,7 +546,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and fall back to the previous version for that session, while Microsoft Foundry users see errors because Microsoft Foundry has no equivalent startup check. +When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and the session falls back to an earlier version of the default model, or to the default Sonnet model when the default is an Opus model and no Opus version is available. Microsoft Foundry users see errors instead, because Microsoft Foundry has no equivalent startup check. Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. @@ -564,7 +565,7 @@ The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases, including the plan-mode Opus phase of `opusplan`. * Claude Code strips the suffix before sending the model ID to your provider. - * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). + * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/settings#settings-files>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching.
modified
--- a/model-config.md +++ b/model-config.md @@ -35,7 +35,14 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +What each alias resolves to depends on the provider: + + * **Anthropic API** : `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. + * **[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)** : `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. + * **Amazon Bedrock and Google Cloud’s Agent Platform** : `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.5. + * **Microsoft Foundry** : `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5. + +Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Sonnet 5 requires Claude Code v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. @@ -79,7 +86,7 @@ * any name that starts with `claude-` * a value you configured yourself as a custom model option or in `modelOverrides` -Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#there%E2%80%99s-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: +Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus @@ -274,9 +281,10 @@ The behavior of `default` depends on your account type: * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8 - * **Claude Platform on AWS** : defaults to Opus 4.7 + * **Claude Platform on AWS** : defaults to Opus 4.8 * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 - * **Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry** : defaults to Sonnet 4.5 + * **Amazon Bedrock and Google Cloud’s Agent Platform** : defaults to Opus 4.8 + * **Microsoft Foundry** : defaults to Sonnet 4.5 Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. @@ -320,7 +328,7 @@ Automatic model fallback -This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on the default Opus model and shows a notice in the transcript: Opus 4.8 on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments, or Opus 4.7 on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). The session then continues on that Opus model. To return to Fable 5, run `/model fable`. The fallback target is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. +This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on Opus 4.8 and shows a notice in the transcript. The session then continues on that Opus model. To return to Fable 5, run `/model fable`. The fallback target is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -72,7 +72,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: +Typing `/model <name>` directly behaves like `Enter`. A model set with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker @@ -112,7 +112,20 @@ * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) -Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag, `ANTHROPIC_MODEL`, or `model` setting value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model. A blocked subagent, skill, or command override falls back to the inherited or default model rather than failing the request; a blocked `advisorModel` setting disables the advisor for the session, while a blocked `--advisor` flag value exits with an error at launch. Excluded models are hidden from the `/model` picker. As of v2.1.199, a full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. On earlier versions such an ID is selectable only by typing `/model <id>`. Automatic model changes are checked the same way: elements of a fallback model chain outside the allowlist are dropped, a plan-mode upgrade such as `opusplan` to an excluded model is skipped so planning continues on the session’s model, and an automatic model fallback whose target is excluded does not run, so the flagged request ends with a refusal instead. Enabling [fast mode](</docs/en/fast-mode>) is refused when the model the session would run on afterward is outside the allowlist. +On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to the newest version of its family that the allowlist permits. When the allowlist pins specific versions, for example `["sonnet", "claude-opus-4-6"]`, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus, and show a notice naming both the requested and substituted models. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) use provider-specific deployment IDs rather than Anthropic model IDs, so a blocked alias there follows the rejection and replacement behavior below. Claude Code handles any other blocked selection according to where the model was set: + + * **`/model`** : the switch is rejected with an error + * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: the value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model + * **Subagent, skill, or command override** : the override falls back to the inherited or default model rather than failing the request + * **`advisorModel` setting**: the advisor is disabled for the session + * **`--advisor` flag**: Claude Code exits with an error at launch + +Excluded models are hidden from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: + + * **Fallback model chains** : elements outside the allowlist are dropped + * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model + * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead + * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist { "availableModels": ["sonnet", "haiku"] @@ -209,7 +222,7 @@ Organization model restrictions -Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/settings#settings-files>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Restrictions apply org-wide or per role: +Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/settings#settings-files>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. A model family alias such as `opus` resolves to the newest version of its family that the organization permits, with the same substitution notice. `/model <alias>` is rejected only when every version of its family is restricted; an alias set with `--model`, `ANTHROPIC_MODEL`, or the `model` setting is still replaced at startup in that case. Before v2.1.205, a family alias was substituted or rejected based on its newest released version alone, even when an older version was allowed. Restrictions apply org-wide or per role: * Disabling a model at the organization level removes it for every member. * Role-level access grants different models to different custom roles, and a member who holds several roles can use any model that one of their roles grants. @@ -278,7 +291,7 @@ * **In plan mode** : uses `opus` for complex reasoning and architecture decisions * **In execution mode** : automatically switches to `sonnet` for code generation and implementation -This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes Opus, `opusplan` stays on Sonnet in plan mode instead of switching. Similarly, a Haiku session that would normally upgrade to Sonnet in plan mode stays on Haiku when Sonnet is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### @@ -365,7 +378,7 @@ Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. That default is held across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. A non-interactive `/effort` also can’t release the model-default hold above: on Fable 5, Opus 4.8, and Opus 4.7 it reports `Not applied` and the session stays at the model’s default effort, so pass `--effort` at launch instead. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: * **`/effort`** : run `/effort ultracode`, or select it from the menu * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on
modified
--- a/model-config.md +++ b/model-config.md @@ -365,7 +365,13 @@ Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. You can turn on ultracode through any of the following: + + * **`/effort`** : run `/effort ultracode`, or select it from the menu + * **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on + * **`--settings` or an Agent SDK control request**: pass `"ultracode": true`. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"` + +Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only. ####
modified
Show diff (165 lines)
--- a/model-config.md +++ b/model-config.md @@ -9,9 +9,9 @@ * A **model alias** * A **model name** * Anthropic API: a full **[model name](<https://platform.claude.com/docs/en/about-claude/models/overview>)** - * Bedrock: an inference profile ARN - * Foundry: a deployment name - * Vertex: a version name + * Amazon Bedrock: an inference profile ARN + * Microsoft Foundry: a deployment name + * Google Cloud’s Agent Platform: a version name `ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateways](</docs/en/llm-gateway>). @@ -35,7 +35,7 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Sonnet 5 requires Claude Code v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. @@ -72,7 +72,14 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: + + * a model alias + * an entry from the `/model` picker + * any name that starts with `claude-` + * a value you configured yourself as a custom model option or in `modelOverrides` + +Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#there%E2%80%99s-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus @@ -126,7 +133,7 @@ * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. - * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Bedrock, Vertex AI, Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. + * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an organization login or a directly configured API key. Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings#available-settings>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; enforcement happens in the session. @@ -194,7 +201,7 @@ Mantle model IDs -When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. +When the [Amazon Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. ### @@ -209,7 +216,7 @@ * Haiku models are always available and can’t be disabled, so every member keeps at least one usable model. * An access change takes effect on new requests within about a minute; the `/model` picker reflects it the next time a session starts. -Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. +Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. ## @@ -256,7 +263,7 @@ * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8 * **Claude Platform on AWS** : defaults to Opus 4.7 * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 - * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 + * **Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry** : defaults to Sonnet 4.5 Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. @@ -327,9 +334,9 @@ ​ -Enable fallback on Bedrock, Vertex AI, and Foundry - -On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: +Enable fallback on Bedrock, Agent Platform, and Foundry + +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: * Claude Code must recognize the current model as Fable 5: the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. * The fallback target must resolve to an Opus model: the value of `ANTHROPIC_DEFAULT_OPUS_MODEL` if set, otherwise an Opus 4.8 entry in the provider’s model list. @@ -511,7 +518,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. +When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and fall back to the previous version for that session, while Microsoft Foundry users see errors because Microsoft Foundry has no equivalent startup check. Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. @@ -519,9 +526,9 @@ Provider| Example ---|--- -Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'` -Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` +Amazon Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'` +Google Cloud’s Agent Platform| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` +Microsoft Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: @@ -531,7 +538,7 @@ * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). - * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. + * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/settings#settings-files>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. @@ -541,7 +548,7 @@ Customize pinned model display and capabilities -When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. +When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. Environment variable| Description ---|--- @@ -549,7 +556,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports -The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Amazon Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: Capability value| Enables ---|--- @@ -560,7 +567,7 @@ `adaptive_thinking`| Adaptive reasoning that dynamically allocates thinking based on task complexity `interleaved_thinking`| Thinking between tool calls -When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to a Bedrock custom model ARN, sets a friendly name, and declares its capabilities: +When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to an Amazon Bedrock custom model ARN, sets a friendly name, and declares its capabilities: export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc' export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock' @@ -573,7 +580,7 @@ Override model IDs per version -The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Bedrock inference profile ARN, Vertex AI version name, or Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): +The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): { "modelOverrides": { @@ -583,7 +590,7 @@ } } -Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Bedrock, overrides take precedence over any inference profiles that Claude Code discovers automatically at startup. Values you supply directly through `ANTHROPIC_MODEL`, `--model`, or the `ANTHROPIC_DEFAULT_*_MODEL` environment variables are passed to the provider as-is and are not transformed by `modelOverrides`. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/settings#settings-files>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. ###
modified
Show diff (106 lines)
--- a/model-config.md +++ b/model-config.md @@ -25,7 +25,7 @@ Model alias| Behavior ---|--- -**`default`**| Special value that clears any model override and reverts to the recommended model for your account type. Not itself a model alias +**`default`**| Special value that clears any model override and reverts to the recommended model for your account type, or to the organization default model when an admin has set one. Not itself a model alias **`best`**| Uses Fable 5 where your organization has access to it, otherwise the latest Opus model **`fable`**| Uses Claude Fable 5 for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks @@ -72,7 +72,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus @@ -100,12 +100,12 @@ * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” - * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, the model picker in `/agents`, and `CLAUDE_CODE_SUBAGENT_MODEL` + * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard * **Skill and command models** : the `model` frontmatter in [skills and commands](</docs/en/skills>) * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) -Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag, `ANTHROPIC_MODEL`, or `model` setting value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model. A blocked subagent, skill, or command override falls back to the inherited or default model rather than failing the request; a blocked `advisorModel` setting disables the advisor for the session, while a blocked `--advisor` flag value exits with an error at launch. Excluded models are hidden from the `/model` picker. Automatic model changes are checked the same way: elements of a fallback model chain outside the allowlist are dropped, a plan-mode upgrade such as `opusplan` to an excluded model is skipped so planning continues on the session’s model, and an automatic model fallback whose target is excluded does not run, so the flagged request ends with a refusal instead. Enabling [fast mode](</docs/en/fast-mode>) is refused when the model the session would run on afterward is outside the allowlist. +Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag, `ANTHROPIC_MODEL`, or `model` setting value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model. A blocked subagent, skill, or command override falls back to the inherited or default model rather than failing the request; a blocked `advisorModel` setting disables the advisor for the session, while a blocked `--advisor` flag value exits with an error at launch. Excluded models are hidden from the `/model` picker. As of v2.1.199, a full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. On earlier versions such an ID is selectable only by typing `/model <id>`. Automatic model changes are checked the same way: elements of a fallback model chain outside the allowlist are dropped, a plan-mode upgrade such as `opusplan` to an excluded model is skipped so planning continues on the session’s model, and an automatic model fallback whose target is excluded does not run, so the flagged request ends with a refusal instead. Enabling [fast mode](</docs/en/fast-mode>) is refused when the model the session would run on afterward is outside the allowlist. { "availableModels": ["sonnet", "haiku"] @@ -152,7 +152,7 @@ "enforceAvailableModels": true } -When the default model for the user’s account type is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#settings-precedence>): admin-deployed managed sources do not merge, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. +The Default option resolves to the account-type default, or to the organization default model when an admin has set one. When that model is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#settings-precedence>): admin-deployed managed sources do not merge, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. ### @@ -202,7 +202,42 @@ Organization model restrictions -Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/settings#settings-files>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. +Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/settings#settings-files>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Restrictions apply org-wide or per role: + + * Disabling a model at the organization level removes it for every member. + * Role-level access grants different models to different custom roles, and a member who holds several roles can use any model that one of their roles grants. + * Haiku models are always available and can’t be disabled, so every member keeps at least one usable model. + * An access change takes effect on new requests within about a minute; the `/model` picker reflects it the next time a session starts. + +Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. + +## + +​ + +Organization default model + +Organization admins on Claude Enterprise plans can set a default model for Claude Code members from the claude.ai admin console, for the whole organization or per custom role. When one is set, the Default option resolves to that model instead of the account-type default. Requires Claude Code v2.1.196 or later. The Default row in the `/model` picker shows the organization default’s name with the label Org default. The label reads Org default whether the admin set the default for the whole organization or for your role. A role default covers members of that custom role and takes precedence over the organization-wide default; when several of your roles set different defaults, the most capable model applies. The organization default is a starting point, not a restriction, and any other model selection takes precedence over it: + + * the `--model` flag and the `ANTHROPIC_MODEL` environment variable + * a `model` value in [managed settings](</docs/en/settings#settings-files>) or supplied through `--settings` + * a `model` value in your user, project, or local settings, including a model you save with `/model` + +Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. Override is available to a limited set of organizations; ask your Anthropic account team about availability. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through the same restriction checks as any other Default model before it is adopted: + + * `availableModels` on its own never constrains the Default option, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry, like any other Default + * an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted + * an organization default that isn’t available to your account at all, such as Fable 5 under [zero data retention](</docs/en/zero-data-retention>), is skipped, and the Default option resolves to the account-type default + +As of v2.1.199, when the organization default is a different model family from your account type’s usual default, the `/model` picker keeps a separate row for that usual family, so you can still switch to it for a session. In v2.1.196 through v2.1.198 that row is missing from the picker. The organization default is delivered to sessions authenticated with the Anthropic API. Sessions on [LLM gateway](</docs/en/llm-gateway>) deployments, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS don’t receive it. To set a default on those deployments, use the `model` key in [managed settings](</docs/en/settings#settings-files>) instead. + +## + +​ + +Organization effort limits + +Organization admins on Claude Enterprise plans can set a maximum effort level per model for each custom role, alongside role-level organization model restrictions. Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. In interactive sessions and plain-text `--print` runs, a warning names the requested and applied levels; with `json` or `stream-json` output or in background agents, the clamp applies silently. Caps are per model, so switching models can change which levels are available. When several of your roles grant the same model, the least restrictive cap applies. Requires Claude Code v2.1.195 or later. Effort limits are delivered together with organization model restrictions and follow the same provider availability: sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS don’t receive them. ## @@ -223,7 +258,7 @@ * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -323,7 +358,7 @@ Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -202,7 +202,7 @@ Organization model restrictions -Organization admins restrict which models members can run by disabling individual models in the Claude Console. Use this Console toggle instead of `availableModels` when your members authenticate through the Anthropic API and you want one org-wide switch without deploying settings files. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. +Organization admins on Claude Enterprise plans restrict which models members can run by disabling individual models in the claude.ai admin console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. The restriction applies when a member signs in or uses their own API key. Organization-scoped credentials, such as organization service keys, are not tied to a user, so the restriction does not apply to them. The Claude Console has no model restriction control. Organizations without a Claude Enterprise plan, including those whose members authenticate through the Anthropic API, restrict models with `availableModels` in [managed settings](</docs/en/settings#settings-files>) instead, adding `enforceAvailableModels` to cover the Default option. These settings are enforced by Claude Code itself, not by the server. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. ##
modified
Show diff (109 lines)
--- a/model-config.md +++ b/model-config.md @@ -31,13 +31,13 @@ **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks -**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions +**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5 with its native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for Sonnet 5 **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Opus 4.8 requires Claude Code v2.1.154 or later. Run `claude update` to upgrade. +On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Sonnet 5 requires Claude Code v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade. ### @@ -220,7 +220,7 @@ * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8 * **Claude Platform on AWS** : defaults to Opus 4.7 - * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 4.6 + * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5 * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. @@ -251,7 +251,7 @@ To persist a chain across sessions, set `fallbackModel` in [settings](</docs/en/settings>) as an array: { - "fallbackModel": ["claude-sonnet-4-6", "claude-haiku-4-5"] + "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"] } The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Two cases cause an element to be skipped: @@ -320,10 +320,10 @@ Model| Levels ---|--- Fable 5| `low`, `medium`, `high`, `xhigh`, `max` -Opus 4.8 and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. #### @@ -337,7 +337,7 @@ ---|--- `low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive `medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Balances token usage and intelligence. Default on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6 +`high`| Balances token usage and intelligence. Default on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6 `xhigh`| Deeper reasoning at higher token spend. Default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly `ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only @@ -375,7 +375,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning, as does Fable 5. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable 5, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -399,9 +399,9 @@ Extended context -Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. On the Anthropic API, Fable 5, Opus 4.8, and Opus 4.7 always run with the 1M window. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. - -Plan| Opus with 1M context| Sonnet with 1M context +Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, Opus 4.8, and Opus 4.7 always run with the 1M window. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. + +Plan| Opus with 1M context| Sonnet 4.6 with 1M context ---|---|--- Max, Team, and Enterprise| Included with subscription| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) @@ -415,6 +415,17 @@ # Or append [1m] to a full model name /model claude-opus-4-8[1m] + +#### + +​ + +Sonnet 5 context window + +On the Anthropic API, Sonnet 5 always runs with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead and auto-compact at that boundary: + + * **LLM gateway** : when `ANTHROPIC_BASE_URL` points at a [gateway](</docs/en/llm-gateway>), Claude Code can’t verify 1M support. To use the full window, select Sonnet 5 (1M context) in the model picker, which maps to `sonnet[1m]`. + * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : treats Sonnet 5 sessions as having a 200K window, for deployments that need to cap context. ## @@ -485,7 +496,7 @@ * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). - * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. + * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/settings#settings-files>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching.
modified
--- a/model-config.md +++ b/model-config.md @@ -72,7 +72,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus @@ -137,7 +137,7 @@ Default model behavior -The Default option in the model picker is not affected by `availableModels` unless `enforceAvailableModels` is also set. On its own, `availableModels` leaves Default available, resolving to the system’s runtime default based on the user’s subscription tier. If the tier default is a model you intend to restrict, set `enforceAvailableModels` as well. An empty `availableModels` array never engages the Default-model enforcement: with `availableModels: []`, named model selections are blocked but the Default model for the account type remains usable regardless of `enforceAvailableModels`. +The Default option in the model picker is not affected by `availableModels` unless `enforceAvailableModels` is also set. On its own, `availableModels` leaves Default available, resolving to the system’s runtime default for the account. If that default is a model you intend to restrict, set `enforceAvailableModels` as well. An empty `availableModels` array never engages the Default-model enforcement: with `availableModels: []`, named model selections are blocked but the Default model for the account type remains usable regardless of `enforceAvailableModels`. ### @@ -160,7 +160,7 @@ Control the model users run on -The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system default for their tier regardless of what `model` is set to, unless `enforceAvailableModels` redirects it. To fully control the model experience, combine these settings: +The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system’s runtime default regardless of what `model` is set to, unless `enforceAvailableModels` redirects it. To fully control the model experience, combine these settings: * **`availableModels`** : restricts which named models users can switch to * **`enforceAvailableModels`** : extends the `availableModels` allowlist to the Default option, so Default cannot resolve to a model outside the list
modified
Show diff (106 lines)
--- a/model-config.md +++ b/model-config.md @@ -8,7 +8,7 @@ * A **model alias** * A **model name** - * Anthropic API: A full **[model name](<https://platform.claude.com/docs/en/about-claude/models/overview>)** + * Anthropic API: a full **[model name](<https://platform.claude.com/docs/en/about-claude/models/overview>)** * Bedrock: an inference profile ARN * Foundry: a deployment name * Vertex: a version name @@ -35,7 +35,7 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name (for example, `claude-opus-4-8`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Opus 4.8 requires Claude Code v2.1.154 or later. Run `claude update` to upgrade. @@ -62,10 +62,10 @@ You can configure your model in several ways, listed in order of priority: - 1. **During session** \- Use `/model <alias|name>` to switch immediately, or run `/model` with no argument to open the picker. The picker asks for confirmation when the conversation has prior output, since the next response re-reads the full history without cached context - 2. **At startup** \- Launch with `claude --model <alias|name>` - 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` - 4. **Settings** \- Configure permanently in your settings file using the `model` field. + 1. **During session** : use `/model <alias|name>` to switch immediately, or run `/model` with no argument to open the picker. The picker asks for confirmation when the conversation has prior output, since the next response re-reads the full history without cached context + 2. **At startup** : launch with `claude --model <alias|name>` + 3. **Environment variable** : set `ANTHROPIC_MODEL=<alias|name>` + 4. **Settings** : configure permanently in your settings file using the `model` field As of v2.1.153, `/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: @@ -202,7 +202,7 @@ Organization model restrictions -Use the Console toggle instead of `availableModels` when your members authenticate through the Anthropic API and you want one org-wide switch without deploying settings files. Organization admins restrict which models members can run by disabling individual models in the Claude Console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. +Organization admins restrict which models members can run by disabling individual models in the Claude Console. Use this Console toggle instead of `availableModels` when your members authenticate through the Anthropic API and you want one org-wide switch without deploying settings files. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. ## @@ -233,10 +233,10 @@ The `opusplan` model alias provides an automated hybrid approach: - * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions - * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation - -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes Opus, `opusplan` stays on Sonnet in plan mode instead of switching. Similarly, a Haiku session that would normally upgrade to Sonnet in plan mode stays on Haiku when Sonnet is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). + * **In plan mode** : uses `opus` for complex reasoning and architecture decisions + * **In execution mode** : automatically switches to `sonnet` for code generation and implementation + +This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes Opus, `opusplan` stays on Sonnet in plan mode instead of switching. Similarly, a Haiku session that would normally upgrade to Sonnet in plan mode stays on Haiku when Sonnet is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### @@ -407,7 +407,7 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: +To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -422,10 +422,10 @@ Checking your current model -You can see which model you’re currently using in several ways: - - 1. In [status line](</docs/en/statusline>) (if configured) - 2. In `/status`, which also displays your account information. +You can see which model you’re currently using in two places: + + * In the [status line](</docs/en/statusline>), if you have one configured + * In `/status`, which also displays your account information ## @@ -435,11 +435,11 @@ Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable: - export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-7" + export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-8" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" -The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well: the custom entry is filtered from the picker and a `--model` selection of it is rejected like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-4-7`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. +The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well: the custom entry is filtered from the picker and a `--model` selection of it is rejected like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-4-8`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ## @@ -447,7 +447,7 @@ Environment variables -You can use the following environment variables, which must be full **model names** (or equivalent for your API provider), to control the model names that the aliases map to. +You can use the following environment variables to control the model names that the aliases map to. Each value must be a full model name, or the equivalent identifier for your API provider. Environment variable| Description ---|---
modified
Show diff (186 lines)
--- a/model-config.md +++ b/model-config.md @@ -13,7 +13,7 @@ * Foundry: a deployment name * Vertex: a version name -`ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateway configuration](</docs/en/llm-gateway>). +`ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateways](</docs/en/llm-gateway>). ### @@ -72,7 +72,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus @@ -95,16 +95,17 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: - - * **Main session model** : `/model`, the `--model` flag, and the `ANTHROPIC_MODEL` environment variable +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: + + * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, the model picker in `/agents`, and `CLAUDE_CODE_SUBAGENT_MODEL` - * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting - * **Fallback chains** : elements of a fallback model chain outside the list are dropped - -Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag or `ANTHROPIC_MODEL` value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model. A blocked subagent or advisor override falls back to the inherited or default model rather than failing the request. + * **Skill and command models** : the `model` frontmatter in [skills and commands](</docs/en/skills>) + * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag + * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) + +Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag, `ANTHROPIC_MODEL`, or `model` setting value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model. A blocked subagent, skill, or command override falls back to the inherited or default model rather than failing the request; a blocked `advisorModel` setting disables the advisor for the session, while a blocked `--advisor` flag value exits with an error at launch. Excluded models are hidden from the `/model` picker. Automatic model changes are checked the same way: elements of a fallback model chain outside the allowlist are dropped, a plan-mode upgrade such as `opusplan` to an excluded model is skipped so planning continues on the session’s model, and an automatic model fallback whose target is excluded does not run, so the flagged request ends with a refusal instead. Enabling [fast mode](</docs/en/fast-mode>) is refused when the model the session would run on afterward is outside the allowlist. { "availableModels": ["sonnet", "haiku"] @@ -114,9 +115,44 @@ ​ +Surface coverage + +Every surface enforces the allowlist it receives. Which delivery mechanism reaches each surface differs: + +Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork +---|---|---|---|---|--- +[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced| Enforced| Not delivered +[MDM or managed settings files](</docs/en/settings#settings-files>)| Enforced| Enforced| Not delivered| Enforced| Enforced where deployed + + * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. + * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. + * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Bedrock, Vertex AI, Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. + * Server-managed delivery also requires the session to authenticate with an organization login or a directly configured API key. Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings#available-settings>) script should deliver the allowlist through MDM or managed settings files. + * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). + * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; enforcement happens in the session. + +### + +​ + Default model behavior -By default, the Default option in the model picker is not affected by `availableModels`. It remains available and represents the system’s runtime default based on the user’s subscription tier. To extend the allowlist to the Default option, set `enforceAvailableModels` to `true` in managed or policy settings alongside a non-empty `availableModels` list. When the tier default is not in the allowlist, Default resolves to the first allowed entry instead of the tier default. This requires Claude Code v2.1.175 or later. An empty `availableModels` array never engages enforcement. Even with `availableModels: []`, users can still use Claude Code with the Default model for their tier regardless of `enforceAvailableModels`. +The Default option in the model picker is not affected by `availableModels` unless `enforceAvailableModels` is also set. On its own, `availableModels` leaves Default available, resolving to the system’s runtime default based on the user’s subscription tier. If the tier default is a model you intend to restrict, set `enforceAvailableModels` as well. An empty `availableModels` array never engages the Default-model enforcement: with `availableModels: []`, named model selections are blocked but the Default model for the account type remains usable regardless of `enforceAvailableModels`. + +### + +​ + +Enforce the allowlist for the Default model + +Set `enforceAvailableModels: true` alongside a non-empty `availableModels` in managed settings to extend the allowlist to the Default option. This requires Claude Code v2.1.175 or later. + + { + "availableModels": ["sonnet", "haiku"], + "enforceAvailableModels": true + } + +When the default model for the user’s account type is not in the allowlist, the Default option instead resolves to the first `availableModels` entry that names an allowed, available model, and the `/model` picker’s Default row shows that model. This applies everywhere the default is reached: session startup, selecting Default in `/model`, the `"default"` keyword in fallback model chains, and the fallback used when an excluded selection is dropped. `enforceAvailableModels` has no effect when `availableModels` is unset or empty: with `availableModels: []`, the Default model for the account type remains usable, so the setting cannot lock users out of every model. When `availableModels` is non-empty but no entry resolves to an allowed and available model, enforcement is skipped and Default resolves to the account-type default, with a warning visible only under `--debug`. Keep at least one guaranteed-available entry in the list to avoid this. Deploy both keys in the [highest-precedence managed source](</docs/en/settings#settings-precedence>): admin-deployed managed sources do not merge, so a pair placed in a managed settings file is ignored when the admin console delivers any settings. ### @@ -124,7 +160,7 @@ Control the model users run on -The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system default for their tier regardless of what `model` is set to. To fully control the model experience, combine these settings: +The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system default for their tier regardless of what `model` is set to, unless `enforceAvailableModels` redirects it. To fully control the model experience, combine these settings: * **`availableModels`** : restricts which named models users can switch to * **`enforceAvailableModels`** : extends the `availableModels` allowlist to the Default option, so Default cannot resolve to a model outside the list @@ -150,7 +186,7 @@ Merge behavior -When `availableModels` is set in user, project, and local settings only, arrays are merged and deduplicated across those levels. When `availableModels` is set in managed or policy settings, the managed or policy value replaces the merged result entirely: entries added in user or project settings cannot widen it. Managed and policy settings replace lower-precedence values for `enforceAvailableModels` the same way. As of Claude Code v2.1.175, this is the only way to enforce a strict allowlist; earlier versions merge the managed list with lower-precedence entries. +When the [highest-precedence managed settings source](</docs/en/server-managed-settings#settings-precedence>) defines `availableModels`, that list alone applies: entries in user, project, or local settings cannot extend it, and admin-deployed managed sources do not merge with each other, so a list deployed in a managed settings file is ignored when server-managed settings deliver any keys. Otherwise, lists from user, project, and local settings are [concatenated and deduplicated](</docs/en/settings#settings-precedence>) like other array settings. As of Claude Code v2.1.175, the managed list replaces lower-precedence entries; earlier versions merge them. Within the effective list, an entry naming a specific model in a family, whether a version prefix or a full model ID, disables that family’s wildcard entry: `["sonnet", "claude-sonnet-4-5"]` allows only Sonnet 4.5 versions, not every Sonnet model. ### @@ -158,7 +194,15 @@ Mantle model IDs -When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. The setting still restricts the picker to listed entries, so include the standard aliases alongside any Mantle IDs. +When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. + +### + +​ + +Organization model restrictions + +Use the Console toggle instead of `availableModels` when your members authenticate through the Anthropic API and you want one org-wide switch without deploying settings files. Organization admins restrict which models members can run by disabling individual models in the Claude Console. This restriction is delivered with the account’s entitlements when Claude Code authenticates, separate from any `availableModels` list in settings, and the server enforces the same restriction independently when a session is created. Requires Claude Code v2.1.187 or later. A restricted model is hidden from the `/model` picker. Selecting it by name with `--model`, the `ANTHROPIC_MODEL` environment variable, or the `model` setting shows the notice `Model "<name>" is restricted by your organization's settings. Using <model> instead.` and the session starts on an allowed model. Typing `/model <name>` for a restricted model is rejected with `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` and the session keeps its current model. Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. ## @@ -179,7 +223,7 @@ * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 4.6 * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -221,7 +265,7 @@ Automatic model fallback -This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on the default Opus model and shows a notice in the transcript: Opus 4.8 on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments, or Opus 4.7 on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). The session then continues on that Opus model. To return to Fable 5, run `/model fable`. +This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on the default Opus model and shows a notice in the transcript: Opus 4.8 on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments, or Opus 4.7 on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). The session then continues on that Opus model. To return to Fable 5, run `/model fable`. The fallback target is checked against `availableModels`. When it is blocked, no fallback occurs. The refusal is shown as a normal error and the session’s model is unchanged. #### @@ -242,6 +286,7 @@ * If both models flag the same request, you can edit the prompt and retry, or start a new session. * On mobile [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. + * When the fallback target is blocked by `availableModels`, the prompt is not shown. The flagged request ends with the refusal, the same as automatic fallback when the target is blocked. #### @@ -388,13 +433,13 @@ Add a custom model option -Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [LLM gateway model selection](</docs/en/llm-gateway#model-selection>). This example sets all three variables to make a gateway-routed Opus deployment selectable: +Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable: export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-7" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" -The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. +The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well: the custom entry is filtered from the picker and a `--model` selection of it is rejected like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-4-7`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior. ## @@ -442,7 +487,7 @@ * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. -The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias such as `opus`, the version prefix such as `claude-opus-4-8`, or the full model ID. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching, so an entry of `claude-opus-4-8` permits both the standard and 1M-context Opus rows. Provider-specific prefixes such as `us.anthropic.` are not stripped: list the same form in `availableModels` that the picker shows, or map it through `modelOverrides`. +An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/settings#settings-files>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. ### @@ -492,7 +537,7 @@ } } -Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Bedrock, overrides take precedence over any inference profiles that Claude Code discovers automatically at startup. Values you supply directly through `ANTHROPIC_MODEL`, `--model`, or the `ANTHROPIC_DEFAULT_*_MODEL` environment variables are passed to the provider as-is and are not transformed by `modelOverrides`. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Bedrock, overrides take precedence over any inference profiles that Claude Code discovers automatically at startup. Values you supply directly through `ANTHROPIC_MODEL`, `--model`, or the `ANTHROPIC_DEFAULT_*_MODEL` environment variables are passed to the provider as-is and are not transformed by `modelOverrides`. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -72,7 +72,7 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. Example usage: +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus
modified
--- a/model-config.md +++ b/model-config.md @@ -95,9 +95,11 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, the allowlist applies to every surface where a user can name a model: +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, and the `ANTHROPIC_MODEL` environment variable + * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list + * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, the model picker in `/agents`, and `CLAUDE_CODE_SUBAGENT_MODEL` * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting * **Fallback chains** : elements of a fallback model chain outside the list are dropped @@ -190,7 +192,7 @@ * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes Opus, `opusplan` stays on Sonnet in plan mode instead of switching. The same applies to the implicit Haiku-to-Sonnet plan-mode upgrade when Sonnet is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes Opus, `opusplan` stays on Sonnet in plan mode instead of switching. Similarly, a Haiku session that would normally upgrade to Sonnet in plan mode stays on Haiku when Sonnet is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ###
modified
--- a/model-config.md +++ b/model-config.md @@ -102,7 +102,7 @@ * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting * **Fallback chains** : elements of a fallback model chain outside the list are dropped -Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag or `ANTHROPIC_MODEL` value is ignored at startup and the session starts on the default model. A blocked subagent or advisor override falls back to the inherited or default model rather than failing the request. +Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag or `ANTHROPIC_MODEL` value is replaced at startup with a warning naming both the requested and substituted models, and the session starts on the default model. A blocked subagent or advisor override falls back to the inherited or default model rather than failing the request. { "availableModels": ["sonnet", "haiku"] @@ -114,7 +114,7 @@ Default model behavior -The Default option in the model picker is not affected by `availableModels`. It always remains available and represents the system’s runtime default based on the user’s subscription tier. Even with `availableModels: []`, users can still use Claude Code with the Default model for their tier. +By default, the Default option in the model picker is not affected by `availableModels`. It remains available and represents the system’s runtime default based on the user’s subscription tier. To extend the allowlist to the Default option, set `enforceAvailableModels` to `true` in managed or policy settings alongside a non-empty `availableModels` list. When the tier default is not in the allowlist, Default resolves to the first allowed entry instead of the tier default. This requires Claude Code v2.1.175 or later. An empty `availableModels` array never engages enforcement. Even with `availableModels: []`, users can still use Claude Code with the Default model for their tier regardless of `enforceAvailableModels`. ### @@ -122,23 +122,25 @@ Control the model users run on -The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system default for their tier regardless of what `model` is set to. To fully control the model experience, combine three settings: +The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system default for their tier regardless of what `model` is set to. To fully control the model experience, combine these settings: * **`availableModels`** : restricts which named models users can switch to + * **`enforceAvailableModels`** : extends the `availableModels` allowlist to the Default option, so Default cannot resolve to a model outside the list * **`model`** : sets the initial model selection when a session starts * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the Default option and the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to -This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and pins Default to resolve to Sonnet 4.5 rather than the latest release: +This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and ensures Default resolves to a model on the allowlist rather than the tier default: { "model": "claude-sonnet-4-5", "availableModels": ["claude-sonnet-4-5", "haiku"], + "enforceAvailableModels": true, "env": { "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5" } } -Without the `env` block, a user who selects Default in the picker would get the latest Sonnet release, bypassing the version pin in `model` and `availableModels`. +Without `enforceAvailableModels` or the `env` block, a user who selects Default in the picker would get the latest release for their tier, bypassing the version pin in `model` and `availableModels`. The two settings cover different scopes: `enforceAvailableModels` makes Default obey the allowlist, while the `env` block pins which version a permitted alias such as `sonnet` resolves to. Use `enforceAvailableModels` alone when restricting model families is enough; add the `env` block when you also need to pin a specific version. ### @@ -146,7 +148,7 @@ Merge behavior -When `availableModels` is set at multiple levels, such as user settings and project settings, arrays are merged and deduplicated. To enforce a strict allowlist, set `availableModels` in managed or policy settings which take highest priority. +When `availableModels` is set in user, project, and local settings only, arrays are merged and deduplicated across those levels. When `availableModels` is set in managed or policy settings, the managed or policy value replaces the merged result entirely: entries added in user or project settings cannot widen it. Managed and policy settings replace lower-precedence values for `enforceAvailableModels` the same way. As of Claude Code v2.1.175, this is the only way to enforce a strict allowlist; earlier versions merge the managed list with lower-precedence entries. ### @@ -188,7 +190,7 @@ * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. When `availableModels` excludes Opus, `opusplan` stays on Sonnet in plan mode instead of switching. The same applies to the implicit Haiku-to-Sonnet plan-mode upgrade when Sonnet is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ###
modified
--- a/model-config.md +++ b/model-config.md @@ -95,7 +95,14 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. Elements of a fallback model chain outside the list are dropped. +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, the allowlist applies to every surface where a user can name a model: + + * **Main session model** : `/model`, the `--model` flag, and the `ANTHROPIC_MODEL` environment variable + * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, the model picker in `/agents`, and `CLAUDE_CODE_SUBAGENT_MODEL` + * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting + * **Fallback chains** : elements of a fallback model chain outside the list are dropped + +Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag or `ANTHROPIC_MODEL` value is ignored at startup and the session starts on the default model. A blocked subagent or advisor override falls back to the inherited or default model rather than failing the request. { "availableModels": ["sonnet", "haiku"] @@ -147,7 +154,7 @@ Mantle model IDs -When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias-only matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, so include the standard aliases alongside any Mantle IDs. +When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. The setting still restricts the picker to listed entries, so include the standard aliases alongside any Mantle IDs. ## @@ -181,7 +188,7 @@ * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### @@ -425,13 +432,13 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' -The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases. It does not extend the plan-mode Opus phase of `opusplan`, which remains capped at 200K. +The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases, including the plan-mode Opus phase of `opusplan`. * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. -The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`fable`, `opus`, `sonnet`, `haiku`), not the provider-specific model ID. +The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias such as `opus`, the version prefix such as `claude-opus-4-8`, or the full model ID. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching, so an entry of `claude-opus-4-8` permits both the standard and 1M-context Opus rows. Provider-specific prefixes such as `us.anthropic.` are not stripped: list the same form in `availableModels` that the picker shows, or map it through `modelOverrides`. ###
modified
--- a/model-config.md +++ b/model-config.md @@ -45,7 +45,7 @@ Work with Fable 5 -[Claude Fable 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5>) is the most capable model in Claude Code, suited to tasks larger than a single sitting. It sustains long autonomous sessions, investigates before acting, and verifies its work more often than smaller models. Fable 5 is not the default model. Select it with `/model fable`. Requests that its safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable 5: +[Claude Fable 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5>) is the most capable model in Claude Code, suited to tasks larger than a single sitting. It sustains long autonomous sessions, investigates before acting, and verifies its work more often than smaller models. Fable 5 is not the default model. Select it with `/model fable`. Requests that its safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable 5: * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working until that outcome holds, [set a goal](</docs/en/goal>). * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off.
modified
Show diff (248 lines)
--- a/model-config.md +++ b/model-config.md @@ -26,7 +26,8 @@ Model alias| Behavior ---|--- **`default`**| Special value that clears any model override and reverts to the recommended model for your account type. Not itself a model alias -**`best`**| Uses the most capable available model, currently equivalent to `opus` +**`best`**| Uses Fable 5 where your organization has access to it, otherwise the latest Opus model +**`fable`**| Uses Claude Fable 5 for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks @@ -42,6 +43,21 @@ ​ +Work with Fable 5 + +[Claude Fable 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5>) is the most capable model in Claude Code, suited to tasks larger than a single sitting. It sustains long autonomous sessions, investigates before acting, and verifies its work more often than smaller models. Fable 5 is not the default model. Select it with `/model fable`. Requests that its safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable 5: + + * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working until that outcome holds, [set a goal](</docs/en/goal>). + * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off. + * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. + * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread. + +Fable 5 requires Claude Code v2.1.170 or later. Older versions do not show Fable 5 in the model picker and cannot select it. Run `claude update` to upgrade. Fable 5 is not available under [zero data retention](</docs/en/zero-data-retention>), where the `/model` picker either omits it or shows it disabled. + +### + +​ + Setting your model You can configure your model in several ways, listed in order of priority: @@ -79,7 +95,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. Elements of a fallback model chain outside the list are dropped. { "availableModels": ["sonnet", "haiku"] @@ -103,7 +119,7 @@ * **`availableModels`** : restricts which named models users can switch to * **`model`** : sets the initial model selection when a session starts - * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** : control what the Default option and the `sonnet`, `opus`, and `haiku` aliases resolve to + * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the Default option and the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and pins Default to resolve to Sonnet 4.5 rather than the latest release: @@ -152,7 +168,7 @@ * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 4.6 * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -165,7 +181,77 @@ * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). + +### + +​ + +Fallback model chains + +When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Chains are capped at three models after duplicate removal, and extra entries are ignored. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: + + claude --fallback-model sonnet,haiku + +To persist a chain across sessions, set `fallbackModel` in [settings](</docs/en/settings>) as an array: + + { + "fallbackModel": ["claude-sonnet-4-6", "claude-haiku-4-5"] + } + +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Two cases cause an element to be skipped: + + * **Unavailable model** : a model that can’t be reached, such as a retired model pinned in settings, is skipped and Claude Code continues to the next element. + * **Outside the allowlist** : an element not permitted by `availableModels` is dropped when the chain is read and never tried. + +### + +​ + +Automatic model fallback + +This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on the default Opus model and shows a notice in the transcript: Opus 4.8 on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments, or Opus 4.7 on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). The session then continues on that Opus model. To return to Fable 5, run `/model fable`. + +#### + +​ + +Check what triggered fallback + +Fallback can trigger on the first request of a session, before you send anything unusual, because the first request carries workspace context such as your CLAUDE.md content and git status. A repository that contains security or biology material can trip the classifier on that context alone. To check whether customizations are the trigger, start a session with `claude --safe-mode`, which disables customizations such as CLAUDE.md, skills, MCP servers, and hooks. Git status and directory names are not customizations and are still included. + +#### + +​ + +Ask before switching + +To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off “switch models when a message is flagged”. A flagged request then pauses the session with two options: switch to the Opus model, or edit the prompt and retry on Fable 5. Some cases behave differently: + + * If both models flag the same request, you can edit the prompt and retry, or start a new session. + * On mobile [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. + * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. + +#### + +​ + +Enable fallback on Bedrock, Vertex AI, and Foundry + +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: + + * Claude Code must recognize the current model as Fable 5: the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. + * The fallback target must resolve to an Opus model: the value of `ANTHROPIC_DEFAULT_OPUS_MODEL` if set, otherwise an Opus 4.8 entry in the provider’s model list. + +If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. To enable automatic fallback on these providers, set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable 5 model ID and `ANTHROPIC_DEFAULT_OPUS_MODEL` to your Opus 4.8 model ID. + +#### + +​ + +Security research and biology workloads + +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work, expect nearly all requests to reroute. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -177,10 +263,11 @@ Model| Levels ---|--- +Fable 5| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.8 and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Opus 4.8 or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Opus 4.8 and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. #### @@ -194,7 +281,7 @@ ---|--- `low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive `medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Balances token usage and intelligence. Default on Opus 4.8, Opus 4.6, and Sonnet 4.6 +`high`| Balances token usage and intelligence. Default on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6 `xhigh`| Deeper reasoning at higher token spend. Default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly `ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only @@ -232,7 +319,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning, as does Fable 5. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -246,9 +333,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>). Other values apply only with a fixed thinking budget - -Thinking output is collapsed by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget + +Thinking cannot be turned off on Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and Fable 5 decides per step how much to think based on the effort level. Thinking output is collapsed by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -256,7 +343,7 @@ Extended context -Opus 4.6 and later, and Sonnet 4.6, support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. On the Anthropic API, Fable 5, Opus 4.8, and Opus 4.7 always run with the 1M window. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet with 1M context ---|---|--- @@ -308,6 +395,7 @@ Environment variable| Description ---|--- +`ANTHROPIC_DEFAULT_FABLE_MODEL`| The model to use for `fable`, and the model ID Claude Code recognizes as Fable 5 for automatic model fallback on third-party providers `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) @@ -321,9 +409,9 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `sonnet`, `opus`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. - -Set all three model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. + +Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. Use the following environment variables with version-specific model IDs for your provider: @@ -333,7 +421,7 @@ Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: +Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' @@ -343,7 +431,7 @@ * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. -The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID. +The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`fable`, `opus`, `sonnet`, `haiku`), not the provider-specific model ID. ### @@ -359,7 +447,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports -The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: Capability value| Enables ---|--- @@ -409,5 +497,6 @@ `DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for Haiku models only `DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models only `DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only +`DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only To change the cache TTL or learn what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
modified
--- a/model-config.md +++ b/model-config.md @@ -321,7 +321,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model that isn’t yet enabled in a user’s account, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `sonnet`, `opus`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. Set all three model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.
modified
--- a/model-config.md +++ b/model-config.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - ## ​
modified
--- a/model-config.md +++ b/model-config.md @@ -343,7 +343,7 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' -The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. +The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases. It does not extend the plan-mode Opus phase of `opusplan`, which remains capped at 200K. * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>).
modified
Show diff (118 lines)
--- a/model-config.md +++ b/model-config.md @@ -40,9 +40,9 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name (for example, `claude-opus-4-7`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Opus 4.7 requires Claude Code v2.1.111 or later. Run `claude update` to upgrade. +On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name (for example, `claude-opus-4-8`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Opus 4.8 requires Claude Code v2.1.154 or later. Run `claude update` to upgrade. ### @@ -153,13 +153,12 @@ The behavior of `default` depends on your account type: - * **Max and Team Premium** : defaults to Opus 4.7 - * **Pro, Team Standard, Enterprise, and Anthropic API** : defaults to Sonnet 4.6 + * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8 + * **Claude Platform on AWS** : defaults to Opus 4.7 + * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 4.6 * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 -Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus. - -On April 23, 2026, the default model for Enterprise pay-as-you-go and Anthropic API users will change to Opus 4.7. To keep a different default, set `ANTHROPIC_MODEL` or the `model` field in [server-managed settings](</docs/en/server-managed-settings>). +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus. ### @@ -180,14 +179,14 @@ Adjust effort level -[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which lets the model decide whether and how much to think on each step based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Effort is supported on Opus 4.7, Opus 4.6, and Sonnet 4.6. The available levels depend on the model: +[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which lets the model decide whether and how much to think on each step based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. The available effort levels depend on the model. Models not listed here do not support effort: Model| Levels ---|--- -Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 4.8 and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. As of v2.1.117, the default effort is `xhigh` on Opus 4.7 and `high` on Opus 4.6 and Sonnet 4.6. When you first run Opus 4.7, Claude Code applies `xhigh` even if you previously set a different effort level for Opus 4.6 or Sonnet 4.6. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Opus 4.8 or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Opus 4.8 and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. #### @@ -201,9 +200,10 @@ ---|--- `low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive `medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Balances token usage and intelligence. Use as a minimum for intelligence-sensitive work, or to reduce token spend relative to `xhigh` -`xhigh`| Best results for most coding and agentic tasks. Recommended default on Opus 4.7 +`high`| Balances token usage and intelligence. Default on Opus 4.8, Opus 4.6, and Sonnet 4.6 +`xhigh`| Deeper reasoning at higher token spend. Default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly +`ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. @@ -227,7 +227,7 @@ * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` - * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` is session-only and is not accepted here + * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` and `ultracode` are session-only and are not accepted here * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. @@ -238,7 +238,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 always uses adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to it. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -262,7 +262,7 @@ Extended context -Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Opus 4.6 and later, and Sonnet 4.6, support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet with 1M context ---|---|--- @@ -277,7 +277,7 @@ /model sonnet[1m] # Or append [1m] to a full model name - /model claude-opus-4-7[1m] + /model claude-opus-4-8[1m] ## @@ -335,13 +335,13 @@ Provider| Example ---|--- -Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-7'` -Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'` -Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'` +Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'` +Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` +Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: - export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7[1m]' + export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`.
modified
--- a/model-config.md +++ b/model-config.md @@ -57,7 +57,12 @@ 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** \- Configure permanently in your settings file using the `model` field. -As of v2.1.144, `/model` applies to the current session only and is not written to settings. To save your choice as the default for new sessions, press `d` on the highlighted row in the picker, which writes the `model` field in your user settings. Managed settings take precedence and reapply on the next launch. The `--model` flag and `ANTHROPIC_MODEL` environment variable also apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session. Example usage: +As of v2.1.153, `/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: + + * `Enter`: switch model and save as your default + * `s`: switch model for this session only + +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. Example usage: # Start with Opus claude --model opus
modified
--- a/model-config.md +++ b/model-config.md @@ -312,7 +312,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>). Overrides both the per-invocation `model` parameter and the subagent definition’s `model` frontmatter +`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>) and [agent teams](</docs/en/agent-teams>). Overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
modified
--- a/model-config.md +++ b/model-config.md @@ -57,7 +57,7 @@ 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** \- Configure permanently in your settings file using the `model` field. -Your `/model` selection is saved to user settings and persists across restarts. As of v2.1.117, if the project’s `.claude/settings.json` pins a different model, Claude Code also writes your choice to `.claude/settings.local.json` so it continues to apply in that project after a restart. Managed settings take precedence and reapply on the next launch. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them and are not saved. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session. Example usage: +As of v2.1.144, `/model` applies to the current session only and is not written to settings. To save your choice as the default for new sessions, press `d` on the highlighted row in the picker, which writes the `model` field in your user settings. Managed settings take precedence and reapply on the next launch. The `--model` flag and `ANTHROPIC_MODEL` environment variable also apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If that model has been retired, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session. Example usage: # Start with Opus claude --model opus @@ -402,13 +402,13 @@ Prompt caching configuration -Claude Code automatically uses [prompt caching](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching>) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers: +Claude Code automatically uses [prompt caching](</docs/en/prompt-caching>) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers: Environment variable| Description ---|--- -`DISABLE_PROMPT_CACHING`| Set to `1` to disable prompt caching for all models (takes precedence over per-model settings) +`DISABLE_PROMPT_CACHING`| Set to `1` to disable prompt caching for all models. Takes precedence over the per-model settings `DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for Haiku models only `DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models only `DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only -These environment variables give you fine-grained control over prompt caching behavior. The global `DISABLE_PROMPT_CACHING` setting takes precedence over the model-specific settings, allowing you to quickly disable all caching when needed. The per-model settings are useful for selective control, such as when debugging specific models or working with cloud providers that may have different caching implementations. +To change the cache TTL or learn what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
modified
--- a/model-config.md +++ b/model-config.md @@ -257,15 +257,15 @@ Extended context -Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet with 1M context ---|---|--- -Max, Team, and Enterprise| Included with subscription| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) -Pro| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +Max, Team, and Enterprise| Included with subscription| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through extra usage, tokens are billed to extra usage. If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: +To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -312,7 +312,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) -`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for [subagents](</docs/en/sub-agents>) +`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>). Overrides both the per-invocation `model` parameter and the subagent definition’s `model` frontmatter Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`. @@ -338,7 +338,11 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7[1m]' -The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. Claude Code strips the suffix before sending the model ID to your provider. Only append `[1m]` when the underlying model supports 1M context, such as Opus 4.7 or Sonnet 4.6. +The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. + + * Claude Code strips the suffix before sending the model ID to your provider. + * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). + * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID.
modified
--- a/model-config.md +++ b/model-config.md @@ -222,7 +222,7 @@ * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` - * **Settings** : set `effortLevel` in your settings file + * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` is session-only and is not accepted here * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`.
modified
--- a/model-config.md +++ b/model-config.md @@ -257,7 +257,7 @@ Extended context -Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. +Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet with 1M context ---|---|---
modified
--- a/model-config.md +++ b/model-config.md @@ -40,7 +40,7 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -On the Anthropic API, `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name (for example, `claude-opus-4-7`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name (for example, `claude-opus-4-7`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. Opus 4.7 requires Claude Code v2.1.111 or later. Run `claude update` to upgrade. @@ -57,7 +57,7 @@ 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** \- Configure permanently in your settings file using the `model` field. -Your `/model` selection is saved to user settings and persists across restarts. As of v2.1.117, if the project’s `.claude/settings.json` pins a different model, Claude Code also writes your choice to `.claude/settings.local.json` so it continues to apply in that project after a restart. Managed settings take precedence and reapply on the next launch. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session. Example usage: +Your `/model` selection is saved to user settings and persists across restarts. As of v2.1.117, if the project’s `.claude/settings.json` pins a different model, Claude Code also writes your choice to `.claude/settings.local.json` so it continues to apply in that project after a restart. Managed settings take precedence and reapply on the next launch. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them and are not saved. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session. Example usage: # Start with Opus claude --model opus @@ -322,7 +322,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model that isn’t yet enabled in a user’s account, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model that isn’t yet enabled in a user’s account, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. Set all three model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.
modified
--- a/model-config.md +++ b/model-config.md @@ -18,6 +18,8 @@ * Bedrock: an inference profile ARN * Foundry: a deployment name * Vertex: a version name + +`ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateway configuration](</docs/en/llm-gateway>). ###
modified
--- a/model-config.md +++ b/model-config.md @@ -243,7 +243,7 @@ Control| How to set it ---|--- -Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux. May require [terminal configuration](</docs/en/terminal-config>) for Option-key shortcuts +Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>). Other values apply only with a fixed thinking budget @@ -289,7 +289,7 @@ Add a custom model option -Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code populates the picker automatically from the gateway’s `/v1/models` endpoint, so this variable is needed only when discovery does not return the model you want. See [LLM gateway model selection](</docs/en/llm-gateway#model-selection>). This example sets all three variables to make a gateway-routed Opus deployment selectable: +Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [LLM gateway model selection](</docs/en/llm-gateway#model-selection>). This example sets all three variables to make a gateway-routed Opus deployment selectable: export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-7" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway"
modified
--- a/model-config.md +++ b/model-config.md @@ -198,7 +198,15 @@ `xhigh`| Best results for most coding and agentic tasks. Recommended default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly -The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. For one-off deep reasoning without changing your session setting, include “ultrathink” in your prompt. This adds an in-context instruction telling the model to reason more on that turn; it does not change the effort level sent to the API. +The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. + +#### + +​ + +Use ultrathink for one-off deep reasoning + +Include `ultrathink` anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting. Claude Code recognizes the keyword and adds an in-context instruction. The effort level sent to the API is unchanged. Other phrases such as “think”, “think hard”, and “think more” are passed through as ordinary prompt text and are not recognized as keywords. #### @@ -229,6 +237,22 @@ ​ +Extended thinking + +Extended thinking is the reasoning Claude emits before responding. On models that support adaptive reasoning, the effort level is the primary control for how much thinking happens; the settings below turn thinking on or off and control how it displays. + +Control| How to set it +---|--- +Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux. May require [terminal configuration](</docs/en/terminal-config>) for Option-key shortcuts +Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` +Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>). Other values apply only with a fixed thinking budget + +Thinking output is collapsed by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. + +### + +​ + Extended context Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. @@ -330,14 +354,14 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports -The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and [extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: Capability value| Enables ---|--- `effort`| Effort levels and the `/effort` command `xhigh_effort`| The `xhigh` effort level `max_effort`| The `max` effort level -`thinking`| [Extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) +`thinking`| Extended thinking `adaptive_thinking`| Adaptive reasoning that dynamically allocates thinking based on task complexity `interleaved_thinking`| Thinking between tool calls
modified
--- a/model-config.md +++ b/model-config.md @@ -265,7 +265,7 @@ Add a custom model option -Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for LLM gateway deployments or testing model IDs that Claude Code does not list by default. This example sets all three variables to make a gateway-routed Opus deployment selectable: +Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code populates the picker automatically from the gateway’s `/v1/models` endpoint, so this variable is needed only when discovery does not return the model you want. See [LLM gateway model selection](</docs/en/llm-gateway#model-selection>). This example sets all three variables to make a gateway-routed Opus deployment selectable: export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-7" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway"
modified
--- a/model-config.md +++ b/model-config.md @@ -1,3 +1,9 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + ## ​
modified
--- a/model-config.md +++ b/model-config.md @@ -72,7 +72,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, Config tool, or `ANTHROPIC_MODEL` environment variable. +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. { "availableModels": ["sonnet", "haiku"] @@ -316,7 +316,7 @@ Customize pinned model display and capabilities -When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables only take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. They have no effect when using the Anthropic API directly. +When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. Environment variable| Description ---|---
modified
--- a/model-config.md +++ b/model-config.md @@ -49,7 +49,7 @@ 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** \- Configure permanently in your settings file using the `model` field. -Example usage: +Your `/model` selection is saved to user settings and persists across restarts. As of v2.1.117, if the project’s `.claude/settings.json` pins a different model, Claude Code also writes your choice to `.claude/settings.local.json` so it continues to apply in that project after a restart. Managed settings take precedence and reapply on the next launch. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session. Example usage: # Start with Opus claude --model opus @@ -174,7 +174,7 @@ Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. On Opus 4.7, the default effort is `xhigh` for all plans and providers. On Opus 4.6 and Sonnet 4.6, the default is `high`, or `medium` on Pro and Max. When you first run Opus 4.7, Claude Code applies `xhigh` even if you previously set a different effort level for Opus 4.6 or Sonnet 4.6. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. As of v2.1.117, the default effort is `xhigh` on Opus 4.7 and `high` on Opus 4.6 and Sonnet 4.6. When you first run Opus 4.7, Claude Code applies `xhigh` even if you previously set a different effort level for Opus 4.6 or Sonnet 4.6. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. ####
modified
--- a/model-config.md +++ b/model-config.md @@ -159,7 +159,7 @@ * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. ###
modified
Show diff (196 lines)
--- a/model-config.md +++ b/model-config.md @@ -25,14 +25,16 @@ ---|--- **`default`**| Special value that clears any model override and reverts to the recommended model for your account type. Not itself a model alias **`best`**| Uses the most capable available model, currently equivalent to `opus` -**`sonnet`**| Uses the latest Sonnet model (currently Sonnet 4.6) for daily coding tasks -**`opus`**| Uses the latest Opus model (currently Opus 4.6) for complex reasoning tasks +**`sonnet`**| Uses the latest Sonnet model for daily coding tasks +**`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks **`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -Aliases always point to the latest version. To pin to a specific version, use the full model name (for example, `claude-opus-4-6`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. +On the Anthropic API, `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name (for example, `claude-opus-4-7`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Opus 4.7 requires Claude Code v2.1.111 or later. Run `claude update` to upgrade. ### @@ -42,7 +44,7 @@ You can configure your model in several ways, listed in order of priority: - 1. **During session** \- Use `/model <alias|name>` to switch models mid-session + 1. **During session** \- Use `/model <alias|name>` to switch immediately, or run `/model` with no argument to open the picker. The picker asks for confirmation when the conversation has prior output, since the next response re-reads the full history without cached context 2. **At startup** \- Launch with `claude --model <alias|name>` 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` 4. **Settings** \- Configure permanently in your settings file using the `model` field. @@ -138,11 +140,13 @@ The behavior of `default` depends on your account type: - * **Max and Team Premium** : defaults to Opus 4.6 - * **Pro and Team Standard** : defaults to Sonnet 4.6 - * **Enterprise** : Opus 4.6 is available but not the default + * **Max and Team Premium** : defaults to Opus 4.7 + * **Pro, Team Standard, Enterprise, and Anthropic API** : defaults to Sonnet 4.6 + * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus. + +On April 23, 2026, the default model for Enterprise pay-as-you-go and Anthropic API users will change to Opus 4.7. To keep a different default, set `ANTHROPIC_MODEL` or the `model` field in [server-managed settings](</docs/en/server-managed-settings>). ### @@ -163,16 +167,57 @@ Adjust effort level -[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Three levels persist across sessions: **low** , **medium** , and **high**. A fourth level, **max** , provides the deepest reasoning with no constraint on token spending, so responses are slower and cost more than at `high`. `max` is available on Opus 4.6 only and does not persist across sessions except through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The default effort level depends on your plan. Pro and Max subscribers default to medium effort. All other users default to high effort: API key, Team, Enterprise, and third-party provider (Bedrock, Vertex AI, Foundry) users. Your plan’s default suits most coding tasks. Raise effort for work that benefits from deeper reasoning, such as hard debugging problems or complex architectural decisions. Higher levels can cause the model to overthink routine work. For one-off deep reasoning without changing your session setting, include “ultrathink” in your prompt to trigger high effort for that turn. This has no effect if your session is already at high or max. **Setting effort:** - - * **`/effort`** : run `/effort low`, `/effort medium`, `/effort high`, or `/effort max` to change the level, or `/effort auto` to reset to the model default +[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which lets the model decide whether and how much to think on each step based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Effort is supported on Opus 4.7, Opus 4.6, and Sonnet 4.6. The available levels depend on the model: + +Model| Levels +---|--- +Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` + +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. On Opus 4.7, the default effort is `xhigh` for all plans and providers. On Opus 4.6 and Sonnet 4.6, the default is `high`, or `medium` on Pro and Max. When you first run Opus 4.7, Claude Code applies `xhigh` even if you previously set a different effort level for Opus 4.6 or Sonnet 4.6. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. + +#### + +​ + +Choose an effort level + +Each level trades token spend against capability. The default suits most coding tasks; adjust when you want a different balance. + +Level| When to use it +---|--- +`low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive +`medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence +`high`| Balances token usage and intelligence. Use as a minimum for intelligence-sensitive work, or to reduce token spend relative to `xhigh` +`xhigh`| Best results for most coding and agentic tasks. Recommended default on Opus 4.7 +`max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly + +The effort scale is calibrated per model, so the same level name does not represent the same underlying value across models. For one-off deep reasoning without changing your session setting, include “ultrathink” in your prompt. This adds an in-context instruction telling the model to reason more on that turn; it does not change the effort level sent to the API. + +#### + +​ + +Set the effort level + +You can change effort through any of the following: + + * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to reset to the model default * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model - * **`--effort` flag**: pass `low`, `medium`, `high`, or `max` to set the level for a single session when launching Claude Code - * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to `low`, `medium`, `high`, `max`, or `auto` - * **Settings** : set `effortLevel` in your settings file to `"low"`, `"medium"`, or `"high"` + * **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code + * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto` + * **Settings** : set `effortLevel` in your settings file * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs -The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. Effort is supported on Opus 4.6 and Sonnet 4.6. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. To disable adaptive reasoning on Opus 4.6 and Sonnet 4.6 and revert to the previous fixed thinking budget, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1`. When disabled, these models use the fixed budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. + +#### + +​ + +Adaptive reasoning and fixed thinking budgets + +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 always uses adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to it. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -180,9 +225,9 @@ Extended context -Opus 4.6 and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. - -Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context +Opus 4.7, Opus 4.6, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. + +Plan| Opus with 1M context| Sonnet with 1M context ---|---|--- Max, Team, and Enterprise| Included with subscription| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) Pro| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) @@ -195,7 +240,7 @@ /model sonnet[1m] # Or append [1m] to a full model name - /model claude-opus-4-6[1m] + /model claude-opus-4-7[1m] ## @@ -216,7 +261,7 @@ Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for LLM gateway deployments or testing model IDs that Claude Code does not list by default. This example sets all three variables to make a gateway-routed Opus deployment selectable: - export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-6" + export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-7" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" @@ -253,15 +298,15 @@ Provider| Example ---|--- -Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-6-v1'` -Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` -Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` +Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-7'` +Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'` +Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'` Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: - export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]' - -The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. Claude Code strips the suffix before sending the model ID to your provider. Only append `[1m]` when the underlying model supports 1M context, such as Opus 4.6 or Sonnet 4.6. + export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7[1m]' + +The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. Claude Code strips the suffix before sending the model ID to your provider. Only append `[1m]` when the underlying model supports 1M context, such as Opus 4.7 or Sonnet 4.6. The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID. @@ -284,6 +329,7 @@ Capability value| Enables ---|--- `effort`| Effort levels and the `/effort` command +`xhigh_effort`| The `xhigh` effort level `max_effort`| The `max` effort level `thinking`| [Extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) `adaptive_thinking`| Adaptive reasoning that dynamically allocates thinking based on task complexity @@ -293,8 +339,8 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc' export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock' - export ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION='Opus 4.6 routed through a Bedrock custom endpoint' - export ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES='effort,max_effort,thinking,adaptive_thinking,interleaved_thinking' + export ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION='Opus 4.7 routed through a Bedrock custom endpoint' + export ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES='effort,xhigh_effort,max_effort,thinking,adaptive_thinking,interleaved_thinking' ### @@ -306,8 +352,8 @@ { "modelOverrides": { - "claude-opus-4-6": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod", - "claude-opus-4-5-20251101": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-45-prod", + "claude-opus-4-7": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod", + "claude-opus-4-6": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-46-prod", "claude-sonnet-4-6": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/sonnet-prod" } }
modified
--- a/model-config.md +++ b/model-config.md @@ -279,7 +279,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports -The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Claude Code enables features like effort levels and [extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and [extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: Capability value| Enables ---|---
modified
--- a/model-config.md +++ b/model-config.md @@ -245,9 +245,9 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model, users whose accounts don’t have the new version enabled will break silently. - -Set all three model environment variables to specific version IDs as part of your initial setup. Skipping this step means a Claude Code update can break your users without any action on your part. +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model that isn’t yet enabled in a user’s account, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. + +Set all three model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. Use the following environment variables with version-specific model IDs for your provider:
modified
--- a/model-config.md +++ b/model-config.md @@ -116,6 +116,14 @@ When `availableModels` is set at multiple levels, such as user settings and project settings, arrays are merged and deduplicated. To enforce a strict allowlist, set `availableModels` in managed or policy settings which take highest priority. +### + +​ + +Mantle model IDs + +When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias-only matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, so include the standard aliases alongside any Mantle IDs. + ## ​ @@ -155,7 +163,7 @@ Adjust effort level -[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Three levels persist across sessions: **low** , **medium** , and **high**. A fourth level, **max** , provides the deepest reasoning with no constraint on token spending, so responses are slower and cost more than at `high`. `max` is available on Opus 4.6 only and does not persist across sessions except through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. Opus 4.6 and Sonnet 4.6 default to medium effort. This applies to all providers, including Bedrock, Vertex AI, and direct API access. Medium is the recommended level for most coding tasks: it balances speed and reasoning depth, and higher levels can cause the model to overthink routine work. Reserve `high` or `max` for tasks that genuinely benefit from deeper reasoning, such as hard debugging problems or complex architectural decisions. For one-off deep reasoning without changing your session setting, include “ultrathink” in your prompt to trigger high effort for that turn. **Setting effort:** +[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Three levels persist across sessions: **low** , **medium** , and **high**. A fourth level, **max** , provides the deepest reasoning with no constraint on token spending, so responses are slower and cost more than at `high`. `max` is available on Opus 4.6 only and does not persist across sessions except through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The default effort level depends on your plan. Pro and Max subscribers default to medium effort. All other users default to high effort: API key, Team, Enterprise, and third-party provider (Bedrock, Vertex AI, Foundry) users. Your plan’s default suits most coding tasks. Raise effort for work that benefits from deeper reasoning, such as hard debugging problems or complex architectural decisions. Higher levels can cause the model to overthink routine work. For one-off deep reasoning without changing your session setting, include “ultrathink” in your prompt to trigger high effort for that turn. This has no effect if your session is already at high or max. **Setting effort:** * **`/effort`** : run `/effort low`, `/effort medium`, `/effort high`, or `/effort max` to change the level, or `/effort auto` to reset to the model default * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model
modified
--- a/model-config.md +++ b/model-config.md @@ -23,7 +23,8 @@ Model alias| Behavior ---|--- -**`default`**| Recommended model setting, depending on your account type +**`default`**| Special value that clears any model override and reverts to the recommended model for your account type. Not itself a model alias +**`best`**| Uses the most capable available model, currently equivalent to `opus` **`sonnet`**| Uses the latest Sonnet model (currently Sonnet 4.6) for daily coding tasks **`opus`**| Uses the latest Opus model (currently Opus 4.6) for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks
modified
--- a/model-config.md +++ b/model-config.md @@ -89,17 +89,23 @@ Control the model users run on -To fully control the model experience, use `availableModels` together with the `model` setting: - - * **availableModels** : restricts what users can switch to - * **model** : sets the explicit model override, taking precedence over the Default - -This example ensures all users run Sonnet 4.6 and can only choose between Sonnet and Haiku: +The `model` setting is an initial selection, not enforcement. It sets which model is active when a session starts, but users can still open `/model` and pick Default, which resolves to the system default for their tier regardless of what `model` is set to. To fully control the model experience, combine three settings: + + * **`availableModels`** : restricts which named models users can switch to + * **`model`** : sets the initial model selection when a session starts + * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** : control what the Default option and the `sonnet`, `opus`, and `haiku` aliases resolve to + +This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and pins Default to resolve to Sonnet 4.5 rather than the latest release: { - "model": "sonnet", - "availableModels": ["sonnet", "haiku"] + "model": "claude-sonnet-4-5", + "availableModels": ["claude-sonnet-4-5", "haiku"], + "env": { + "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5" + } } + +Without the `env` block, a user who selects Default in the picker would get the latest Sonnet release, bypassing the version pin in `model` and `availableModels`. ###
modified
Show diff (119 lines)
--- a/model-config.md +++ b/model-config.md @@ -48,12 +48,6 @@ Example usage: -Report incorrect code - -Copy - -Ask AI - # Start with Opus claude --model opus @@ -61,12 +55,6 @@ /model sonnet Example settings file: - -Report incorrect code - -Copy - -Ask AI { "permissions": { @@ -83,12 +71,6 @@ Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, Config tool, or `ANTHROPIC_MODEL` environment variable. -Report incorrect code - -Copy - -Ask AI - { "availableModels": ["sonnet", "haiku"] } @@ -113,12 +95,6 @@ * **model** : sets the explicit model override, taking precedence over the Default This example ensures all users run Sonnet 4.6 and can only choose between Sonnet and Haiku: - -Report incorrect code - -Copy - -Ask AI { "model": "sonnet", @@ -199,12 +175,6 @@ To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through extra usage, tokens are billed to extra usage. If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: -Report incorrect code - -Copy - -Ask AI - # Use the opus[1m] or sonnet[1m] alias /model opus[1m] /model sonnet[1m] @@ -230,12 +200,6 @@ Add a custom model option Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for LLM gateway deployments or testing model IDs that Claude Code does not list by default. This example sets all three variables to make a gateway-routed Opus deployment selectable: - -Report incorrect code - -Copy - -Ask AI export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-6" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" @@ -279,12 +243,6 @@ Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: - -Report incorrect code - -Copy - -Ask AI export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]' @@ -318,12 +276,6 @@ When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to a Bedrock custom model ARN, sets a friendly name, and declares its capabilities: -Report incorrect code - -Copy - -Ask AI - export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc' export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock' export ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION='Opus 4.6 routed through a Bedrock custom endpoint' @@ -336,12 +288,6 @@ Override model IDs per version The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Bedrock inference profile ARN, Vertex AI version name, or Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): - -Report incorrect code - -Copy - -Ask AI { "modelOverrides": {
modified
--- a/model-config.md +++ b/model-config.md @@ -172,7 +172,7 @@ Adjust effort level -[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Three levels persist across sessions: **low** , **medium** , and **high**. A fourth level, **max** , provides the deepest reasoning with no constraint on token spending, so responses are slower and cost more than at `high`. `max` is available on Opus 4.6 only and applies to the current session without persisting. Opus 4.6 defaults to medium effort for Max and Team subscribers. **Setting effort:** +[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Three levels persist across sessions: **low** , **medium** , and **high**. A fourth level, **max** , provides the deepest reasoning with no constraint on token spending, so responses are slower and cost more than at `high`. `max` is available on Opus 4.6 only and does not persist across sessions except through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. Opus 4.6 and Sonnet 4.6 default to medium effort. This applies to all providers, including Bedrock, Vertex AI, and direct API access. Medium is the recommended level for most coding tasks: it balances speed and reasoning depth, and higher levels can cause the model to overthink routine work. Reserve `high` or `max` for tasks that genuinely benefit from deeper reasoning, such as hard debugging problems or complex architectural decisions. For one-off deep reasoning without changing your session setting, include “ultrathink” in your prompt to trigger high effort for that turn. **Setting effort:** * **`/effort`** : run `/effort low`, `/effort medium`, `/effort high`, or `/effort max` to change the level, or `/effort auto` to reset to the model default * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model @@ -291,6 +291,43 @@ The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. Claude Code strips the suffix before sending the model ID to your provider. Only append `[1m]` when the underlying model supports 1M context, such as Opus 4.6 or Sonnet 4.6. The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID. + +### + +​ + +Customize pinned model display and capabilities + +When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables only take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. They have no effect when using the Anthropic API directly. + +Environment variable| Description +---|--- +`ANTHROPIC_DEFAULT_OPUS_MODEL_NAME`| Display name for the pinned Opus model in the `/model` picker. Defaults to the model ID when not set +`ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set +`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports + +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Claude Code enables features like effort levels and [extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: + +Capability value| Enables +---|--- +`effort`| Effort levels and the `/effort` command +`max_effort`| The `max` effort level +`thinking`| [Extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) +`adaptive_thinking`| Adaptive reasoning that dynamically allocates thinking based on task complexity +`interleaved_thinking`| Thinking between tool calls + +When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to a Bedrock custom model ARN, sets a friendly name, and declares its capabilities: + +Report incorrect code + +Copy + +Ask AI + + export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc' + export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock' + export ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION='Opus 4.6 routed through a Bedrock custom endpoint' + export ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES='effort,max_effort,thinking,adaptive_thinking,interleaved_thinking' ###
added
Show diff (337 lines)
--- a/model-config.md +++ b/model-config.md @@ -0,0 +1,334 @@ +## + +​ + +Available models + +For the `model` setting in Claude Code, you can configure either: + + * A **model alias** + * A **model name** + * Anthropic API: A full **[model name](<https://platform.claude.com/docs/en/about-claude/models/overview>)** + * Bedrock: an inference profile ARN + * Foundry: a deployment name + * Vertex: a version name + +### + +​ + +Model aliases + +Model aliases provide a convenient way to select model settings without remembering exact version numbers: + +Model alias| Behavior +---|--- +**`default`**| Recommended model setting, depending on your account type +**`sonnet`**| Uses the latest Sonnet model (currently Sonnet 4.6) for daily coding tasks +**`opus`**| Uses the latest Opus model (currently Opus 4.6) for complex reasoning tasks +**`haiku`**| Uses the fast and efficient Haiku model for simple tasks +**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions +**`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions +**`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution + +Aliases always point to the latest version. To pin to a specific version, use the full model name (for example, `claude-opus-4-6`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +### + +​ + +Setting your model + +You can configure your model in several ways, listed in order of priority: + + 1. **During session** \- Use `/model <alias|name>` to switch models mid-session + 2. **At startup** \- Launch with `claude --model <alias|name>` + 3. **Environment variable** \- Set `ANTHROPIC_MODEL=<alias|name>` + 4. **Settings** \- Configure permanently in your settings file using the `model` field. + +Example usage: + +Report incorrect code + +Copy + +Ask AI + + # Start with Opus + claude --model opus + + # Switch to Sonnet during session + /model sonnet + +Example settings file: + +Report incorrect code + +Copy + +Ask AI + + { + "permissions": { + ... + }, + "model": "opus" + } + +## + +​ + +Restrict model selection + +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, Config tool, or `ANTHROPIC_MODEL` environment variable. + +Report incorrect code + +Copy + +Ask AI + + { + "availableModels": ["sonnet", "haiku"] + } + +### + +​ + +Default model behavior + +The Default option in the model picker is not affected by `availableModels`. It always remains available and represents the system’s runtime default based on the user’s subscription tier. Even with `availableModels: []`, users can still use Claude Code with the Default model for their tier. + +### + +​ + +Control the model users run on + +To fully control the model experience, use `availableModels` together with the `model` setting: + + * **availableModels** : restricts what users can switch to + * **model** : sets the explicit model override, taking precedence over the Default + +This example ensures all users run Sonnet 4.6 and can only choose between Sonnet and Haiku: + +Report incorrect code + +Copy + +Ask AI + + { + "model": "sonnet", + "availableModels": ["sonnet", "haiku"] + } + +### + +​ + +Merge behavior + +When `availableModels` is set at multiple levels, such as user settings and project settings, arrays are merged and deduplicated. To enforce a strict allowlist, set `availableModels` in managed or policy settings which take highest priority. + +## + +​ + +Special model behavior + +### + +​ + +`default` model setting + +The behavior of `default` depends on your account type: + + * **Max and Team Premium** : defaults to Opus 4.6 + * **Pro and Team Standard** : defaults to Sonnet 4.6 + * **Enterprise** : Opus 4.6 is available but not the default + +Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus. + +### + +​ + +`opusplan` model setting + +The `opusplan` model alias provides an automated hybrid approach: + + * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions + * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation + +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. + +### + +​ + +Adjust effort level + +[Effort levels](<https://platform.claude.com/docs/en/build-with-claude/effort>) control adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems. Three levels persist across sessions: **low** , **medium** , and **high**. A fourth level, **max** , provides the deepest reasoning with no constraint on token spending, so responses are slower and cost more than at `high`. `max` is available on Opus 4.6 only and applies to the current session without persisting. Opus 4.6 defaults to medium effort for Max and Team subscribers. **Setting effort:** + + * **`/effort`** : run `/effort low`, `/effort medium`, `/effort high`, or `/effort max` to change the level, or `/effort auto` to reset to the model default + * **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model + * **`--effort` flag**: pass `low`, `medium`, `high`, or `max` to set the level for a single session when launching Claude Code + * **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to `low`, `medium`, `high`, `max`, or `auto` + * **Settings** : set `effortLevel` in your settings file to `"low"`, `"medium"`, or `"high"` + * **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs + +The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. Effort is supported on Opus 4.6 and Sonnet 4.6. The effort slider appears in `/model` when a supported model is selected. The current effort level is also displayed next to the logo and spinner, for example “with low effort”, so you can confirm which setting is active without opening `/model`. To disable adaptive reasoning on Opus 4.6 and Sonnet 4.6 and revert to the previous fixed thinking budget, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1`. When disabled, these models use the fixed budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). + +### + +​ + +Extended context + +Opus 4.6 and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. + +Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context +---|---|--- +Max, Team, and Enterprise| Included with subscription| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +Pro| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +API and pay-as-you-go| Full access| Full access + +To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through extra usage, tokens are billed to extra usage. If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: + +Report incorrect code + +Copy + +Ask AI + + # Use the opus[1m] or sonnet[1m] alias + /model opus[1m] + /model sonnet[1m] + + # Or append [1m] to a full model name + /model claude-opus-4-6[1m] + +## + +​ + +Checking your current model + +You can see which model you’re currently using in several ways: + + 1. In [status line](</docs/en/statusline>) (if configured) + 2. In `/status`, which also displays your account information. + +## + +​ + +Add a custom model option + +Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for LLM gateway deployments or testing model IDs that Claude Code does not list by default. This example sets all three variables to make a gateway-routed Opus deployment selectable: + +Report incorrect code + +Copy + +Ask AI + + export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-6" + export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway" + export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway" + +The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If omitted, the model ID is used as the name and the description defaults to `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. + +## + +​ + +Environment variables + +You can use the following environment variables, which must be full **model names** (or equivalent for your API provider), to control the model names that the aliases map to. + +Environment variable| Description +---|--- +`ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. +`ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. +`ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) +`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for [subagents](</docs/en/sub-agents>) + +Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`. + +### + +​ + +Pin models for third-party deployments + +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model, users whose accounts don’t have the new version enabled will break silently. + +Set all three model environment variables to specific version IDs as part of your initial setup. Skipping this step means a Claude Code update can break your users without any action on your part. + +Use the following environment variables with version-specific model IDs for your provider: + +Provider| Example +---|--- +Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-6-v1'` +Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` +Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` + +Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: + +Report incorrect code + +Copy + +Ask AI + + export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]' + +The `[1m]` suffix applies the 1M context window to all usage of that alias, including `opusplan`. Claude Code strips the suffix before sending the model ID to your provider. Only append `[1m]` when the underlying model supports 1M context, such as Opus 4.6 or Sonnet 4.6. + +The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID. + +### + +​ + +Override model IDs per version + +The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Bedrock inference profile ARN, Vertex AI version name, or Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): + +Report incorrect code + +Copy + +Ask AI + + { + "modelOverrides": { + "claude-opus-4-6": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod", + "claude-opus-4-5-20251101": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-45-prod", + "claude-sonnet-4-6": "arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/sonnet-prod" + } + } + +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Bedrock, overrides take precedence over any inference profiles that Claude Code discovers automatically at startup. Values you supply directly through `ANTHROPIC_MODEL`, `--model`, or the `ANTHROPIC_DEFAULT_*_MODEL` environment variables are passed to the provider as-is and are not transformed by `modelOverrides`. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. + +### + +​ + +Prompt caching configuration + +Claude Code automatically uses [prompt caching](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching>) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers: + +Environment variable| Description +---|--- +`DISABLE_PROMPT_CACHING`| Set to `1` to disable prompt caching for all models (takes precedence over per-model settings) +`DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for Haiku models only +`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models only +`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only + +These environment variables give you fine-grained control over prompt caching behavior. The global `DISABLE_PROMPT_CACHING` setting takes precedence over the model-specific settings, allowing you to quickly disable all caching when needed. The per-model settings are useful for selective control, such as when debugging specific models or working with cloud providers that may have different caching implementations.