Documents
Model and Effort Configuration
Model and Effort Configuration
Type
Topic
Status
Published
Created
May 29, 2026
Updated
May 29, 2026

Model and Effort Configuration#

Claude Code exposes two orthogonal knobs for tuning every API call: which model to use and how much compute effort to spend per response. Both can be set globally or scoped to individual subagents, skills, or sessions. The authoritative reference is the Model configuration doc.


Model Selection#

Aliases and full model IDs#

The model setting accepts either a model alias or a full model name (e.g., claude-opus-4-8):

AliasBehavior
defaultClears any override; reverts to the recommended model for your account type
best / opusMost capable model (Opus 4.8 on Anthropic API)
sonnetBalanced model for daily coding
haikuFast and cheap for simple tasks
sonnet[1m] / opus[1m]Same model with 1M token context window
opusplanOpus during plan mode, Sonnet for execution

Aliases resolve to different specific versions depending on the provider (Anthropic API, Bedrock, Vertex, Foundry). Use a full model name to pin to a specific version .

Configuration priority (highest → lowest)#

  1. CLAUDE_CODE_SUBAGENT_MODEL env var — overrides model for all subagents and agent teams
  2. /model slash command — switches immediately; as of v2.1.153 saves as user default. Press s in the picker to switch for the current session only
  3. --model CLI flag — applies to the launched session only
  4. ANTHROPIC_MODEL env var — session-scoped override
  5. model field in settings — persistent default in ~/.claude/settings.json or project settings
  6. model frontmatter in subagent/skill — scoped to that agent or skill invocation

Alias resolution env vars#

To control what each alias maps to (e.g., on Bedrock or Vertex), use:

Env varControls
ANTHROPIC_DEFAULT_OPUS_MODELopus alias; also opusplan in plan mode
ANTHROPIC_DEFAULT_SONNET_MODELsonnet alias; also opusplan in execution mode
ANTHROPIC_DEFAULT_HAIKU_MODELhaiku alias and background/helper tasks

Enterprise model restrictions#

Admins can use availableModels in managed settings to restrict which models users can select in /model . The default option always remains available. Combine availableModels, model, and the alias env vars to fully control model routing.


Effort Level#

Effort controls adaptive reasoning — how much thinking the model applies per step. Higher effort → deeper reasoning, more tokens, higher cost.

Available levels#

LevelNotes
lowFastest; for latency-sensitive, non-intelligence-sensitive tasks
mediumReduced token use; some quality trade-off
highDefault on Opus 4.8, Opus 4.6, Sonnet 4.6
xhighDeeper reasoning; default on Opus 4.7; also available on Opus 4.8, Opus 4.6, Sonnet 4.6
maxSession-only; maximum reasoning budget, prone to overthinking
ultracodeSession-only; sends xhigh + activates dynamic workflow orchestration

Not all levels are available on every model — unsupported levels fall back to the nearest supported one .

Configuration priority (highest → lowest)#

  1. CLAUDE_CODE_EFFORT_LEVEL env var — overrides all other methods
  2. /effort slash command — interactive slider or effort <level> directly; /effort auto resets to model default
  3. --effort CLI flag — session-scoped
  4. effortLevel in settings — persistent; accepts low, medium, high, xhigh only (max and ultracode are session-only)
  5. effort frontmatter in subagent/skill — overrides session effort while that agent is active, but not the env var
  6. Model defaulthigh on Opus 4.8/4.6/Sonnet 4.6; xhigh on Opus 4.7

The current effort level is shown next to the logo/spinner (e.g., "with low effort") without opening /model .

One-off overrides#

  • ultrathink keyword in a prompt requests deeper reasoning for that turn without changing the session effort setting .
  • The effort slider is also accessible within the /model picker using left/right arrow keys .

Subagent / Skill Frontmatter#

Both subagent and skill markdown files accept model and effort in their YAML frontmatter . The subagent's model field accepts inherit (default), sonnet, opus, haiku, or a full model ID . Model resolution order for subagents: CLAUDE_CODE_SUBAGENT_MODEL env var → per-invocation parameter → model frontmatter → parent session model .


Key References#