JSONL Token Undercount (100-174x)
- Entity ID:
ent-20260423-r31a000000049 - Type:
concept - Scope:
private - Status:
active
Description
Systematic bug in all tools reading Claude Code JSONL session logs for token accounting: Claude Code writes JSONL entries during streaming, when input_tokens are still placeholders (0 or 1), and never updates them after the request completes. 75% of JSONL entries have usage.input_tokens of 0 or 1. Input tokens undercounted by 100-174x, outputs by 10-17x. Affects ccusage, ccaudit, claude-code-log, all JSONL-based auditors. Accurate source is the statusbar context JSON piped to statusline scripts, which maintains cumulative totals from finalized API responses.
Key claims
- JSONL input tokens are undercounted 100-174x
- Proxy-layer tools are the only accurate billing auditors
Relations
- JSONL Token Undercount (100-174x) --[affects]--> ccaudit
- JSONL Token Undercount (100-174x) --[affects]--> ccusage
- JSONL Token Undercount (100-174x) --[affects]--> claude-code-log
- Statusbar Context JSON (Accurate Token Source) --[bypasses]--> JSONL Token Undercount (100-174x)