The Pulse
Microsoft-backed study reports lower coding-agent costs with TokenEconomizer
A research team found that TokenEconomizer reduced mean costs by 18.4% to 30.9% across coding-agent tests. The open-source plugin learns from earlier sessions in a repository without changing the agent or its underlying model.

An open-source plugin reduced the mean cost of running AI coding agents by 18.4% to 30.9% in tests on real bug-fixing tasks, according to a research paper from a team including Microsoft researchers. The researchers reported comparable task success overall, with the success measure Pass@1 improving in four of five agent-and-model combinations.
Source arxiv.org
Microsoft Research described the findings in a November 16 post. The project, called TokenEconomizer, is a collaboration among UC Berkeley, Microsoft Research and Microsoft Security; its paper was posted as a preprint on October 15.
Tests across coding tasks
The research team tested the controller on 277 SWE-Bench tasks from six repositories, using five agent-and-model combinations. The benchmark consists of real bug fixes in open-source Python projects.
Each repository began with no prior session history. Costs fell in every repository under each tested combination, the researchers reported, while lowering a model's reasoning effort saved similar or greater amounts but substantially degraded performance.
Early tasks could cost more while the controller learned, according to Microsoft Research, but cumulative costs fell below the default in every repository by the sixth task in the Claude Code tests. The reported savings include the cost of TokenEconomizer's own model calls.
In another set of tests, the team evaluated 102 Web-Bench tasks across five web-development projects and 200 tasks from two security-auditing benchmarks. The team reported cost reductions of 16.0% to 21.2% on Web-Bench and 6.4% to 19.6% on the security benchmarks, with results on their respective quality measures remaining comparable to default execution.
What the controller learns
The plugin reads an agent's session log after the work is finished and updates its knowledge of the repository. It works through interfaces the agent already provides, without changing the agent or its underlying model.
One mechanism builds short, repository-specific notes called micro-skills from patterns across sessions. Notes enter the agent's starting context after several sessions confirm a pattern, and the controller retires them if later evidence contradicts them.
A second mechanism removes tools that a repository's history suggests are unlikely to be used, while retaining core tools for commands and file editing. Removed tools can be restored if needed.
A judge model also checks whether an agent encountering repeated failures is stuck or still making progress. If it is stuck, the agent receives a short suggestion to try another approach; if it remains stuck after that, the open-source plugin alerts the developer rather than stopping the work itself.
Where costs recur
A separate profiling exercise examined Claude Code on 60 SWE-Bench tasks across six repositories. Once a repository had at least five completed tasks, 30% of tool calls repeated an action from an earlier task in that repository, compared with 7% matching an action in another repository's history, the researchers found.
The researchers also found that the agent received 23 tool descriptions on every turn, although 16 tools were never called. Failed tasks accounted for 17% of the tasks but 32% of spending in the profiling exercise.
The plugin supports Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental support for other agents. Its learned information stays on the developer's machine, and the plugin does not require an API key of its own.
Sources
Companies in this story
Related stories
- Microsoft Research Used PDD Kit to Formally Verify Login Logic in a Rust Web App
- Entire uses saved coding sessions to address agent memory gaps
- JetBrains MPS 2026.2 adds tools for coding agents
- JetBrains adds Claude Agent and Codex to ReSharper
- Microsoft Uses Bias Correction to Improve 2-to-6-Week Forecasts