settings.json overwritten by proxy takeover causing plugin config loss - Claude Code
Quick fix
Place custom fields such as hooks and statusLine into the "General Configuration" panel, or upgrade to v3.12.2+ to fix the legacy backup restore logic.
Symptom
Section titled “Symptom”settings.json 文件会因为cc switch代理模式重置,导致plugin每次重启都是禁用,因为enabledPlugins 配置没了The settings.json file gets reset due to cc-switch proxy mode, causing plugins to be disabled on every restart because the enabledPlugins configuration is lost.
The local proxy (takeover) mode of cc-switch works by taking over `~/.claude/settings.json`. When switching providers or enabling/disabling the proxy, the program writes the provider's configuration to make the proxy work. Early versions (before v3.12.2) used stale snapshots when restoring backups, causing custom fields such as `statusLine`, `permissions`, and `enabledPlugins` to be lost. This issue was fixed in v3.12.2 by refactoring the Proxy Takeover Restore Flow.
However, even after upgrading to the latest version, the core design remains unchanged: cc-switch adopts a strategy of fully overwriting the live file using the database template as the source, rather than field-level merging. This means that if a third-party tool (such as Orca) or a user manually writes top-level fields into `settings.json` that do not belong to any provider template, those fields will still be overwritten when switching providers. The maintainer explicitly stated that a field-level merge was attempted in v3.11.0 but was reverted in v3.11.1 due to complex state conflict issues it introduced. The currently recommended approach is to pass shared configuration across different providers via the "General Configuration" feature.
Upgrade cc-switch to v3.12.2 or higher to get the refactored Proxy Takeover Restore Flow and avoid issues caused by restoring stale snapshots.
Edit the current Claude provider in cc-switch and enter the "General Configuration" panel.
Click "Extract from Current Provider" to extract custom fields such as `hooks`, `statusLine`, `permissions`, and `enabledPlugins` from `~/.claude/settings.json` on disk into the general configuration.
Save the configuration. Ensure that "Write General Configuration" is checked when creating or switching providers (usually checked by default), so that shared data such as plugins is preserved during switching.
If you need to modify configuration such as environment variables while the proxy is enabled, first disable the proxy feature in cc-switch, make the changes, and then re-enable it to ensure the configuration is synchronized correctly.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 15 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 配置没了
- #1795[DISCUSS] 支持 pi coding agent
- #1827代理打开情况下切换/修改 provider 不会更新 .claude/settings.json
- #2027OpenAI Chat Completions 模式下,开启本地代理后模型映射会被自动清空
- #4274CC Switch overwrites entire settings.json on agent takeover, destroying user plugins/config
- #5363Claude Code built-in WebSearch returns 0 results and can stall via Codex OAuth proxy
- #6886代理接管模式:服务重启时恢复路径会把上一个 Provider 的 API Key 回写覆盖当前 Provider 的配置
- #6901切换供应商时全量覆盖 ~/.claude/settings.json,抹掉第三方工具(如 Orca)写入的 hooks 等字段
- #6902[Bug] Applying a partial Claude provider config destructively overwrites ~/.claude/settings.json even with takeover disabled
- After upgrading to the latest version, why do my hooks configurations still get lost when switching providers?
- Although the latest version fixes the stale snapshot restoration bug, the underlying layer still uses a full overwrite strategy. If fields such as `hooks` are not in the provider configuration or "General Configuration", they will be overwritten during switching. Please extract these fields written by third-party tools into "General Configuration".
- After enabling the proxy, why are the provider's environment variable modifications not synchronized to settings.json?
- This is a known issue in early versions. Try turning the Claude proxy switch off and then back on to trigger a configuration update. It is recommended to upgrade to v3.12.2+ for a more stable proxy synchronization experience.
- What should I do if the configuration in settings.json is cleared after disabling the proxy or restarting the computer?
- This is usually because the restore flow used a stale backup snapshot when the proxy was disabled or the service restarted. Upgrading to v3.12.2+ resolves this issue. If you are already on the latest version, check whether fields written by third-party tools were overwritten because they were not added to "General Configuration".
- Why not just modify the code to only overwrite proxy-related fields such as env and keep all other configurations?
- The maintainer stated that a field-level merge approach was attempted in v3.11.0, but it introduced more complex state conflict issues, so it was reverted in v3.11.1. The current design requires the request URL and API Key to be provider-specific, while other shared configurations are passed via "General Configuration".
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.