Skip to content

fix(global-settings): ignore the model and effort keys Claude Code writes in settings.json (v2.7.1) - #805

Merged
WilcoLouwerse merged 1 commit into
mainfrom
fix/global-settings-ignore-client-model-keys
Oct 1, 2026
Merged

WilcoLouwerse merged 1 commit into
mainfrom
fix/global-settings-ignore-client-model-keys

Conversation

@WilcoLouwerse

Copy link
Copy Markdown
Contributor

Problem

Since v2.7.0, check-settings-version.sh compares the installed ~/.claude/settings.json with the canonical copy at session start and skips only the model key. Under relock option (B), Claude Code writes more than model into that file. Its main extra write is the effort level, which /effort and the effort picker save per model as modelSettings.<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:

Key Written by
model the VSCode model picker and /model
modelSettings /effort and the effort picker, per model
effortLevel the same choice when it cannot be keyed by model
fastMode /fast
advisorModel /advisor
switchModelsOnFlag the VSCode toggle that switches model when a safeguard flags a message

The 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 userSettings writes. Hooks, permissions and every other key still count as drift.

  • VERSION 2.7.0 → 2.7.1, because an installed hook script changed.
  • README.md and docs/claude/global-claude-settings.md now name the skipped keys.

Tests

  • tests/test-check-settings-version.sh: 81 passed, 0 failed. New cases:
    • 7b: all six keys set → up to date.
    • 7c: modelSettings next to a permissions change → only permissions is reported.
  • Negative control: run against the v2.7.0 script, exactly the three new assertions fail.

🤖 Generated with Claude Code

…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>
@WilcoLouwerse
WilcoLouwerse merged commit 81d78d1 into main Oct 1, 2026
48 checks passed
@WilcoLouwerse
WilcoLouwerse deleted the fix/global-settings-ignore-client-model-keys branch October 1, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant