Summing Claude Code JSONL per line double-counts token usage
10/19/2026 — 10/19, 19:19·1 sources (all)·1 reports (all)
Key takeaways
- Claude Code stores each session as JSONL, and a single API response can span multiple lines that each carry a full usage object, so summing…
Background & analysis
On October 19, 2026, a DEV Community post reported that summing Claude Code usage line by line roughly doubles the token count. According to the article, Claude Code stores each session as JSONL, and a single API response may be written across multiple lines, with every line carrying the full usage object for that response. Adding up the lines therefore counts the same tokens more than once. The author cites a session from August 2026 in issue #87303: summing cache_creation_input_tokens line by line gives 1,075,420, while deduplicating by message.id gives 560,751, an overcount of about 1.92x. The post notes that Anthropic closed the issue as "documented behavior." That is where the matter currently stands, and the source material contains no further developments.
AI-generated from 1 reports · updated 4 hours ago
Latest turnClaude Code stores each session as JSONL, and one API response can span several lines that each carry the full usage object, so summing lines counts the same tokens again. In an August 2026 session cited from issue #87303, cache_creation_input_tokens summed to 1,075,420 versus 560,751 after deduplicating by message.id. Anthropic closed the issue as documented behaviour.
Related AI tools
- Heat index
- 89
- All sources
- 1
- All reports
- 1
- First seen
- 4 hours ago
Reports on this story headlines open the original
Claude Code stores each session as JSONL, and one API response can span several lines that each carry the full usage object, so summing lines counts the same tokens again. In an August 2026 session cited from issue #87303, cache_creation_input_tokens summed to 1,075,420 versus 560,751 after deduplicating by message.id. Anthropic closed the issue as documented behaviour.
DEV Community · AIAI score 61
Other stories people are talking about
- Heat index 33Developer logs 225B Claude Code tokens in 30 days1 sources
- Heat index 33Tutorial explains Claude Code subagents and Skills with examples1 sources
- Heat index 82Developer pins Claude Code and Codex model tiers by task type1 sources
- Heat index 77Author lists 7 things Claude Code cannot see and the commands to expose them1 sources
- Heat index 71Developer shares a spec-driven development workflow with Claude Code1 sources
How is heat calculated?About the methodHide
Heat counts how many independent sources covered a story in the last 48 hours: one source counts once no matter how many posts it published, decaying with a 24-hour half-life. What ranks first is what many people are talking about.
This page aggregates public feeds. Headlines and summaries are machine-organized and remain the property of the original authors; verify important facts at the source. If you believe a headline or summary infringes your rights, email the contact address in the footer with the page URL and basis of your claim, and we will remove or replace it after review.
- Surge
- Discussion rising fast
- New
- First report within 6 hours
- Rising
- Still gathering discussion
