All articles

Pinning a Model in Settings

Claude Code lets you pick a model, and you can make that choice stick with the model key in settings.json. Pin it once and every new session starts on the model you want, no manual switch needed.

Setting the key

The value is a model alias — sonnet, opus, or haiku.

{
  "model": "sonnet"
}

Drop that into a settings file and sessions covered by that file open on Sonnet.

Choosing where to pin it

The file you use decides the reach of the choice:

  • ~/.claude/settings.json (user) — your default across every project.
  • .claude/settings.json (project) — the model the whole team uses for this repo, shared through git.
  • .claude/settings.local.json (local) — your personal pick for one repo, kept out of git.

Because settings layer, a project pin overrides your user default when you work in that repo, and your local file overrides the project pin for you alone.

Pin per project when it fits the work

A heavy, tricky codebase might deserve a more capable model in its project file. A small, fast-moving repo might do fine on a lighter one. Pinning per project means you don't have to remember to switch each time you change repos.

Changing it on the fly

A pinned model is a starting point, not a cage. You can still switch mid-session with /model sonnet, /model opus, or /model haiku, or start Claude with the --model flag to override the file for that run. The settings key just sets the default so you begin where you want every time.

Comments

Be the first to comment.