Skip to content

CC Switch does not show the remaining quota - Codex

Quick fix

Codex free accounts cannot query quota because of an official API limit, with no fix. Missing Grok Build usage needs a source change to streaming parsing.

Error output
For Codex free accounts, CC Switch does not show the remaining quota or the refresh/reset time.

The CC Switch usage statistics and balance display module has several known problems. For Codex free accounts, an official API limit stops CC Switch fetching and displaying the remaining quota and refresh time (Issue #3651). The community also reports usage problems with other tools: Claude input billing may have a logic difference when deducting cache, so the cost calculates as 0 when input is smaller than the cache (Issue #1191); and when a Grok Build session log (updates.jsonl) exceeds 50 MiB it trips the MAX_GROK_FILE_BYTES limit and the whole file is skipped, losing that usage permanently (Issue #6660).

  1. For the Codex free account quota display, there is no official fix yet — wait for a later version to give a clearer unavailable notice.

  2. For the missing Grok Build usage, change the source to remove the 50 MiB limit and, following the Codex implementation, replace reading the whole file with line-by-line streaming through BufReader.

    // src-tauri/src/services/session_usage_grokbuild.rs
    const MAX_GROK_FILE_BYTES: u64 = 50 * 1024 * 1024;
    if metadata.len() > MAX_GROK_FILE_BYTES {
    log::warn!("Grok session log too large ({} bytes), skipping: {}", ...);
    return Ok(SessionSyncResult::default());
    }
    let content = fs::read_to_string(file_path)?;
    let events = parse_grok_usage_events(&content);
    let file = fs::File::open(file_path)?;
    let reader = BufReader::new(file);
    for line_result in reader.lines() {
    // 逐行解析 turn_completed 事件
    }
ToolCodex / Grok Build / Claude
Version3.16.1 - 3.20.0 (受影响版本范围)
PlatformsWindowsmacOS
Why does only Grok Build lose usage while Codex does not?
The Codex reader is streaming with no size ceiling, while Grok Build has a 50 MiB MAX_GROK_FILE_BYTES limit and skips the whole file beyond it.
Why does Claude input billing sometimes show 0?
When input is smaller than the cache, CC Switch may have a logic difference calculating the input cost after deducting cache, producing 0. That is being tracked.

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.