JSONL Token Undercount (100-174x)

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

Relations

Sources

src-20260423-542f02260352