settings.json configuration lost after switching providers (cc-switch)
Quick fix
Extract shared fields into “Common Configuration” and enable writing them for each provider; v3.12.2 fixes the proxy-related BUG.
Symptom
Section titled “Symptom”原本有几十行配置, 还有配置好的hook, 现在就剩7行了The configuration originally had dozens of lines, including configured hooks; now only 7 lines remain.
When cc-switch switches providers, it fully rewrites ~/.claude/settings.json using the selected provider configuration. This is intentional behavior described in the README FAQ. Fields not belonging to a provider configuration, such as enabledPlugins, hooks, statusLine, and includeCoAuthoredBy, are lost unless placed in “Common Configuration”.
Earlier versions, including v3.12.1 with proxy takeover enabled and 3.11.0, also had a BUG that prevented common configuration from being written back. Some users found that “Extract from Current Provider” reads the database record rather than settings.json on disk, so manually added fields cannot be extracted. Codex ~/.codex/config.toml can also be overwritten in the same way.
Open “Edit Provider” → “Common Configuration” → “Extract from Current Provider”, then extract shared fields such as enabledPlugins, hooks, and statusLine into Common Configuration.
// ~/.claude/settings.json{"enabledPlugins": {"frontend-design@claude-plugins-official": true,"superpowers@claude-plugins-official": true,"code-review@claude-plugins-official": true,"typescript-lsp@claude-plugins-official": true,"gopls-lsp@claude-plugins-official": true,"pyright-lsp@claude-plugins-official": true},"includeCoAuthoredBy": false}Enable “Write Common Configuration” for every provider. It is enabled by default, and these fields will be written automatically when switching.
If proxy takeover is enabled and common configuration is lost, upgrade to v3.12.2, which fixes the BUG that prevented common configuration from being written back under a proxy.
If the configuration is already lost, recover it from the default provider imported at first launch, where the original configuration is stored.
If settings.json still differs from the UI after saving, check whether local proxy takeover is enabled at 127.0.0.1; third-party proxy software may block writes.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 29 real issues
- #18codex切换到同时修改vscode里的setting
- #182切换失败,请检查配置
- #258gemini 配置无效
- #582[BUG] 配置目录
- #696更改了配置文件目录,还是会在 $HOME 下生成 .cc-switch 目录
- #1184昨天辛苦装一堆claude code插件,切换一下配置全没了。
- #1236cc-switch 切换时覆盖了claude code的 settings.json,丢失了很多配置。如何解决?
- #1354配置个供应商后,启动供应商,会将Claude的settings.json文件内的其他内容都清空,只保留env内模型相关的配置
- #1454[BUG反馈] 版本3.12.1 claude 丢失settings.json配置
- #1625怎么样在 zellij 或者 tmux 分屏软件中启用 不想要每次都要重新开启
- #1706settings.json中的插件启用状态丢失
- #1783提供商配置好后claude code 无法使用
- #1884手动修改~/.claude/settings.json时,会导致当前ccswitch当前模型配置也会被改了
- #1907[Bug] hooks in ~/.claude/settings.json get randomly deleted when switching nodes
- #1995[FEATURE] 切换供应商之后 , 安装的插件没有自动启动
- #2109[Bug] 'Extract Common Config' extracts from provider DB, not current settings.json — hooks/statusLine lost on switch
- #2261feat: 添加 Zed 编辑器配置支持
- #2462切换配置时settings.json内容顺序会随机变化, 导致出现git diff
- #2935切换路由状态失败
- #2992Claude settings.json overwrite drops enabledPlugins and hooks
- #3265Database files and .cc-switch directory lack explicit permission restrictions
- #3418切换模型之后对话不能保留
- #4061claude 配置文件不存在
- #4065切换claude code配置信息,会修改掉~/.claude/settings.json中enabledPlugins列表
- #4066claude 桌面 cowork描述回滚
- #4124ccs经常会自动覆盖provider
- #6345CC Switch v3.19.2 版本为啥cc-switch中保存的 key 变成掩码
- #6964编辑当前供应商:live 读取失败静默回退 DB 且允许保存;live 到达前的输入被 reset 吞掉
- #7614claude.json 被cc switch 强制恢复
- Why did my plugin configuration disappear after switching providers?
- CC Switch uses the “Common Configuration Snippets” feature. In the Common Configuration panel when editing a provider, click “Extract from Current Provider” to extract shared data such as enabledPlugins. Then enable “Write Common Configuration” when creating or switching providers to synchronize it automatically.
- Is this a design issue or a bug? Can it modify only env without changing enabledPlugins?
- This is intentional behavior described in the README FAQ. The live configuration file is generated from the selected provider configuration and is rewritten on switching; Common Configuration is the official retention mechanism.
- My conversation cannot be retained after switching models. What should I do?
- Claude Code reads env once at startup and does not hot-reload during execution. An env change reinitializes the session; the original conversation remains under ~/.claude/projects/<cwd>/ and can be continued with claude --resume.
- Why is settings.json still generated in the default directory after I changed the configuration directory?
- settings.json records the cc-switch path and must remain in the default location; otherwise, logic problems can occur.
- After saving, the key becomes masked characters and I cannot see its original value. Is this intentional?
- When local routing takeover is enabled, the backend replaces credential fields in the configuration file with masked strings. The real key remains only in the cc-switch database.
- After manually editing settings.json, the current provider configuration in cc-switch also changed. Is that normal?
- This is the current design to keep the live configuration consistent with cc-switch state. Copy the configuration before editing it to avoid directly changing the active 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.