ANTHROPIC_DEFAULT_MODEL

Updated by

ANTHROPIC_DEFAULT_MODEL is a Claude Code environment variable: Sets the model new sessions begin on. A /model selection overrides it and is remembered across restarts, unlike ANTHROPIC_MODEL. The picker marks a value set this way separately from an organization-enforced default. Shipped v2.1.236. Its release history is not tracked here. It is listed in the official reference.

StatusPresent in v2.1.332
CategoryModels and thinking
Official docsListed

How to set it

For one session, export it in the shell that starts Claude Code:

export ANTHROPIC_DEFAULT_MODEL=<value>
claude

To apply it to every session, add it to the env object of a settings file:

// ~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_DEFAULT_MODEL": "<value>"
  }
}

Release notes that mention it

Related variables

Frequently asked questions

What does ANTHROPIC_DEFAULT_MODEL do?

Sets the model new sessions begin on. A /model selection overrides it and is remembered across restarts, unlike ANTHROPIC_MODEL. The picker marks a value set this way separately from an organization-enforced default. Shipped v2.1.236.

Which Claude Code version has ANTHROPIC_DEFAULT_MODEL?

Its release history is not tracked here.

How do I set ANTHROPIC_DEFAULT_MODEL?

Export it before starting Claude Code (export ANTHROPIC_DEFAULT_MODEL=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.

All variables, searchable: Claude Code environment variables.