Switching providers resets claude settings.json - Claude Code
Quick fix
Before switching, extract the current provider’s configuration in “General Configuration” and select “Write to General Configuration” for the new provider.
Symptom
Section titled “Symptom”当有多个供应商,互相切换时会重置claude settings.json,虽然可以创建通用配置,但是随着claude code新增插件市场等,会产生新的配置。cc-switch只会更新当前选中的供应商,再次切换到其他供应商时,新配置就没了,除非每次有新配置产生,都及时同步到通用配置。期望能自动加载新配置到通用配置中,或者每次切换至替换已有的配置,而不是整体覆盖。感谢~When multiple providers are available and you switch between them, claude settings.json is reset. Although you can create a general configuration, new settings are created as claude code adds features such as a plugin marketplace. cc-switch only updates the currently selected provider. When you switch back to another provider, the new settings are gone unless you promptly synchronize every new setting to the general configuration. The expectation is to automatically load new settings into the general configuration, or to replace existing settings on every switch rather than overwrite the entire file. Thanks~
This cluster incorrectly combines several distinct “live configuration/import synchronization” issues that cannot share one fix. When Claude Code switches providers, it fully writes `~/.claude/settings.json`; maintainers said field-level merging caused state conflicts, so shared plugin, hooks, and similar settings must be passed between providers through “General Configuration”. When the current provider is re-enabled, manual changes may also be overwritten by an older configuration stored in the database; the provider edit feature reads the live file configuration.
The remaining reports are variants involving other applications or mechanisms: atomic replacement failure on a WSL path, delayed Claude Code extension-toggle synchronization, repeated import of the `default` provider when Codex starts, missing import of Gemini CLI JSONL sessions, continued live-configuration writes after OpenClaw is hidden, and plaintext credential storage. These issues cannot be resolved with the General Configuration steps. Codex repeated import was reported fixed in v3.15.0, and Claude Code extension-toggle synchronization was reported fixed in v3.13.0.
After changing Claude Code plugins, hooks, or other shared settings, edit the current provider and click “Extract from Current Provider” in the “General Configuration” panel.
When creating or switching providers, select “Write to General Configuration” (maintainers stated this option is selected by default) to pass shared settings such as plugins and hooks.
If you need to update the configuration saved for a provider after editing it manually, use the provider edit feature to read the live file configuration.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 11 real issues
- #220切换供应商会重置claude settings.json
- #1108[安全] API 密钥和敏感凭证以明文形式存储,需要静态加密保护
- #1258[Bug] 重新启用当前提供者时手动配置修改会丢失
- #1656feat(claude): merge settings.json instead of full overwrite to preserve hooks, plugins, permissions
- #1904enableClaudePluginIntegration Does Not Immediately Sync Current Provider on Enable
- #2533[Bug] Live import creates duplicate id="default" provider for Codex on every startup
- #2535[Bug] Live import creates duplicate id="default" provider for Codex on every startup
- #3938Gemini CLI 0.45.2 session-*.jsonl conversations are not imported or shown
- #4304~/.claude.json 被重置问题:哪个操作触发的?如何保留 numStartups / projects / hasCompletedOnboarding 等字段?
- #4593Bug: visibleApps.openclaw=false still allows OpenClaw live config writes
- #6219更新供应商失败:同步 Claude Live 配置失败: 写入 Claude 配置失败: 原子替换失败: \\wsl.localhost\Ubuntu-24.04\home\f\.claude\settings.json.tmp.25844.1786072807352757000.15 -> \\wsl.localhost\Ubuntu-24.04\home\f\.claude\settings.json: 不支持该请求。 (os error 50)
- Will manually changed settings be lost after re-enabling the current provider?
- Yes. The report says manual changes may be overwritten by the older version stored in the database when the current provider is re-enabled; maintainers recommend using the edit feature to read the live file configuration after manual updates.
- Why can the extension still not connect after enabling “Apply to Claude Code extension”?
- This issue was reported in v3.12.3. Maintainers stated it was fixed in v3.13.0; after upgrading, this toggle should immediately synchronize the current provider settings when enabled.
- Will its configuration still be written after OpenClaw is hidden?
- The report shows `visibleApps.openclaw=false` only hides the UI and may still synchronize and write `~/.openclaw/openclaw.json`; this issue did not provide a confirmed fix.
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.