All skills
Skillintermediate

Model configuration

> ## 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.

Claude Code Knowledge Pack7/10/2026

Overview

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.

Model configuration

Learn about the Claude Code model configuration, including model aliases like opusplan

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
    • 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 aliasBehavior
defaultSpecial value that clears any model override and reverts to the recommended model for your account type. Not itself a model alias
bestUses the most capable available model, currently equivalent to opus
sonnetUses the latest Sonnet model for daily coding tasks
opusUses the latest Opus model for complex reasoning tasks
haikuUses the fast and efficient Haiku model for simple tasks
sonnet[1m]Uses Sonnet with a 1 million token context window for long sessions
opus[1m]Uses Opus with a 1 million token context window for long sessions
opusplanSpecial 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.

Opus 4.7 requires Claude Code v2.1.111 or later. Run claude update to upgrade.

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 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.

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

# Switch to Sonnet during session
/model sonnet

Example settings file:

{
    "permissions": {
        ...
    },
    "model": "opus"
}

Restrict model selection

Enterprise administrators can use availableModels in managed or policy settings 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"]
}

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

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": "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.

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.

Mantle model IDs

When the Bedrock 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.

Special model behavior

default model setting

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
  • 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.

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.

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.

Adjust effort level

Effort levels 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:

ModelLevels
Opus 4.7low, medium, high, xhigh, max
Opus 4.6 and Sonnet 4.6low, 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.

Choose an effort level

Each level trades token spend against capability. The default suits most coding tasks; adjust when you want a different balance.

LevelWhen to use it
lowReserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive
mediumReduces token usage for cost-sensitive work that can trade off some intelligence
highBalances token usage and intelligence. Use as a minimum for intelligence-sensitive work, or to reduce token spend relative to xhigh
xhighBest results for most coding and agentic tasks. Recommended default on Opus 4.7
maxCan 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 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 or subagent 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.

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.

Extended context

Opus 4.7, Opus 4.6, and Sonnet 4.6 support a 1 million 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.

PlanOpus with 1M contextSonnet with 1M context
Max, Team, and EnterpriseIncluded with subscription