Tokendoctor – the same Claude Code for up to 38% less github.com · 12 points · 4...

@best

Tokendoctor – the same Claude Code for up to 38% less github.com · 12 points · 4 comments · HN thread

TL;DR Tokendoctor is an open-source (MIT) Claude Code plugin by localixai that audits your Claude Code settings and session logs for overspending, replays past sessions at smaller context windows, and can apply reversible fixes. The author reports up to 38% lower main-thread API-list cost over six weeks of their own use, with the largest savings from a 400K window and Sonnet for subagents. Benchmarks show more modest and mixed gains, with a 'slide' feature that elides old tool outputs instead of summarizing.

  • Main-thread cost per request fell 38% in the author's own use (month before vs. week after), with context per request going from 412K to 219K tokens after a 400K window and Sonnet subagents.
  • Commands include /tokendoctor:sessions (replays your sessions at smaller windows), /tokendoctor:audit and /tokendoctor:optimize (38 setting checks, each change shown as a diff first), /tokendoctor:dashboard, and /tokendoctor undo.
  • The optional 'slide' replaces Claude Code's summaries with short pointers to old tool outputs, keeping prompts and answers verbatim; it is off by default and does not run under Team/Enterprise logins without an extra install.
  • On the author's bench of a TypeScript project with Haiku 5.5, the slide cut cost 19% and time 33% on a longer task, but on a short fixkit task it cost 6% more while saving 17% time.
  • The author's a-week-of-work benchmark shows −11% to −21% cost on medians, with single runs ranging from −40% to +17%; the author says the window change helps only if sessions regularly pass 400K tokens.
  • Requires no model call for its own commands and its always-on cost is estimated at about 235 tokens; costs are computed at API list prices, which the author notes do not reflect how plan limits weigh tokens.

Discussion The thread is small, with only a handful of comments, and it is skeptical rather than enthusiastic. One commenter questions whether the benchmark is comprehensive enough and argues the approach is complicated for little proven gain, noting that the stock Claude Code sometimes beats the 'advised' configuration. Another asks how several such tools can be combined without conflicts, and a third points to alternative token-reduction projects and a long list of AI tools.

  • Benchmark too narrow to prove the claimed savings (some): One commenter asks whether the tool was tested on all the benchmarks model makers publish. They say the bench here is not comprehensive and that the tuned setup sometimes does worse than default Claude Code, so gains are unproven.
  • Complexity not justified by the gain (some): The same commenter says they do not discourage experiments but find this one complicated for very little or no proven benefit.
  • Existing alternatives already work well (a few): A commenter reports successful use of rtk, another token-reduction tool, and asks how several such tools can coexist without conflicts.
  • Many overlapping AI tools exist; caveman is similar (a few): A commenter notes the sheer number of AI tools and suggests the caveman project pursues the same goal of limiting token use by a different method.

Links from the comments

#claudeCode #tokenUsage #costOptimization #llmTooling #benchmarks