ANTHROPIC_MODEL vs ANTHROPIC_DEFAULT_MODEL
People think ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_MODEL both set the model you start on, so either will do. They sit at the two ends of the line. The first ranks just below the --model flag. Each launch goes back to it, even after you save a new model with /model. The second is last in line, so any flag, setting or saved choice wins over it. Use the first to fix a model, and the second to set a fallback.
ANTHROPIC_MODEL
It sets the model each new session starts on.
ANTHROPIC_MODEL sets the model Claude Code starts on, as an alias such as opus or a full model name. It ranks below the --model flag and above the model setting. Each new launch goes back to it, whatever you saved with /model. A typo is not caught at start, only on the first request.
ANTHROPIC_DEFAULT_MODEL
It sets the model to use when nothing else picks one.
ANTHROPIC_DEFAULT_MODEL sets the model new sessions start on when nothing else picks one. Lots of things win over it. A flag does, and so does the other model variable. So do a model setting, a choice saved with /model and a company default. It needs Claude Code 2.1.236 or later.
In one line
- ANTHROPIC_MODEL
- It sets the model each new session starts on.
- ANTHROPIC_DEFAULT_MODEL
- It sets the model to use when nothing else picks one.