settings.json gets reset - Claude Code
Quick fix
Write shared fields like plugins and hooks into "Common Config" and check write-back on switching; if takeover mode misbehaves, disable it, switch provider…
Symptom
Section titled “Symptom”安装插件或者添加一些其他配置之类的会修改 settings.json 内的内容,但是 开启/关闭 代理就会重置该文件,导致所有的自定义变更丢失。Installing plugins or adding other config modifies the contents of settings.json, but turning the proxy on/off resets that file, causing all custom changes to be lost.
cc-switch's Claude proxy takeover and provider sync write to `settings.json`. In some versions and scenarios, the write base is the provider's saved `settings_config` or an older restore backup rather than the current live file, so fields not included in the provider config or common config—such as `enabledPlugins`, `hooks`, `permissions`, and `statusLine`—are lost. Reports indicate that even with proxy takeover disabled, applying certain Claude provider configs can still overwrite the entire file.
The maintainer states that the request URL and API Key are provider-specific; shared config such as plugins and hooks should be passed between providers via "Common Config". v3.12.2 adjusted the backup-restore flow of proxy takeover to preserve custom fields, but later open reports in 3.19.1 and 3.20.0 still describe full-file overwrites, so that fix did not cover all write scenarios.
Edit the Claude provider, click "Extract from current provider" in the "Common Config" panel to move the plugins, hooks, permissions, and status line config that must persist across providers into the common config.
When creating or switching a Claude provider, check "Write common config" (the maintainer notes this option is checked by default) so the shared config is written back.
If enabling takeover mode restored an old config, first disable takeover mode, switch to another provider and then back to the current one, confirm the full config has been written, then re-enable takeover mode.
When you need to edit local `settings.json` fields directly, disable the local proxy first; proxy takeover modifies the request URL, key, and model mapping fields in that file.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 12 real issues
- #445请问下 为什么我开启代理后 本地settings.json里面的配置文件无法变化,无法切换代理商
- #938plugin失效问题
- #989严重 issue 开启代理服务后,claude code 本地 settings.json 被统一替代,固定环境变量不方便添加,目前 ccs 中没有入口,只能手动添加
- #1118.claude/settings.json 在开启/关闭 代理后被重置问题
- #1437【BUG】V3.12在开启本地代理时切换cluade供应商配置文件不会切换
- #1540Claude 接管模式可能会恢复旧的 `~/.claude/settings.json`,导致 `statusLine` 等自定义字段丢失
- #1691settings.json 文件会因为cc switch代理模式重置,导致plugin每次重启都是禁用,因为enabledPlugins 配置没了
- #1827代理打开情况下切换/修改 provider 不会更新 .claude/settings.json
- #2027OpenAI Chat Completions 模式下,开启本地代理后模型映射会被自动清空
- #4274CC Switch overwrites entire settings.json on agent takeover, destroying user plugins/config
- #6901切换供应商时全量覆盖 ~/.claude/settings.json,抹掉第三方工具(如 Orca)写入的 hooks 等字段
- #6902[Bug] Applying a partial Claude provider config destructively overwrites ~/.claude/settings.json even with takeover disabled
- With the proxy off, does switching models also wipe the config?
- Some users report that switching models with the proxy off also clears the config; another v3.20.0 report says that with proxy, takeover, and failover all disabled, applying certain provider configs still overwrites the entire live `settings.json`.
- Without switching providers, why does the Claude HUD plugin stop working after a restart?
- Users in the thread report that even without switching providers, the config can still be overwritten after a restart, causing installed plugins to become unrecognized.
- What about adding config like hooks to the common config?
- The maintainer recommends writing shared config such as hooks into "Common Config" and enabling "Write common config" when switching providers.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.