$ recombobulate _
home / tips / set-a-default-model-with-the-anthropic-model-env-var
0

Set a Default Model with the ANTHROPIC_MODEL Env Var

bagwaa @bagwaa · Mar 25, 2026 · Configuration
set-a-default-model-with-the-anthropic-model-env-var

If you always reach for the same model, stop passing --model on every command. The ANTHROPIC_MODEL environment variable sets your default so you never have to think about it.

# Add to your .zshrc or .bashrc
export ANTHROPIC_MODEL="claude-opus-4-6"

Now every Claude Code session uses that model automatically:

# No --model flag needed
claude "Refactor the payment service"
claude -p "Write a changelog entry for this diff"

You can still override it for individual commands — the flag always takes precedence over the environment variable:

# Override for a quick, cheap task
claude --model claude-haiku-4-5-20251001 "Rename this variable across the codebase"

# Override for something that needs maximum power
claude --model claude-opus-4-6 "Design the architecture for this new feature"

This is particularly useful if you're testing a newly released model across your daily workflow — update the env var once and every session picks it up automatically. When you're done evaluating, change it back in one place.

# Confirm which model is active
echo $ANTHROPIC_MODEL

Set it in your shell profile once, and never think about it again.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Switch to the Stable Update Channel with autoUpdatesChannel

The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.

bagwaa @bagwaa · 1 hour ago
0
Set Claude's Response Language with the language Setting

The language setting makes Claude respond in your preferred language by default, across every session and project.

bagwaa @bagwaa · 1 hour ago
0
Customize or Remove Claude's Git Attribution with the attribution Setting

The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.

bagwaa @bagwaa · 2 hours ago