SpyBara
Go Premium

model-config.md 2026-02-04 21:07 UTC to 2026-02-05 21:06 UTC

40 added, 14 removed.

2026
Sat 28 21:01 Fri 27 21:05 Thu 26 21:08 Wed 25 03:47 Tue 24 21:08 Mon 23 21:13 Sat 21 18:03 Fri 20 21:03 Thu 19 21:06 Wed 18 03:48 Tue 17 21:08 Mon 16 21:05 Sat 14 03:44 Fri 13 21:09 Thu 12 00:06 Wed 11 21:10 Tue 10 21:13 Mon 9 15:17 Sat 7 21:05 Fri 6 21:06 Thu 5 21:06 Wed 4 21:07 Tue 3 21:08 Sun 1 21:03

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 alias Behavior
default Recommended model setting, depending on your account type
sonnet Uses the latest Sonnet model (currently Sonnet 4.5) 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 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-5-20251101) 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:

# Start with Opus
claude --model opus

# Switch to Sonnet during session
/model sonnet

Example settings file:

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

Special model behavior

default model setting

The behavior of default depends on your account type:

  • Max and Teams: defaults to Opus 4.6
  • Pro: defaults to Opus 4.6 in Claude Code
  • 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 control Opus 4.6's 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 are available: low, medium, and high (default).

Setting effort:

  • In /model: use left/right arrow keys to adjust the effort slider when selecting a model
  • Environment variable: set CLAUDE_CODE_EFFORT_LEVEL=low|medium|high
  • Settings: set effortLevel in your settings file

Effort is currently supported on Opus 4.6. The effort slider appears in /model when a supported model is selected.

Extended context with [1m]

The [1m] suffix enables a 1 million token context window for long sessions.

You can use the [1m] suffix with model aliases or full model names:

# Use the sonnet[1m] alias
/model sonnet[1m]

# Or append [1m] to a full model name
/model claude-sonnet-4-5-20250929[1m]

Note: Extended context models have different pricing.

Checking your current model

You can see which model you're currently using in several ways:

  1. In status line (if configured)
  2. In /status, which also displays your account information.

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
CLAUDE_CODE_SUBAGENT_MODEL The model to use for subagents

Note: ANTHROPIC_SMALL_FAST_MODEL is deprecated in favor of ANTHROPIC_DEFAULT_HAIKU_MODEL.

Prompt caching configuration

Claude Code automatically uses 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.