FALLBACK_FOR_ALL_PRIMARY_MODELS
Updated by Alex Sorokoletov
FALLBACK_FOR_ALL_PRIMARY_MODELS is a Claude Code environment variable: Enable fallback for all primary models. Its release history is not tracked here. It is listed in the official reference.
| Status | Present in v2.1.294 |
|---|---|
| Category | Models and thinking |
| Official docs | Listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export FALLBACK_FOR_ALL_PRIMARY_MODELS=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"FALLBACK_FOR_ALL_PRIMARY_MODELS": "<value>"
}
}Related variables
CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK: Present in the v2.1.285 build and absent from that release's notes.CLAUDE_CODE_NO_MODEL_FALLBACK: When set, the availability chain collapses to [primary]: buildAvailabilityFallbackChain() returns only the model you selected, and a tripwire error fires if any path still attempts a fallback pivot ("a model-fallback pivot was attempted while the no-fallback guarantee is active … this branch should be unreachable").ANTHROPIC_CUSTOM_MODEL_OPTIONANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTIONANTHROPIC_CUSTOM_MODEL_OPTION_NAMEANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIESANTHROPIC_DEFAULT_FABLE_MODELANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION
Frequently asked questions
What does FALLBACK_FOR_ALL_PRIMARY_MODELS do?
Enable fallback for all primary models
Which Claude Code version has FALLBACK_FOR_ALL_PRIMARY_MODELS?
Its release history is not tracked here.
How do I set FALLBACK_FOR_ALL_PRIMARY_MODELS?
Export it before starting Claude Code (export FALLBACK_FOR_ALL_PRIMARY_MODELS=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.