Popular 30k-Star Claude Code Repo Overcounted Tokens 2.35x Due to Documented Bug
A widely used Claude Code template repository with over 30,000 GitHub stars contained a token-counting bug that inflated usage metrics by approximately 2.35 times. The flaw stemmed from summing token usage across every JSONL record per assistant message, even though Claude Code splits a single message into multiple records — each repeating the same usage data. Anthropic's own SDK documentation explicitly warned about this behavior and provided a reference fix, meaning the bug was publicly known but never addressed in the repo. A developer identified and submitted a fix backed by synthetic corpus testing that confirmed exact over-counting, and two AI reviewers approved the pull request. As of the article's publication, the fix had been open for ten days with no response from any human maintainer.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in