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.
The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.
The language setting makes Claude respond in your preferred language by default, across every session and project.
The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.