AI Compass / Quick reads
Your agent pays for the same detours again in every session
A coding agent starts almost from scratch in every session and keeps paying for the same detours. The open plugin TokenEconomizer learns from a project's earlier sessions and cut costs by 18 to 31% in the authors' test. Only measuring shows whether it saves anything in your own project.
In depth: Cutting repeated costs – TokenEconomizer put to the test
A coding agent like Claude Code starts almost from scratch in every session. If you often work in the same project, you keep paying for the same detours. The agent works out the same facts again, such as which test command works here. It sends along descriptions of tools that are never needed in this project. And it gets stuck in the same error loops. Researchers from Microsoft and UC Berkeley built the open plugin TokenEconomizer for this. A plugin is an add-on package that extends Claude Code with commands and hooks. TokenEconomizer learns from a project’s previous sessions and works in three places. Micro-skills are learned facts about the project that the agent receives at the start of a session. Tool pruning switches off tools that went unused over at least 10 messages in at least 2 sessions or over 5 sessions of any length. According to the README, it only writes the list of switched-off tools once no session has run in the project for an hour. The loop guard detects a stuck work step and prompts a different approach once. Stopping is up to you. According to the README, this cost 18.4 to 30.9% less on 277 test tasks from six repositories, depending on agent and model. With Claude Code, it was 23.6% less with Sonnet 5 and 30.9% less with Opus 4.8. AI LABS says in the video that performance suffered with no model. That is not quite right. According to the README, Opus 4.8 with the plugin solved 1.0 percentage points fewer tasks on the first attempt (pass@1), while Sonnet 5 solved 1.3 points more. There are two limitations. At first the plugin saves nothing, because it has to learn first. According to the video, in the tests it only became cheaper from about the sixth task onwards. And according to the Claude Code docs, the descriptions of MCP tools only end up in the context anyway when a tool is needed. How much switching tools off gains in your own project is therefore only shown by your own measurement.
Tool and alternative
TokenEconomizer is licensed under Apache 2.0, needs Python 3.10 or newer and runs locally. According to the README, what it learns stays in ~/.tokeneconomizer. Its own model calls run on your Claude plan and appear in its reports. Installation according to the README: clone the repo, then claude plugin marketplace add "$PWD/TokenEconomizer" and claude plugin install tokeneconomizer@tokeneconomizer. Leave the clone in place, the plugin runs from it. AI LABS offers a modified version in its own community that reads the stored sessions of the last 30 days on first start. You don’t need it. Without a plugin, Claude Code’s built-in tools help, such as /context and /clear, see the card Keeping context clean.
Sources
- AI LABS, “This Is Microsoft’s New Tool Finally Fixed Claude’s Usage Limits”, 28 October 2026 (1:38, 2:42–4:55, 7:07–8:45, 10:51–12:30)
- Microsoft Research and UC Berkeley, TokenEconomizer, README, retrieved 30 October 2026; paper arXiv 2610.22732
- Claude Code docs, Costs (MCP tools are only loaded when needed), retrieved 30 October 2026
Advertising in the source: sponsored by DataImpulse (residential proxies, unrelated to the content), plus self-promotion for AI Labs Pro.
You can try this with your team in the AI Lab. See the AI Lab