Skip to main content

Models and Effort

These variables choose which model Claude Code uses and how hard it thinks. They also pin what the aliases opus, sonnet, haiku, and fable mean, add your own entry to the /model picker, and limit output size. Use them when you want the same model in every session or when a gateway needs custom model IDs.

This page lists 84 variables. A --model flag or /model overrides ANTHROPIC_MODEL. CLAUDE_CODE_EFFORT_LEVEL overrides --effort and /effort.

Exampleโ€‹

~/.claude/settings.json
{
"env": {
"ANTHROPIC_MODEL": "opus",
"CLAUDE_CODE_EFFORT_LEVEL": "high"
}
}

Every new session starts on the opus alias with high effort.

Variablesโ€‹

The table is sorted by name. See Environment Variables for what each column and badge means.

VariableStatusWhat it doesValues and defaultNotes
ANTHROPIC_BETASDocumentedAdds extra anthropic-beta values to API requests.Text. Ignored with a debug message when the org policy turns off experimental betasAll sessions. Not set from project env before trust
ANTHROPIC_CUSTOM_MODEL_OPTIONDocumentedAdds this model ID as an extra entry in the /model picker. Claude Code also accepts it as a valid model.Text. The entry does not appear twice if the ID is already listedModel picker, all. Project env can set it before trust
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTIONDocumentedSets the picker description for the custom model entry.Text. Default is Custom model (<id>)Model picker, all. Project env can set it before trust
ANTHROPIC_CUSTOM_MODEL_OPTION_NAMEDocumentedSets the picker label for the custom model entry.Text. Without it, the label is the known model name or the model IDModel picker, all. Project env can set it before trust
ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIESDocumentedLists the capabilities of the custom model, such as effort,thinking.A comma-separated list. A table pairs each model var with its capabilities var and reads it by nameModel picker and capability checks. Project env can set it before trust
ANTHROPIC_DEFAULT_FABLE_MODELDocumentedSets the model ID that the fable alias resolves to. A set value also makes Fable available.Text. The picker row for fable shows only when the model picker check passesAll sessions. Project env can set it before trust
ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTIONDocumentedSets the picker description of the pinned Fable model.Text, starts by defaultModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_FABLE_MODEL_NAMEDocumentedSets the picker name of the pinned Fable model.Text. Used only when ANTHROPIC_DEFAULT_FABLE_MODEL is setModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIESDocumentedLists the capabilities of the pinned Fable model, such as effort,thinking.A comma-separated list. A table pairs each model var with its capabilities var and reads it by nameModel capability checks. Project env can set it before trust
ANTHROPIC_DEFAULT_HAIKU_MODELDocumentedSets the model ID that the haiku alias resolves to. It also marks the small fast model as set.TextAll sessions. Project env can set it before trust
ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTIONDocumentedSets the picker description of the pinned Haiku model.Text, starts by defaultModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_HAIKU_MODEL_NAMEDocumentedSets the picker name of the pinned Haiku model.Text. Used only when ANTHROPIC_DEFAULT_HAIKU_MODEL is setModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIESDocumentedLists the capabilities of the pinned Haiku model, such as effort,thinking.A comma-separated list. A table pairs each model var with its capabilities var and reads it by nameModel capability checks. Project env can set it before trust
ANTHROPIC_DEFAULT_MODELDocumentedSets the model that new sessions start on.Text. Trimmed. default and inherit are handled as special valuesAll sessions. Project env can set it before trust
ANTHROPIC_DEFAULT_OPUS_MODELDocumentedSets the model ID that the opus alias resolves to.Text. Claude Code compares it with a seeded value (CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT) to see if it set the value itselfAll sessions. Project env can set it before trust
ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTIONDocumentedSets the picker description of the pinned Opus model.Text, starts by default. Claude Code sets it for a Bedrock cross-tier fallbackModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_OPUS_MODEL_NAMEDocumentedSets the picker name of the pinned Opus model.TextModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIESDocumentedLists the capabilities of the pinned Opus model, such as effort,thinking.A comma-separated list. A table pairs each model var with its capabilities var and reads it by nameModel capability checks. Project env can set it before trust
ANTHROPIC_DEFAULT_SONNET_MODELDocumentedSets the model ID that the sonnet alias resolves to.Text. Claude Code compares it with a seeded value (CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT) to see if it set the value itselfAll sessions. Project env can set it before trust
ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTIONDocumentedSets the picker description of the pinned Sonnet model.Text, starts by defaultModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_SONNET_MODEL_NAMEDocumentedSets the picker name of the pinned Sonnet model.Text. Used only when ANTHROPIC_DEFAULT_SONNET_MODEL is setModel picker, all. Project env can set it before trust
ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIESDocumentedLists the capabilities of the pinned Sonnet model, such as effort,thinking.A comma-separated list. A table pairs each model var with its capabilities var and reads it by nameModel capability checks. Project env can set it before trust
ANTHROPIC_MODELDocumentedSelects the model for the session. It beats the model setting.Text. An explicit CLI or session choice still wins over itAll sessions. Project env can set it before trust
โ›”ย ANTHROPIC_SMALL_FAST_MODELDocumentedDeprecated. Sets the model for background tasks. Use ANTHROPIC_DEFAULT_HAIKU_MODEL instead.Text. A set value counts as a small-fast-model override and changes fallback logicAll sessions. Project env can set it before trust
CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULTUndocumentedRecords the Haiku default that the third-party model probe wrote. It lets Claude Code tell that value from a user-set one.Text. Claude Code sets it. Code compares it with ANTHROPIC_DEFAULT_HAIKU_MODELThird-party providers. Not set from project env before trust
CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULTUndocumentedRecords the Opus default that the third-party model probe wrote. It lets Claude Code tell that value from a user-set one.Text. Claude Code sets it. Code compares it with ANTHROPIC_DEFAULT_OPUS_MODELThird-party providers. Not set from project env before trust
CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULTUndocumentedRecords the Sonnet default that the third-party model probe wrote. It lets Claude Code tell that value from a user-set one.Text. Claude Code sets it. Code compares it with ANTHROPIC_DEFAULT_SONNET_MODELThird-party providers. Not set from project env before trust
CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULTUndocumentedRecords the Opus default that Claude Code seeded into ANTHROPIC_DEFAULT_OPUS_MODEL.Text. Claude Code sets it. Code compares it with ANTHROPIC_DEFAULT_OPUS_MODEL to see who set the valueThird-party providers. Not set from project env before trust
CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULTUndocumentedRecords the Sonnet default that Claude Code seeded into ANTHROPIC_DEFAULT_SONNET_MODEL.Text. Claude Code sets it. Code compares it with ANTHROPIC_DEFAULT_SONNET_MODEL to see who set the valueThird-party providers. Not set from project env before trust
CLAUDE_CODE_ACT_DONT_REDERIVEUndocumented GatedTurns on the system prompt rule that says to act once enough is known and not to re-derive settled facts.On, off, or unset, true by default. Overrides a feature flag, default true. Claude Code logs the source as env or growthbookMain prompt. gated by a feature flag flag when unset. Not set from project env before trust
CLAUDE_CODE_ALLOW_OTHER_MODELSUndocumentedWith --client-data-url, starts on a model that has no entry in the client data document. Claude Code then applies no per-model client data.On or off. Same as the --allow-other-models flag per its help textSessions started with --client-data-url. Not set from project env before trust
CLAUDE_CODE_ALWAYS_ENABLE_EFFORTDocumentedSends the effort parameter on every request even for unknown model ids.On or off. Models that reject effort stay excluded: claude-3-*, Opus 4.0 and 4.1, Sonnet 4.0 and 4.5, Haiku 4.5API requests with custom model ids. Project env can set it before trust
CLAUDE_CODE_AMBER_ASTROLABEUndocumentedIt overrides a per-model prompt flag. A Probes run saw an "operating autonomously" block added to the system prompt.On or off. A truthy value is passed as an override. A falsy value passes undefinedModel prompt selection. Not set from project env before trust
CLAUDE_CODE_APPEND_PROMPT_HEADUndocumentedNames the head of the appended system prompt. Claude Code checks it against a hash and the prompt start, then splits base and append text.Text. Claude Code reads it once and unsets it. Telemetry records the outcome in a feature flagSDK hosts with appended prompts. Not set from project env before trust
CLAUDE_CODE_AUTO_MODE_MODELUndocumentedSets the model for the auto mode classifier. A server-configured classifier model wins and Claude Code logs a warning.Text. Used when no server model is setAuto mode
CLAUDE_CODE_AUTO_MODE_TEMPERATUREUndocumentedSets the sampling temperature of the auto mode classifier requests.A number, 1 by defaultAuto mode
CLAUDE_CODE_BISON_CAIRNUndocumentedForces the delivering_work_max system prompt section on or off.On, off, or unset. Unset leaves the choice to a model check and the bison_cairn rolloutAll sessions
CLAUDE_CODE_BREEZY_HORIZONUndocumentedMaps a model to another model id for the breezy_horizon experiment. A falsy value turns the mapping off.Text. Claude Code logs a warning and ignores a value that is not a model idAll sessions
CLAUDE_CODE_CLIENT_DATA_URLUndocumentedGives the URL of a signed configuration document with per-model client data. Same as --client-data-url, but the URL stays out of the process list.Text. It must be an https URL without credentials or a port. Claude Code exits if it cannot load the documentAll sessions
CLAUDE_CODE_COZY_TEAPOTUndocumented GatedOverrides the bash-first steer variant. The feature flag otherwise picks it, with strict as the fallback.Other values are ignoredAll sessions, experiment override
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGDocumentedFalls back to fixed thinking budgets on Opus 4.6 and Sonnet 4.6.On or offAll sessions. Project env can set it before trust
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASDocumentedStrips pre-release anthropic-beta headers and beta fields from API requests.On or off. Also passed on to child auto mode classifier processesFirst party, AWS and Foundry paths. Project env can set it before trust
CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAPUndocumentedMakes the built-in Explore agent inherit the parent model instead of a cap at the opus tier.On or off, off by default. Read when Claude Code resolves the Explore agent modelExplore agent
CLAUDE_CODE_DISABLE_FAST_MODEDocumentedTurns off fast mode.On or off. Code allows fast mode only for the first-party provider and when this is offFirst-party API. Project env can set it before trust
CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAPDocumentedStops the remap of Opus 4 and Opus 4.1 ids to the current Opus.On or off. The remap list holds claude-opus-4-20250514, claude-opus-4-1-20250805, claude-opus-4-0 and claude-opus-4-1Anthropic API. Project env can set it before trust
CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACKDocumentedStops the switch to an older model when the account loses access to the session model.On or off. CLAUDE_CODE_NO_MODEL_FALLBACK does the sameBedrock and Vertex per docs
CLAUDE_CODE_DISABLE_REFUSAL_FALLBACKDocumentedTurns off the automatic model switch when a safety classifier flags a request.On or off. Also gates the switchModelsOnFlag settingAll sessions
CLAUDE_CODE_DISABLE_REFUSAL_RETRYUndocumentedMakes a refusal retry check return false. The check sits next to code about responses stopped by a safety classifier.On or off, off by defaultAll sessions
CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTSDocumentedStops Claude Code from sending output_config.format and its anthropic-beta value.On or off. Passed on to child auto mode classifier processesProviders that support structured outputs
CLAUDE_CODE_DISABLE_THINKINGDocumentedOmits the thinking parameter from API requests.On or off, may by default. Docs: models that think by default may still thinkAll sessions. Project env can set it before trust
CLAUDE_CODE_EFFORT_LEVELDocumentedSets the effort level for the session and wins over /effort and settings.Text. Trimmed str. unset and auto (any case) give the model defaultAll sessions. Project env can set it before trust
๐Ÿงชย CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOLUndocumented GatedForces the server-side advisor tool on, and lets a base model with no advisor rank use it.On or off, off by default. Still blocked by CLAUDE_CODE_DISABLE_ADVISOR_TOOL and by provider checksFirst-party and eligible providers
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERYDocumentedFills the /model picker from the gateway /v1/models endpoint.On or off, off by default. Needs the firstParty provider and a non-Anthropic ANTHROPIC_BASE_URL. The gateway provider also checks it at bootstrapGateway setups
CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEMUndocumentedForces mid-conversation system messages on for every model.On or off, off by default. Skips the model checks and the flags for system turnsAPI requests
CLAUDE_CODE_MAX_OUTPUT_TOKENSDocumentedSets the maximum output tokens for most requests, clamped to the model cap.A number. The default depends on the model. Claude Code lowers a value above the model cap to the capAll sessions. Project env can set it before trust
CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTLUndocumentedForces the prompt cache TTL to 5m for the requests that use this helper.enum with the single value 5m. Any other value leaves the chosen TTL as isAll sessions. Project env can set it before trust
CLAUDE_CODE_MODEL_CAPABILITIESUndocumentedOverrides model capabilities. Syntax is pattern=cap1,-cap2 entries split on a semicolon, and a leading - turns a capability off.Text. A pattern ending in * matches by prefix. An entry with no = applies to all modelsAll sessions
CLAUDE_CODE_MODEL_CATALOGUndocumentedTurns off the served model catalog when set to a false value.Text. The catalog is also off for bare mode, essential-traffic-only, a unix socket, non-first-party, or policyFirst-party logins
CLAUDE_CODE_MODEL_CATALOG_URLUndocumentedSets a custom URL for the published model catalog. A file URL is treated as a local file.Text. Used when the managed config has no url. A bad URL turns the published path offAll sessions
CLAUDE_CODE_NO_MODEL_FALLBACKUndocumentedForbids model substitution. A fallback attempt then fails with a message that names this variable.On or off. Works like CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK for the availability chainAll sessions
CLAUDE_CODE_PROMPT_CACHE_TTLDocumentedSets the prompt cache TTL of the main conversation.enum of 5m or 1h. FORCE_PROMPT_CACHING_5M wins over itMain thread. Project env can set it before trust
CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALLUndocumentedLets a refusal retry on the fallback model even when its category has no fallback map entry.On, off, or unset, comes by default. A false value turns it offSessions with a fallback model
CLAUDE_CODE_RUSTLING_PIXELUndocumented GatedPicks how Claude Code keeps thinking blocks that came from another model. Values are all, upgrade, or none.Text, all by default. An invalid value logs a warning and uses upgrade. When unset, a server setting or the flag default all decidesModel calls that carry foreign thinking blocks. Needs an eligible account or provider
CLAUDE_CODE_SIMPLE_SYSTEM_PROMPTDocumented GatedChooses the full or the shorter system prompt. 1 forces the short one. 0, false, no, or off force the full one.Unset lets the model, a feature flag, and a server config decideAll models. Docs list per-model defaults
CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORSDocumentedTreats a failed fast mode availability check as available. A response of "disabled by your organization" still counts.On or off. It applies only to network-type failure reasonsFast mode on the first-party API
CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECKDocumentedSkips the client-side fast mode availability check, for proxies that intercept the check instead of refusing it.On or off. It has no effect in one account mode where the check always runs. The API still rejects requests if the org turns fast mode offFast mode on the first-party API
CLAUDE_CODE_SNAPPY_PELICANUndocumented GatedForces a feature flag behavior on or off. When it is off, relative effort values lower and higher are dropped from the input.On, off, or unset. It is ignored when the subagent model is forced or not set to inheritSubagent calls. gated by a feature flag
CLAUDE_CODE_SUBAGENT_MODELDocumentedSets the default model for subagents, teammates, and workflow agents with no model set another way.Text. The values inherit and unset mean the parent model. Docs matchSubagents. Project env can set it before trust
CLAUDE_CODE_SUBAGENT_MODEL_FORCEDocumentedForces one model onto all subagents, teammates, and workflow agents. The model parameter is then ignored.On or off. The coordinator prompt also reads itSubagents, teammates, workflows
CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTLDocumentedSets the prompt cache TTL to 5m or 1h for requests outside the main conversation.One of a fixed set of values. Enum 5m or 1h. It beats the subagentPromptCacheTtl settingSubagents, workflows, background work. Project env can set it before trust
CLAUDE_CODE_THISTLE_GREBEUndocumented GatedPicks a prompt steer variant. Env wins over client data, then flag, then a per-model default.Text. Accepts default, no_nudges, or counter_steer. Other values are ignoredAll providers
CLAUDE_CODE_TURN_UPDATESUndocumentedForces the turn_updates system prompt section on or off. It asks the model to restate key mid-turn findings in its final message.On, off, or unset. Without it, the prompt logic decidesAll sessions
CLAUDE_CODE_WILLOW_TERNUndocumented GatedForces a willow_tern prompt switch on. The code names it a writing override. Otherwise client data, the model, or a flag decides.On or off. Only true forces it. A non-boolean client data value is ignoredModel-dependent
CLAUDE_CODE_WORKFLOW_SUBAGENT_MODELUndocumentedSets the model for workflow subagents. The value inherit means no override.Text. Ignored when CLAUDE_CODE_SUBAGENT_MODEL_FORCE is on and the value came from project settings. Allowed in project envWorkflows
CLAUDE_EFFORTDocumentedHolds the effort level of the session for Bash subprocesses and hook commands.Set by Claude Code when the model supports effort. Also the skill token ${CLAUDE_EFFORT}Bash tool and hooks
DISABLE_INTERLEAVED_THINKINGDocumentedStops sending the interleaved-thinking beta header.On or off-
DISABLE_PROMPT_CACHING_OPUSDocumentedTurns off prompt caching when the request model is the default Opus model.On or off, Opus by default. Compared with the default Opus model id on each requestAll sessions. Project env can set it before trust
DISABLE_PROMPT_CACHING_SONNETDocumentedTurns off prompt caching when the request model is the default Sonnet model.On or off, Sonnet by default. Compared with the default Sonnet model id on each requestAll sessions. Project env can set it before trust
ENABLE_PROMPT_CACHING_1HDocumentedAsks for the 1-hour prompt cache TTL in place of 5 minutes.On or off. Lower priority than FORCE_PROMPT_CACHING_5M, the TTL env vars, settings, and agent frontmatterAll sessions. Project env can set it before trust
โ›”ย ENABLE_PROMPT_CACHING_1H_BEDROCKDocumentedDeprecated alias of ENABLE_PROMPT_CACHING_1H for Bedrock. It still asks for the 1-hour TTL.On or off. Works only when the provider is bedrockBedrock. Project env can set it before trust
FALLBACK_FOR_ALL_PRIMARY_MODELSDocumentedStops retrying after repeated overload errors for every model when no fallback model is set.Text. Any non-empty string counts, so 0 still enables itAPI requests. Project env can set it before trust
FORCE_PROMPT_CACHING_5MDocumentedForces the 5-minute prompt cache TTL.On or off. Checked first, ahead of the TTL env vars and ENABLE_PROMPT_CACHING_1HAll sessions. Project env can set it before trust
MAX_STRUCTURED_OUTPUT_RETRIESDocumentedSets how many tries a structured output (--json-schema or workflow subagent) gets before the run fails.A number-
MAX_THINKING_TOKENSDocumentedSets a fixed extended-thinking token budget. 0 turns thinking off.A number-

How It Worksโ€‹

Claude Code picks the model in a fixed order: the --model flag or /model first, then ANTHROPIC_MODEL, then the model setting, then ANTHROPIC_DEFAULT_MODEL. The ANTHROPIC_DEFAULT_*_MODEL variables change what an alias points to. They matter most on Bedrock, Vertex, Foundry, or a gateway, where model IDs differ. The _NAME, _DESCRIPTION, and _SUPPORTED_CAPABILITIES variants only change how the model shows in the picker and which features Claude Code allows for it.

Source: the program (variable names found in the 2.1.304 binary) and the Environment Variables page of the official docs.