# ANTHROPIC_MODEL

> It sets the model each new session starts on.

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

## Think of it like

It is like you tell the driver which bus to take. You say it each time you leave.

## Definition

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.

## Example code

```bash
export ANTHROPIC_MODEL=sonnet
claude
```

Start every session on Sonnet.

## Why it matters

A script or a machine can set its model in one place. No flag is needed on each command.

## Common mistake

Saving a new model with /model and expecting it next time. With this set, the next launch goes back to it.

## Three principles

- **Alias or full name.** opus or an ID.
- **Below --model.** Above settings.
- **Wins each launch.** Over /model saves.

## Related terms

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

## 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.
- [ANTHROPIC_MODEL vs ANTHROPIC_DEFAULT_OPUS_MODEL](https://learn.benibix.com/compare/anthropic-model-variable-vs-anthropic-default-opus-model-variable): People think ANTHROPIC_DEFAULT_OPUS_MODEL makes Claude Code run on Opus. It does not pick a model at all. It only says which full model the short name opus stands for. ANTHROPIC_MODEL is what picks the model a session starts on. So on a cloud you often set both. The pin says what opus means there, and the other says to use it.

![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-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.
