Skip to content

After enabling proxy mode, model mappings are not written to Claude Code settings.json

Quick fix

Local Routing does not write model mappings to Claude Code settings.json. Configure them in the current CC Switch Provider and switch to enable them.

Error output
可以看到只把代理URL写到 ~/.claude/settings.json 文件中,模型映射没有写进去。
English translation

Only the proxy URL is written to ~/.claude/settings.json; the model mapping is not written.

This report was marked as an enhancement. The maintainer explained that this is intended behavior in Local Routing mode, not a bug. When routing is enabled, `~/.claude/settings.json` only directs Claude Code requests to the CC Switch local routing address. Model mappings are stored in the CC Switch Provider configuration and applied dynamically by the proxy forwarding layer after requests enter CC Switch.

The maintainer explained that if routing mode still wrote `ANTHROPIC_MODEL` or `ANTHROPIC_DEFAULT_*_MODEL` to live settings, Claude Code could keep sending an old provider model name after switching providers. The new provider might not support it. Therefore, the implementation removes these model override fields from live settings and keeps only the local routing address and placeholder token.

  1. After enabling Local Routing mode, do not expect model mappings to be written to `~/.claude/settings.json`; this file only directs requests to the CC Switch local routing address.

  2. Switch to the Provider you want to use in CC Switch and enable the corresponding model. If that provider has a model mapping, such as mapping Opus to GLM-5.1, the maintainer said the mapping works after switching to that provider.

ToolClaude Code
Version3.14.1(报告版本,非已确认的受影响范围或修复版本)
PlatformsmacOS
If Local Routing is not filled in, will claudecode assume it is still calling the claude model series? Is there a solution? I want claude to know it is calling the gpt model series.
The original issue did not provide a verifiable solution for making Claude Code identify GPT series models in Local Routing mode. The maintainer stated that model mappings are handled dynamically by the current CC Switch Provider configuration.
When using routing, can model mappings be customized?
The maintainer replied: switch to the relevant provider and enable the corresponding model. For example, if the Zhipu provider has an `opus-->glm5.1` mapping configured, switch to that provider after enabling routing to use the mapping.

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.