A plugin for Anthropic's Claude Code aims to cut what developers pay to run it, and its author says it has already done so in real use. The tool, called tokendoctor, reports up to 38 percent lower cost per request on the main thread, measured over six weeks of the author's own work at API list prices. The request context fell from 412K tokens to 219K in that period.

Does tokendoctor send data off your machine?

The plugin installs with two commands from the Claude Code plugin marketplace, and it runs entirely on the user's machine. Its documentation says it reads the user's settings and session files, and that only a few public pages of Claude Code's documentation are fetched once a day. Nothing of the user's is sent over the network, according to the project's notes.

Tokendoctor is built around a simple idea: there is no single fix that works for everyone. Its author says that if a user's sessions rarely pass 400K tokens, changing the context window will do nothing for them. A summary that runs just before a session ends can also cost more than it saves. Models, reasoning effort and the type of work all change the result, so the plugin starts by showing users their own numbers.

The main command, /tokendoctor:sessions, replays a user's past sessions at smaller context windows and estimates what each would have saved. It then breaks down where the tokens went over the last 30 days, or a number of days the user chooses. The command is read-only and changes nothing.

Other commands do the changes. /tokendoctor:optimize runs 38 checks against the documentation and proposes up to five changes based on the user's numbers. Each change is shown as a diff first and applies only if the user approves it. /tokendoctor:audit sorts setting problems by severity, and /tokendoctor:dashboard builds a local HTML file that shows spending by day, model, reasoning effort and subagent type.

How does the tokendoctor slide feature work?

The most distinctive feature is what the author calls the slide. When Claude Code would normally stop to write a summary of the conversation, the slide instead replaces old tool outputs with short pointers. Prompts, answers and decisions stay word for word, and there is no summary pause. The feature is off by default. Users can turn it on with /tokendoctor slide on, and /tokendoctor undo lists every change the plugin has made and can reverse any of them.

The benchmark results are mixed. On a TypeScript task that was run in 100K windows with Haiku 5.5, a full day of simulated work cost 19 percent less with the slide, $0.151 against $0.186, and took 33 percent less time. An evaluation harness task saw cost fall 35 percent. A bug-finding task was different: the slide cost 6 percent more, though it still finished 17 percent faster. The author notes that short tasks with one compaction gain time but rarely money, and that longer work saves more.

On quality, the author tested whether the slide made the model forget things. In a recall test, Claude Code's summaries kept every decision and note in every run. The slide matched that on Haiku 5.5 across three runs. On Sonnet 5.5, in a single run, it missed one note, which the model had skipped recording in its first reply after the slide. The author says no test so far shows the slide answering better or worse, so its benefit is in time and money rather than quality.

Will tokendoctor lower costs on Pro or Max plans?

The savings figures come from one person's usage, and the author warns that they depend on the plan and the workload. Costs are calculated at API list prices, and Anthropic does not publish how subscription plan limits count each kind of token, so users on Pro or Max plans will not see those dollar figures on their bills. The author also says the slide cannot run on Team and Enterprise logins or on machines with managed settings, where Claude Code's built-in guard sends compaction past the plugin. In those cases, the plugin's audit reports the restriction and offers a separate installation path.

Este artículo fue escrito con la asistencia de IA.
News Factory APP - noticias agénticas para impulsar tu SEO y AEO.