A new local plugin called tokendoctor claims to reduce the cost of using Claude Code by up to 38% by identifying and fixing inefficient configurations. Developed by localixai, the tool analyzes a user's actual session history to pinpoint where they are overpaying for tokens and provides a set of 38 specific checks to optimize the environment.

This image demonstrates the tool's primary function of analyzing session history directly within the Claude Code environment.
Auditing and Optimization Mechanisms
Tokendoctor functions by replaying a user's sessions at smaller context windows to determine what would have been saved. It specifically looks for errors like unreadable settings files, incorrect keys, and environments where prompt caching is disabled.
The plugin runs 38 distinct checks against the official documentation. These include identifying when a user is forced onto an expensive model for subagents or when large directories (like 'dist' or 'build') are not properly excluded from the model's read permissions.
“tokendoctor: the same Claude Code for up to 38% less.”
— GitHub - localixai/tokendoctor: tokendoctor: the same Claude Code for up to 38% less. A Claude Code plugin that shows wh
Context Management and 'Slide' Feature
One of the tool's primary mechanisms is the 'slide' command. While Claude Code typically summarizes old tool outputs to save space, tokendoctor replaces those summaries with the actual old tool outputs. This keeps the conversation word-for-word while avoiding the cost of a new summary call.
The tool also manages the 'autoCompactWindow.' For example, it can suggest setting the window to 400,000 tokens to balance context size with the need to maintain a warm prompt cache.
Local Dashboard and Trade-offs
Users can generate a local HTML dashboard that tracks every token spent on their machine, categorized by project, hour, and model. This file remains local and does not require a network connection to view.

The dashboard illustrates the specific types of inefficiencies, such as redundant reading, that the tool identifies.
The effectiveness of the tool depends on the user's specific usage patterns. For instance, if a user's sessions rarely exceed 400,000 tokens, the window adjustments may provide no measurable savings. Additionally, a summary that occurs just before a session ends might cost more than the savings provided by the optimization.
What Hacker News readers are saying
- Skeptical: One commenter expressed skepticism about the tool's comprehensiveness, suggesting that the default configuration might already be superior and that the added complexity might not yield provable gains. comment ↗
- Experience: A user reported having success with the tool but raised a question about whether it could be used simultaneously with other similar tools without causing conflicts. comment ↗
- Alternative: Another commenter suggested that the goal of limiting token usage could be achieved through different projects, such as 'caveman', which approach the problem differently. comment ↗
- Skeptical: One reader questioned the actual efficacy of such tools, arguing that they might subtly degrade performance in ways that are difficult for users to detect. comment ↗
Summarized opinions from the Hacker News thread, not verified facts. Read the full discussion ↗