# ANTHROPIC_DEFAULT_MODEL

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** ANTHROPIC_DEFAULT_MODEL environment variable

## Think of it like

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

## 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

Lucy sets this to opus on a new laptop. Later she saves Sonnet with /model. From then on, she gets Sonnet.

## Example code

```bash
export ANTHROPIC_DEFAULT_MODEL=opus
claude
```

Start on Opus unless you chose another.

## Why it matters

You can set a fallback that never fights a choice someone made on purpose.

## Common mistake

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

## Three principles

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

## Related terms

- [ANTHROPIC_MODEL](https://learn.benibix.com/term/ai/anthropic-model-variable)
- [/model Command](https://learn.benibix.com/term/ai/model-command)
- [Claude Code Model Alias](https://learn.benibix.com/term/ai/claude-code-model-alias)

## Told apart from

- [ANTHROPIC_MODEL vs ANTHROPIC_DEFAULT_MODEL](https://learn.benibix.com/compare/anthropic-model-variable-vs-anthropic-default-model-variable): 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.

![A session starts on the first model set in this list, from top to bottom.](https://learn.benibix.com/diagrams/env-model-order.svg)

---

Source: https://learn.benibix.com/term/ai/anthropic-default-model-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
