ccstatusline shows the wrong model name - Claude Code
Quick fix
Configure a Custom Command script in ccstatusline that reads the environment variables from the cc-switch database to show the real model.
Symptom
Section titled “Symptom”在启用 `cc-switch` 代理接管模式后,Claude Code 状态栏(`ccstatusline`)显示的模型名不正确。实际请求走的是代理路由后的模型,但状态栏固定显示为 `Sonnet-4.6`(或 `claude-sonnet-4-6`)。With `cc-switch` proxy takeover mode enabled, the model name shown in the Claude Code status bar (`ccstatusline`) is wrong. Requests really go to the model after proxy routing, but the status bar always shows `Sonnet-4.6` (or `claude-sonnet-4-6`).
Under `cc-switch` proxy takeover mode, `ccstatusline` reads the local session default model name by default rather than the effective model the proxy resolved. The status bar and the proxy backend billing model then disagree with the upstream model actually routed to (an OpenRouter model, for instance).
Separately, on declaring a 1M context with an uppercase `[1M]` in `ANTHROPIC_DEFAULT_OPUS_MODEL` and similar variables (Issue #2863): the Claude Code source is confirmed case-insensitive (`/\[1m\]/i.test(model)`), so an uppercase declaration is entirely compatible and is not the cause of a wrong model display or request.
In your Claude Code config, add a Custom Command for `ccstatusline` using a script in place of the default `bunx -y ccstatusline@latest`. That script reads the current config from `~/.cc-switch/cc-switch.db` and displays the matching `ANTHROPIC_DEFAULT_OPUS_MODEL` or similar environment variable for the requested model type.
// ~/.claude/settings.json{"statusLine": {"command": "m=$(jq -r '.model.id // .model // \"\"'); c=$(sqlite3 ~/.cc-switch/cc-switch.db \"SELECT settings_config FROM providers WHERE app_type='claude' AND is_current=1\"); case \"$m\" in *opus*|*Opus*) r=$(echo \"$c\"|jq -r '.env.ANTHROPIC_DEFAULT_OPUS_MODEL//empty');; *sonnet*|*Sonnet*) r=$(echo \"$c\"|jq -r '.env.ANTHROPIC_DEFAULT_SONNET_MODEL//empty');; *haiku*|*Haiku*) r=$(echo \"$c\"|jq -r '.env.ANTHROPIC_DEFAULT_HAIKU_MODEL//empty');; *) r=$(echo \"$c\"|jq -r '.env.ANTHROPIC_MODEL//empty');; esac; echo \"Model: ${r:-$m}\"","padding": 0,"type": "command"}}
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Does an uppercase `[1M]` generated in the environment variable cause an error when declaring 1M context support?
- No. The Claude Code source matches context length case-insensitively (`/\[1m\]/i.test(model)`), so `[1M]` in `ANTHROPIC_DEFAULT_OPUS_MODEL` and similar variables is entirely compatible and confirmed working.
- Does this Custom Command script work on Windows?
- Yes — the script is verified working in a Windows WSL environment, and applies to macOS as well.
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.