Skip to content

cc-switch config not applied / not picked up after switching - Claude Code / Codex

Quick fix

Confirm the app actually reads the config path cc-switch writes to, then check routing and plugin toggles, duplicate keys, and version compatibility.

Error output
切换对 Claude Code for VS Code 不生效 。
最新版的Claude Code for VS Code 使用GUI启动了,不再通过命令行启动,配置env好像不生效了。
English translation

Switching has no effect on Claude Code for VS Code. The latest Claude Code for VS Code launches from a GUI rather than the command line, and the env config no longer seems to apply.

This cluster covers several different "config not applied" scenarios, and the root causes are not the same:

1. The config path cc-switch writes to does not match the one the target app actually reads. Hermes on Windows reads %LOCALAPPDATA%\hermes while older cc-switch wrote to ~/.hermes; WSL and Windows do not share one Claude Code config; a newer Claude Desktop may no longer read from the original Claude-3p/configLibrary path. 2. When switching provider or in routing mode, cc-switch rewrites the target config file, so fields you added by hand get overwritten or lost — hooks, coworkEgressAllowedHosts, supported_reasoning_levels inside cc-switch-model-catalog.json, and so on. 3. After the target app or the upstream format changes, the fields cc-switch generates are no longer recognised. The 1M context declaration stopped working after a Claude Desktop update and claude-opus-4-8 has to be rolled back to claude-opus-4-6; a Codex model catalogue with no reasoning-effort declaration degrades to none/high. 4. The config itself conflicts, or a feature toggle is off. Duplicate keys make saving fail, Claude Code for VS Code needs the 应用到Claude插件 (apply to the Claude plugin) option ticked, and special Codex TOML fields such as startup_timeout_sec could not be written correctly through the UI in older versions.

  1. Confirm which config file the target app actually reads. On WSL, point cc-switch at the config path inside WSL under 设置 > 高级 > 配置文件目录 (Settings > Advanced > Config directory); Windows and WSL do not share one config.

  2. If Claude Code for VS Code is not picking up the change, tick 应用到Claude插件 (apply to the Claude plugin) in cc-switch settings, then restart VS Code and the Claude plugin.

  3. If saving or switching reports a duplicate key, clean up the duplicated key names in the provider or model mapping first, then save again.

  4. If the 1M context stopped working after a Claude Desktop update, edit claudeDesktopModelRoutes in the cc-switch database as a stopgap, changing claude-opus-4-8 to claude-opus-4-6, then restart Claude Desktop.

    .cc-switch/cc-switch.db
    # 在 claudeDesktopModelRoutes 字段中:
    # 将 claude-opus-4-8 改为 claude-opus-4-6
  5. If Hermes is not picking up config on Windows, upgrade cc-switch to v3.16.5 or newer. That version resolves the config directory as HERMES_HOME first, then the platform default path.

  6. If Codex reasoning effort is down to none/high only, do not add mapped models by hand when adding a third-party Codex provider — let cc-switch use its default full model config. If you need supported_reasoning_levels, note that switching provider may overwrite that file.

  7. If you have edited the Claude Code config by hand (hooks, for example), avoid switching straight from routing mode back to non-routing mode; that transition can currently lose your manual edits. Back the config file up first.

ToolClaude Code / Codex
Version3.15.0 - 3.20.0
PlatformsWindowsmacOSLinux

This page is distilled from 28 real issues

Why doesn't Claude Code for VS Code pick up a cc-switch switch?
Tick 应用到Claude插件 (apply to the Claude plugin) in cc-switch settings first. If it still does not apply, confirm VS Code is using the environment variables and config path cc-switch writes to, then restart VS Code.
Why do hooks, general settings, or coworkEgressAllowedHosts I added by hand get overwritten?
cc-switch rewrites the target config file when you switch provider or routing mode, and some fields are currently not preserved. Back the config up before switching, or wait for cc-switch to support merging user-defined fields.
The 1M context config stopped working after a Claude Desktop update. What now?
As a stopgap, edit claudeDesktopModelRoutes in .cc-switch/cc-switch.db, change claude-opus-4-8 to claude-opus-4-6, and restart Claude Desktop.
Why doesn't the Claude Code config inside WSL update?
Windows and WSL do not share one config file. Point cc-switch at the config path inside WSL under 设置 > 高级 > 配置文件目录 (Settings > Advanced > Config directory).
Why can't Codex's startup_timeout_sec be set through cc-switch?
In older versions the Codex config file format is unusual and some custom fields could not be written correctly through the UI. A maintainer said a sizeable refactor is needed. The stopgap is to not manage that MCP field with cc-switch, or to edit the Codex config by hand.
Why is Codex reasoning effort down to none and high only?
The model catalogue cc-switch generates may not declare low/medium/high/xhigh. When adding a third-party Codex provider, do not add mapped models by hand — let cc-switch use its full default config. Editing cc-switch-model-catalog.json by hand may be overwritten after switching provider.
How do I remove cc-switch completely?
Delete the cc-switch app itself and clean up its config directories by hand, for example ~/.cc-switch and ~/.codex. Session history usually lives in ~/.codex and is unrelated to cc-switch itself.

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.