Skip to content

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…

Error output
安装插件或者添加一些其他配置之类的会修改 settings.json 内的内容,但是 开启/关闭  代理就会重置该文件,导致所有的自定义变更丢失。
English translation

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

ToolClaude Code
Version3.12.2 - 3.20.0(已报告受影响;v3.12.2 曾修复部分接管恢复流程)
PlatformsWindowsmacOSLinux
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.

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.