Skip to content

settings.json Full Overwrite Causes Plugin Failure - CC Switch

Quick fix

Upgrade to v3.20.1+ to fix the bug that clears enabledPlugins when switching configs.

Error output
[Bug] 切换 Claude Code 配置时 settings.json 被全量重写,enabledPlugins / statusLine 等字段被清空或重置
English translation

[Bug] settings.json is fully overwritten when switching Claude Code configurations, causing fields such as enabledPlugins and statusLine to be cleared or reset.

In cc-switch versions prior to v3.19.x, three overlapping bugs caused issues: Common Config was only extracted once and not updated, the switch process did not write back Common Config, and auto-inference logic failed. Consequently, cc-switch used a strategy of reading an internal template and overwriting `~/.claude/settings.json` entirely, rather than incrementally merging. As a result, non-supplier-specific fields like `enabledPlugins`, `statusLine.command` were cleared or reset to defaults, causing user-defined plugins and status bar scripts to fail silently.

This issue has been fixed in subsequent versions by introducing an incremental merge mechanism that ensures only supplier-related `env` fields are updated while preserving other user configurations.

  1. Upgrade cc-switch to the latest version (v3.20.1 or higher) to obtain the version containing this fix.

ToolClaude Code
VersionUnknown
PlatformsmacOSWindows
Will my old configuration be lost after upgrading?
No. Upgrading only replaces the binary file. Since the previous bug already caused some configuration loss, it is recommended to re-check whether plugins and status bar configurations in `~/.claude/settings.json` are intact after upgrading. Manually restore if necessary.
Why didn't I have this problem with routing mode enabled before?
Routing mode primarily involves the pointing of `ANTHROPIC_BASE_URL` and model mapping logic (see #2694). The core of this Issue is the incorrect overall write strategy of the `settings.json` file. Regardless of whether routing is enabled, as long as a config switch is triggered and the version is lower than the fixed version, the overwrite behavior that clears fields will occur.

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.