Skip to content
BENIBIX Learn

ANTHROPIC_DEFAULT_MODEL

AI⌨️ Claude CodeConfiguration

Also known as ANTHROPIC_DEFAULT_MODEL environment variable

It sets the model to use when nothing else picks one.

Think of it like

It is like the meal you get when you do not order.

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.

Definition

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 code

bash
export ANTHROPIC_DEFAULT_MODEL=opus
claude
Start on Opus unless you chose another.
ANTHROPIC_DEFAULT_MODEL is last in the list.

Common mistake

Expecting it to beat a model saved with /model. It is last in line, so any saved choice wins.

Key takeaways

  1. 1
    Last in line. Used only if nothing else.
  2. 2
    Gives way to /model. And to settings.
  3. 3
    2.1.236 or later. Older versions ignore it.

Compare