Microsoft Research, working with UC Berkeley and Microsoft Security, has released TokenEconomizer, an open-source plugin that tries to make AI coding agents cheaper by learning from earlier sessions in the same repository. In a blog post dated 16 November 2026, the authors say the plugin reduced costs by 18.4% to 30.9% across 277 real bug-fixing tasks, in every repository they tested, without a broad drop in success rates. It does not change the agent or the underlying model. It sits alongside tools developers already use.
Quick Take
- What it is: An open-source plugin that turns finished coding-agent sessions into guidance for the next session in the same codebase.
- Who built it: Researchers at Microsoft Research, UC Berkeley and Microsoft Security, in a paper titled “TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents.”
- The headline result: 18.4% to 30.9% lower average cost on 277 SWE-Bench tasks, across five agent and model combinations and six repositories. The authors say costs fell in all 30 repository-combination pairs, with no performance loss, and that Pass@1 rose in four of the five combinations.
- How it saves money: short “micro-skill” notes, pruning unused tools, and stepping in when the agent is stuck in a failure loop.
- Practical details: the blog says the plugin needs no API key of its own and keeps what it learns on the developer’s machine. Savings figures include the cost of TokenEconomizer’s own model calls.
In plain English
Coding agents often waste money doing the same work twice: looking up how to run the tests, loading tools they never use, or getting stuck on the same error. TokenEconomizer is a free add-on that watches what an agent did in a project and uses that history to spend fewer tokens next time. In Microsoft’s tests on real bug-fixing tasks, bills fell by about a fifth to a third, and the agent still got the work done about as often. The results come from the team’s own paper, on one benchmark, so other projects may see different savings.
What happened
The Microsoft Research blog, published 16 November 2026, argues that most cost-cutting work looks at a single task, even though developers return to the same repositories day after day. Without memory of that earlier work, “an agent may repeatedly rediscover how to run tests, load tools it never uses, or spend dozens of turns revisiting the same error.”
A profiling study of Claude Code on 60 SWE-Bench tasks, run in sequence inside each repository, found three recurring kinds of waste. After a repository had at least five completed tasks, 30% of tool calls repeated an action from an earlier task in that repository, and only 7% matched an action from another repository. The agent was given 23 tool descriptions on every turn, but 16 of those tools were never called. And the 17% of tasks that failed accounted for 32% of the spending.
The authors also tested three popular open-source plugins that use a fixed cost-saving strategy. Each helped in some repositories and not in others. Their conclusion is that cost control has to adapt to the repository, rather than apply one trick everywhere.
How the plugin works
TokenEconomizer reads a session log after each run and updates what it knows about the repository. It then acts through three mechanisms, using only interfaces the agent already provides.
Micro-skills are one-line notes about repository-specific knowledge. The system proposes a note only after several sessions have confirmed the pattern, adds it to the agent’s starting context, and retires it if later evidence contradicts it.
Tool pruning removes tools that history suggests the agent is unlikely to use, while always keeping core tools for running commands and editing files. Removed tools can be restored if needed.
Failure-loop intervention watches for an agent that keeps hitting the same failure. A judge model decides whether the agent is truly stuck or still making progress. If it is stuck, the agent gets a short note suggesting a different approach. In the open-source plugin, if the agent is still stuck after that note, TokenEconomizer alerts the developer rather than stopping the work itself.
The controller is designed to revise its decisions as new evidence arrives. Early tasks can cost more while the system learns. The authors say cumulative costs fell below the default in every repository by the sixth task.
What the numbers do and do not show
The main evaluation used 277 SWE-Bench tasks from six repositories and five agent-model combinations, starting with no prior session history. TokenEconomizer lowered mean cost per task by 18.4% to 30.9%. The authors contrast that with a simpler tactic, lowering the model’s reasoning effort, which saved a similar or larger amount but “led to substantial performance degradation.”
The savings also showed up in two other settings: 16.0% to 21.2% lower costs on sequential web development in Web-Bench, and 6.4% to 19.6% lower costs on security auditing, “where every task is in a new repository.” That last figure is smaller, as you would expect when there is less repository history to learn from.
These are the authors’ own results, on public benchmarks, with their own plugin. They are more careful than many cost claims in this market, including some we have already examined. Reason Machines said its coding harness could cut costs by 20 times, but its own benchmarks showed 22%. TokenEconomizer’s reported range is lower and better documented, but it is still a single-lab evaluation, not a third-party audit.
The result also sits in a broader debate about whether the wrapper around a model matters as much as the model itself, a question recent coding-agent harness tests have started to measure. TokenEconomizer is a wrapper that claims to save money without changing the model at all.
Why it matters
If the savings hold up in everyday use, this is one of the more practical cost ideas to come out of a corporate lab this year: keep the agent you already have, keep the model you already pay for, and tax the waste that comes from treating every session as a blank slate. That is especially relevant as teams run agents more often in the same repos, including in CI, which is the same direction Claude Code’s new experimental Code Mode and other coding-agent features are pushing.
The limits are clear. The plugin has to see enough prior sessions to help. The first jobs in a new repo may be more expensive, not less. And a judge model that interrupts a failing loop can, in principle, also interrupt useful persistence. The authors say they have accounted for their own extra model calls in the savings figures. Buyers should still measure TokenEconomizer’s overhead on their own traffic.
What’s still open
- How well the savings transfer from SWE-Bench and Web-Bench to private monorepos, other languages, and agents beyond the five combinations tested.
- Which coding agents the open-source plugin supports today, and how much setup it requires.
- Whether the micro-skill notes or trajectory logs ever leak sensitive repository details off the machine, despite the claim that learning stays local.
- How a “stuck” decision by the judge model behaves in long, legitimate debugging sessions.
Sources
- Microsoft Research blog, “TokenEconomizer: Learning from Experience to Make AI Coding Agents More Efficient,” 16 November 2026
- Liu, Xu, Singh, Chen, Inala, Yu, Stoica, Galley and Gao, “TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents”
i10x Perspective
The interesting claim here is not that someone found another 20% in the token bill. It is that the cheapest gain may come from memory, not from a smaller model. If coding agents are going to live in the same repos for months, starting from scratch every morning is a design flaw, not a law of nature. TokenEconomizer is an early fix, from a lab that measured it carefully. The next test is whether developers actually leave it on after the sixth task, when the promised savings are finally supposed to show up.






