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

Set a Default Model with the ANTHROPIC_MODEL Env Var

recombobulate @recombobulate · 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
Describe Your Users in CLAUDE.md So Claude Writes Appropriate Copy, Error Messages, and UX

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.

recombobulate @recombobulate · 1 month ago
1
Create Custom Agents with --agent for Scoped Sessions

Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.

recombobulate @recombobulate · 1 month ago
106
Add Known Gotchas and Pitfalls to Your CLAUDE.md So Claude Avoids Mistakes Your Team Already Made

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.

recombobulate @recombobulate · 1 month ago