Skip to content
BENIBIX Learn

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.

AI⌨️ Claude Code

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.

Example
Jack's CI image sets this to haiku. So each job runs on the cheap model, whatever anyone saved on a laptop.
Why it matters
A script or a machine can set its model in one place. No flag is needed on each command.
Full entry
AI⌨️ Claude Code

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.

Example
Lucy sets this to opus on a new laptop. Later she saves Sonnet with /model. From then on, she gets Sonnet.
Why it matters
You can set a fallback that never fights a choice someone made on purpose.
Full entry

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.