Set a Persistent Default Model and Lock Available Models in settings.json
Instead of passing --model on every command, set a persistent default in your settings.json and forget about it:
{
"model": "claude-sonnet-4-6"
}
This lives at ~/.claude/settings.json for a user-level default. Drop a .claude/settings.json into a project directory to override it project-wide — the project setting always wins.
For teams, the availableModels key restricts which models anyone can select during a session. This prevents a team member from accidentally spinning up an expensive Opus run on a task that only needs Haiku:
{
"model": "claude-sonnet-4-6",
"availableModels": ["claude-sonnet-4-6", "claude-haiku-4-5-20251001"]
}
With this config, the /model picker only shows the listed models. Commit this to your repo and the whole team gets consistent, cost-controlled model access.
For CI pipelines where you don't want to commit a config file, use the environment variable instead:
ANTHROPIC_MODEL=claude-haiku-4-5-20251001 claude -p "Quick summary of today's commits"
The full precedence order, from highest to lowest priority:
--model flag > ANTHROPIC_MODEL env var > project settings.json > user settings.json
If you want to switch models mid-session without changing your defaults, use the /model command — it applies only to the current conversation and leaves settings.json untouched.
Set it once in settings.json and stop specifying the model on every command — save --model for the exceptions.
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.