The context_window field from Claude Code is currently broken (anthropics/claude-code#13783) - it reports cumulative session tokens instead of current context usage, producing impossible readings like 170% after compaction.
Request: Add --context-source flag similar to the existing --cost-source:
auto (default): prefer context_window, fall back to transcript
ccusage: always calculate from transcript
cc: always use Claude Code data
Workaround: jq 'del(.context_window)' before piping to ccusage forces transcript calculation.
Ref: #749 comment by @shailendher
The
context_windowfield from Claude Code is currently broken (anthropics/claude-code#13783) - it reports cumulative session tokens instead of current context usage, producing impossible readings like 170% after compaction.Request: Add
--context-sourceflag similar to the existing--cost-source:auto(default): prefercontext_window, fall back to transcriptccusage: always calculate from transcriptcc: always use Claude Code dataWorkaround:
jq 'del(.context_window)'before piping to ccusage forces transcript calculation.Ref: #749 comment by @shailendher