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.
Log in to leave a comment.
When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.
Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.
Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.