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):
| Alias | Behavior |
|---|---|
default | Clears any override; reverts to the recommended model for your account type |
best / opus | Most capable model (Opus 4.8 on Anthropic API) |
sonnet | Balanced model for daily coding |
haiku | Fast and cheap for simple tasks |
sonnet[1m] / opus[1m] | Same model with 1M token context window |
opusplan | Opus 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)#
CLAUDE_CODE_SUBAGENT_MODELenv var — overrides model for all subagents and agent teams/modelslash command — switches immediately; as of v2.1.153 saves as user default. Presssin the picker to switch for the current session only--modelCLI flag — applies to the launched session onlyANTHROPIC_MODELenv var — session-scoped overridemodelfield in settings — persistent default in~/.claude/settings.jsonor project settingsmodelfrontmatter 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 var | Controls |
|---|---|
ANTHROPIC_DEFAULT_OPUS_MODEL | opus alias; also opusplan in plan mode |
ANTHROPIC_DEFAULT_SONNET_MODEL | sonnet alias; also opusplan in execution mode |
ANTHROPIC_DEFAULT_HAIKU_MODEL | haiku 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#
| Level | Notes |
|---|---|
low | Fastest; for latency-sensitive, non-intelligence-sensitive tasks |
medium | Reduced token use; some quality trade-off |
high | Default on Opus 4.8, Opus 4.6, Sonnet 4.6 |
xhigh | Deeper reasoning; default on Opus 4.7; also available on Opus 4.8, Opus 4.6, Sonnet 4.6 |
max | Session-only; maximum reasoning budget, prone to overthinking |
ultracode | Session-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)#
CLAUDE_CODE_EFFORT_LEVELenv var — overrides all other methods/effortslash command — interactive slider oreffort <level>directly;/effort autoresets to model default--effortCLI flag — session-scopedeffortLevelin settings — persistent; acceptslow,medium,high,xhighonly (maxandultracodeare session-only)effortfrontmatter in subagent/skill — overrides session effort while that agent is active, but not the env var- Model default —
highon Opus 4.8/4.6/Sonnet 4.6;xhighon 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#
ultrathinkkeyword in a prompt requests deeper reasoning for that turn without changing the session effort setting .- The effort slider is also accessible within the
/modelpicker 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#
- Model configuration docs — full alias table, env vars,
availableModels, extended context,opusplan - Manage costs effectively —
/usage,model: haikufor agents,/efforttuning - Create custom subagents —
modelandeffortfrontmatter fields, resolution order - Agent development SKILL.md — frontmatter schema for plugin agents
- CHANGELOG.md — per-version flag introductions (search
CLAUDE_CODE_EFFORT_LEVEL,ANTHROPIC_MODEL)