/model: add session-only flag to avoid overwriting saved default

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Jul 13, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Problem

Running /model <name> inside a session both switches the active model and saves it as the default for new sessions. There's no way to temporarily switch models mid-session without overwriting settings.json.

Expected behavior

A way to switch the model for the current session only, leaving the saved default untouched. For example:

  • A flag: /model --session claude-opus-4-8
  • Or a separate command: /model:session <name>

Current workaround

None known. Even setting ANTHROPIC_MODEL env var, /model still writes the new default.

Use case

Switching to a more capable model for one complex task, then having the next session start with the usual (cheaper/faster) default — without manually resetting it each time.

View original on GitHub ↗

3 Comments

chris-gusto · 3 months ago

I agree. In a recent update, /model was changed from changing only the session model to changing the default model, unless you use 's' to set as session only.

A side-effect of that change is that /model opus changes the default model as one can't specify that it's session-only.

Previously I could use keybindings.json, but the binding stopped working in a recent update.

{
  "bindings": [
    {
      "context": "ModelPicker",
      "bindings": {
        "enter": "modelPicker:thisSessionOnly"
      }
    }
  ]
}
bcherny collaborator · 1 month ago

This is already possible: open the /model picker, highlight the model you want, and press s instead of Enter. s switches the model for the current session only and leaves your saved default untouched (Enter and typing /model <name> directly save it as the default). claude --model <name> at launch is also session-only.

Docs: https://code.claude.com/docs/en/model-config#setting-your-model

🤖 Generated with Claude Code

github-actions[bot] · 8 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.