[BUG] `defaultMode` setting is ignored
Status Fixed / completed
Reported on v2.1.146
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened May 21, 2026 · closed May 21, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The defaultMode setting in settings.json is being ignored.
It should be set to 1M by default, but it keeps changing to Opus 4.7 (which is not 1M), and it is frustrating.
What Should Happen?
The model selection should not change on its own. This did not happen before.
Error Messages/Logs
Steps to Reproduce
It occurs after using it a few times or resuming. I do not know the specific steps. It happens intermittently.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.146 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
4 Comments
Hi @riya-amemiya — there are likely two separate things mixed together here, and untangling them should give you a working defaults setup.
1.
defaultModecontrols permission mode, not model selectionThe
defaultModefield insettings.jsonbelongs to thepermissionsblock and accepts these values:"default","plan","acceptEdits","bypassPermissions","auto"Example:
If you set
"defaultMode": "1M"it falls outside the accepted enum and gets silently dropped (this validation gap is itself worth flagging — Claude Code should reject the unknown value with a startup warning instead of silently ignoring it).**2. To set a default model, use the
/modelpicker (v2.1.144+)**Per the v2.1.144 release notes (releases page):
So the path is:
/modelinside the sessionOpus (1M context)dto pin it as the default for new sessionsThis default is what new sessions and
--resumed sessions should pick up. v2.1.144 also fixed three adjacent regressions that may be relevant if pinning still doesn't stick:applyFlagSettingsafter startup"/modelchoice"/modelpicker (regression in v2.1.129)"You're on
Anthropic API(not Bedrock/Vertex), so the third one shouldn't bite you, but the first two have shipped fixes that should be in v2.1.146.3. A workaround if
ddoesn't stick: SessionStart verification hookIf you pin via
dand the model still drifts back to Opus 4.7 between sessions, that's a regression worth a separate issue. As a local safety net you can install aSessionStarthook that reads the active model and prints a warning when it's not what you wanted. Something like:Register it under
hooks.SessionStartinsettings.json. It won't change the model — Claude Code chooses that — but it surfaces the divergence immediately so you don't lose hours of work before noticing.4. The deeper pattern
The frustration you're describing (a configuration surface that says it's set but the runtime quietly does something else) is structural — v2.1.144 alone shipped six fixes in the same shape: silent drop of MCP tool pages, silent
/modelnon-application, silent.mcp.jsonparse failure, silent worktree losses, etc. Until the settings validator catches thedefaultModemistake at startup, the workaround above is the fastest way to make the silent layer audible.Hope this helps — please reopen with your exact
settings.jsonsnippet if pinning viaddoesn't stick, because that would be a fresh regression worth its own report.@yurukusa
I was mistaken about defaultMode. I apologize.
It certainly seems to have been fixed by following:
This was a big help. Thank you very much.
Glad it worked, @riya-amemiya! The
/modelUI route is the only path that survives across new sessions —defaultModewas a reasonable guess given the field name overloading. Worth filing a separate issue if you want thesettings.jsonmodel-default surface to honor a documented key; happy to co-author the structural framing if you do.Closing the loop here: the
tengu_tool_search_unsupported_models: ["haiku"]config (in~/.claude.json) is worth a look too if you ever route fast tasks through Haiku — same silent-restriction shape as the model-default surface, but at the MCP-tool layer.Happy to be useful.
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.