[Bug] Plugin uninstall silently deletes unrelated settings.json keys
Bug Description
# Uninstalling a plugin/marketplace silently deletes unrelated keys from ~/.claude/settings.json
## Summary
Removing a marketplace and its plugin via /plugin rewrote ~/.claude/settings.json
and dropped "effortLevel": "max" — a key unrelated to plugins. The setting was
lost silently: no prompt, no warning, no mention in the command output. The
running session's effort level fell from max to high mid-session, and the
change was only noticed later by accident.
## Environment
- Claude Code, macOS (darwin 25.6.0)
- Date: 2026-08-07
- Removed marketplace: darrylmorley-ollama (source: github, repo darrylmorley/ollama-plugin-cc)
- Removed plugin: ollama@darrylmorley-ollama
## Steps to reproduce
1. Have "effortLevel": "max" set at the top level of ~/.claude/settings.json.
2. Register a marketplace and install a plugin from it.
3. Run /plugin and remove that marketplace and its plugin.
4. Inspect ~/.claude/settings.json.
Expected: only the marketplace's own entries are removed —
extraKnownMarketplaces.<name> and the matching enabledPlugins key.
Actual: effortLevel is also gone.
## Evidence
Two backups of settings.json were taken independently that morning, bracketing
the event, plus the file's mtime:
``
08:10:43 backup A "effortLevel": "max" present (14 keys)
08:32:17 backup B "effortLevel": "max" present (14 keys)
08:41:07 settings.json write "effortLevel" ABSENT (13 keys)
`
Diffing backup B against the post-event file shows exactly four removals:
`
- "effortLevel": "max"
- "enabledPlugins"."ollama@darrylmorley-ollama": false
- "extraKnownMarketplaces"."darrylmorley-ollama": { source: github, repo: darrylmorley/ollama-plugin-cc }
- one SessionStart hook entry
`
The middle two are precisely what the /plugin removal was asked to do, which
identifies the 08:41:07 write as /plugin's. The hook entry was removed by a
separate, deliberate edit at ~08:32 (see below). That leaves effortLevel as an
unrequested removal in the same write.
### Ruling out the other edit in the window
The only other modification to settings.json in that window was a scripted edit
at ~08:32 that removed one SessionStart hook entry via a json.load →
mutate → json.dump round-trip. Replaying that exact transformation against
backup B preserves the key:
`
before: max
after : max
`
So it was not responsible.
### Not a display or session-scope artifact
The key was absent from the file on disk, not merely inactive. CLAUDE_EFFORT
in the running session read high. Re-running /effort restored both the
session value and the on-disk key, confirming the file had genuinely lost it.
## Impact
- A user-configured setting is destroyed with no warning and no undo.
- The loss is silent and easy to miss — it changes model behaviour rather than
producing an error.
- The mechanism appears to be a whole-file rewrite that reconstructs
settings.json from a known-keys schema, so **any** key the writer does not
recognise is at risk, not just effortLevel. That would make the blast radius
larger than this one setting.
## Suggested fix
Preserve unrecognised top-level keys when rewriting settings.json — read,
modify only the targeted subtrees (extraKnownMarketplaces, enabledPlugins),
and write back everything else untouched. Alternatively, warn before dropping
keys the writer does not own.
## Workaround
Back up ~/.claude/settings.json before any /plugin install or uninstall:
`bash
cp ~/.claude/settings.json ~/.claude/settings.json.bak
``
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.224
- Feedback ID: d2151975-cc80-4025-b28e-cd26270748aa
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗