Repository navigation
fix(global-settings): ignore the model and effort keys Claude Code writes in settings.json (v2.7.1) - #805
Merged
Conversation
…ites in settings.json (v2.7.1) The v2.7.0 integrity check skipped only `model` when comparing the installed settings.json with the canonical one. Under relock option (B) Claude Code also writes the effort level per model (`modelSettings.<model>.effortLevel`, from /effort and the effort picker) and a few other model-choice keys into that file, so every effort change raised a "FILES OUT OF SYNC" notice and the repair threw the user's choice away. The check now leaves out every top-level key the client writes for a model or effort choice: model, modelSettings, effortLevel, fastMode, advisorModel and switchModelsOnFlag. Hooks, permissions and every other key still count as drift. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since v2.7.0,
check-settings-version.shcompares the installed~/.claude/settings.jsonwith the canonical copy at session start and skips only themodelkey. Under relock option (B), Claude Code writes more thanmodelinto that file. Its main extra write is the effort level, which/effortand the effort picker save per model asmodelSettings.<model>.effortLevel. Every effort change therefore raised FILES OUT OF SYNC (top-level keys: modelSettings). Following the repair then overwrote the file and threw the user's choice away.Change
The comparison now leaves out every top-level key that the client itself writes for a model or effort choice:
model/modelmodelSettings/effortand the effort picker, per modeleffortLevelfastMode/fastadvisorModel/advisorswitchModelsOnFlagThe list comes from the Claude Code 2.1.286 extension and CLI: the settings schema descriptions, the webview's writable-settings allowlist and the CLI's
userSettingswrites. Hooks, permissions and every other key still count as drift.VERSION2.7.0 → 2.7.1, because an installed hook script changed.README.mdanddocs/claude/global-claude-settings.mdnow name the skipped keys.Tests
tests/test-check-settings-version.sh: 81 passed, 0 failed. New cases:modelSettingsnext to apermissionschange → onlypermissionsis reported.🤖 Generated with Claude Code