claude-code - 💡(How to fix) Fix [FEATURE] Session-only flag for typed /model <name> (or a setting to disable global persistence)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In v2.1.153 the typed form of the model switch — /model <name> — was changed to persist the chosen model to ~/.claude/settings.json as the new global default. The interactive picker offers s for session-only switching, but the typed form has no equivalent. There is also no settings flag to opt out of the new persistence behavior.

Root Cause

Persisting a model choice as a side effect of an in-session command is surprising. The typed form is the natural way to switch models quickly during a session ("let me try this on Opus, then back to Sonnet") and silently rewriting the user's global default on every such toggle is the opposite of what most users want from a transient switch.

Today, working around it requires either:

  1. Falling back to the picker UI and pressing s (slower).
  2. Restarting with claude --model <name> (also slower; loses the current session).
  3. Manually re-editing ~/.claude/settings.json after every switch to remove the line.

None of these match the muscle memory of /model <name> as a lightweight per-session toggle, which is how it behaved before v2.1.153.

RAW_BUFFERClick to expand / collapse

Summary

In v2.1.153 the typed form of the model switch — /model <name> — was changed to persist the chosen model to ~/.claude/settings.json as the new global default. The interactive picker offers s for session-only switching, but the typed form has no equivalent. There is also no settings flag to opt out of the new persistence behavior.

Why this matters

Persisting a model choice as a side effect of an in-session command is surprising. The typed form is the natural way to switch models quickly during a session ("let me try this on Opus, then back to Sonnet") and silently rewriting the user's global default on every such toggle is the opposite of what most users want from a transient switch.

Today, working around it requires either:

  1. Falling back to the picker UI and pressing s (slower).
  2. Restarting with claude --model <name> (also slower; loses the current session).
  3. Manually re-editing ~/.claude/settings.json after every switch to remove the line.

None of these match the muscle memory of /model <name> as a lightweight per-session toggle, which is how it behaved before v2.1.153.

Requested behavior

Any one of the following would close the gap:

a. A typed flag, e.g. /model opus --session or /model opus s, that switches for the current session only and does not write to settings. b. A settings.json option such as "persistModelOnSwitch": false that opts users out of the new persistence behavior globally. c. Make the typed form default to session-only (matching the picker's s) and require an explicit --save to persist — i.e., invert today's default.

(a) is the least disruptive and most discoverable. (c) is the cleanest from a principle-of-least-surprise standpoint but is a breaking change for anyone who has come to rely on the v2.1.153 behavior.

Related

  • v2.1.153 model-config docs: https://code.claude.com/docs/en/model-config.md
  • Possibly related: #60404 ([DOCS] Model configuration docs still say /model selections persist across restarts) — different issue (docs accuracy vs. opt-out mechanism) but in the same problem space.

Disclosure & context

Drafted by Claude Code at my request after I hit this unexpectedly. /model opus is a command I've used many times for quick in-session toggles; the v2.1.153 change silently rewrote my global settings as a side effect, and the only way to undo it was to hand-edit ~/.claude/settings.json. Silent behavior changes on long-standing commands erode trust, especially for a typed form that had stable session-only semantics for a long time before the flip. Please weigh that when prioritizing — filing while it's still fresh so the signal isn't sanitized.

Environment

  • Claude Code version: v2.1.153+

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING