Skip to content

cc-switch usage statistics anomalies: 0/200K, double billing, pricing that will not delete

Quick fix

Upgrade to v3.16.3 for zero tokens, v3.17.0 for better Codex derived-session dedup, and v3.19.0 for deleted built-in pricing returning.

Error output
claude desktop升级Claude 1.8555.2 (a476c3) 后,对话上下文无法统计,一直显示0/200K,导致无法触发自动压缩
English translation

After upgrading claude desktop to Claude 1.8555.2 (a476c3), the conversation context cannot be counted and always shows 0/200K, so automatic compaction never triggers.

This cluster holds several kinds of usage statistics problem. The core one happens when Claude Code / Claude Desktop goes through CC Switch local proxy takeover and the upstream provider only supports OpenAI Chat Completions: the proxy forwards the streaming request without stream_options.include_usage, upstream returns no usage at the end of the SSE stream, and once the proxy converts back to Anthropic format the token usage is recorded as 0 — so the context reads 0/200K and automatic compaction cannot fire. Fixed in v3.16.3.

Codex derived sessions or a route switch could double-bill parent session history, or bill the old and new mapping at once. v3.17.0 improved thread deduplication and parent session baseline handling, though users in the issues still report it not fully resolved. Built-in cost pricing returning after deletion is the startup backfill logic reinserting the deleted entries; v3.19.0 fixed it by recording deleted model IDs in ~/.cc-switch/model-pricing.json. Other separate or unresolved symptoms: failed requests showing the original model rather than the mapped one, Codex side-chat requests not counted, and Hermes features misbehaving.

  1. If the Claude Code / Claude Desktop context is stuck at 0/200K or token usage reads 0, upgrade CC Switch to v3.16.3 or newer. That version injects stream_options.include_usage: true into streaming requests forwarded to openai_chat format upstreams, so usage data comes back.

  2. If Codex derived sessions are double-billed, upgrade to v3.17.0 or newer and retest with a newly created derived session. That version deduplicates by the thread identifier in the log file itself and treats the parent session history replay only as a cumulative baseline.

  3. If built-in model cost pricing reappears after deletion when you reopen the page, upgrade to v3.19.0 or newer. Deleting built-in pricing now also records a deleted marker locally, which is cleared after the startup backfill.

    ~/.cc-switch/model-pricing.json
    # v3.19.0 起,删除内置定价后该文件会记录已删除模型 ID 标记;无需手动编辑,升级后重新删除即可。
  4. If a failed request in the statistics page shows the original model rather than the routed one, that is current recording behaviour: a failed request has no complete response, so the model the client requested is recorded, while only a successful request records the final upstream model. To check the mapping is applied, look at a successful request or the logs.

  5. If Codex side-chat requests are not counted, Hermes module features do not work, or duplicate statistics persist after a Codex route switch, the input issues name no confirmed fix version. Upgrade to the latest version and retest, keeping the JSONL filename, session relationships, screenshots, or logs so you can file a new issue.

ToolClaude Code / Codex
Version0/200K token 统计问题影响 v3.16.3 之前版本,v3.16.3 修复;Codex 派生会话重复计费在 v3.17.0 改进但仍有用户反馈存在;内置定价删除复发在 v3.19.0 修复
PlatformsWindowsmacOS
Why is the Claude Code / Claude Desktop context stuck at 0/200K?
When upstream only supports the OpenAI format and the proxy does not request stream_options.include_usage, the streaming response carries no usage data, so CC Switch records every token as 0 after conversion. Upgrading to v3.16.3 or newer fixes it.
Manual compaction shows the context briefly — why does it return to 0/200K after the LLM replies?
Manual compaction produces one context measurement, but if later requests still lack upstream usage data the proxy keeps recording 0 tokens, so the display returns to 0/200K.
Why are Codex derived sessions double-billed?
A derived session contains the parent session history, and early import logic could count parent/ancestor history twice. v3.17.0 switched to deduplicating by thread identifier and treating parent history only as a cumulative baseline. If a newer version still duplicates, supply the JSONL filename and session relationships to continue troubleshooting.
Why does deleted built-in model pricing reappear after a restart?
The app runs a built-in pricing backfill at startup and previously had no idea an entry had been deleted, so it reinserted it. v3.19.0 records deliberately deleted model IDs in ~/.cc-switch/model-pricing.json and clears them after the backfill.
Why does a failed request show the pre-conversion model as the billed model?
A failed request has no complete response, so what is recorded is the original model the client requested; only successful requests record the final upstream model. It does not mean the route mapping failed.
Is a stray codex(session) entry in the statistics a bug?
In #5639 a maintainer replied it is normal behaviour. Other needs can be raised as a separate PR or issue.
Why are Codex side-chat requests not counted?
#4114 reports new sessions recording correctly while side-chat requests are not. That issue is still open/stale, and the input names no confirmed fix version.
The Hermes module does not work. What now?
#5397 reports parts of the Hermes module not working, with users also reporting /model misbehaving after switching model provider. That issue is still open and the input offers no confirmed fix.

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.