Why it mattersA team paying for a coding agent can keep the same agent and model and spend less. The savings come from a plugin that watches the sessions.
A team that pays for a coding agent every day has one choice on the bill: the model. A new plugin from Microsoft Research and UC Berkeley adds another. TokenEconomizer sits beside Claude Code, Codex, GitHub Copilot CLI or Pi. It watches what the agent does in a repository. The next session there costs less. The agent and the model do not change.
The authors released the code on GitHub on 13 October under Apache 2.0. The repository had 409 stars at the time of writing. The matching paper (arXiv 2610.22732) was submitted on 15 October.
Three mechanisms
The authors say the plugin has three parts. Micro-skills learn facts about a repository. The facts come from sessions that have already run there. One session finds that tests run with python -m pytest here. Another finds that a build step must run first. A third learns that a certain file holds generated output. The plugin writes these facts into the start of the next session. The agent does not have to find them again. A fact enters only after three sessions have confirmed it. It leaves when later sessions contradict it.
Tool pruning stops loading tools the agent is not using. Every loaded tool's definition is sent with every request. So an unused tool is paid for over and over. The plugin counts the prompts a tool goes unused. The limit is 10 prompts spread over at least 2 sessions. The second limit is 5 sessions of any length. A tool that passes either limit is left out. The plugin writes the change into the agent's own settings. One command brings the tool back.
The loop guard watches a turn for signs it is stuck. A judge model checks the turn. The plugin acts when the judge is at least 70 percent sure. It adds a short redirect to the agent's context. At most one redirect per turn. If the turn is still stuck, the plugin tells the user how to stop it. The plugin never stops the turn itself.
What they measured
The paper ran five agent and model pairs on 277 SWE-Bench tasks from six repositories. Each repository's tasks ran in order, starting with nothing learned. The authors report an 18.4 to 30.9 percent cut in mean token cost across the five pairs. The savings held in all 30 repository and pair cells. Pass@1 moved up in four of five pairs and down 1.0 point on one (Claude Code with Opus 4.8).
Per pair, the authors say Claude Code with Sonnet 5 cost 23.6 percent less with Pass@1 up 1.3 points. Codex with GPT-5.6 Sol cost 26.1 percent less with Pass@1 up 1.6. Copilot CLI with Sonnet 5 cost 18.4 percent less with Pass@1 up 2.6. The authors say every number includes the plugin's own model calls at cache pricing.
The plugin was also measured on Web-Bench and on two security-auditing benchmarks. The authors say cost fell between 6.4 and 21.2 percent across those, depending on task structure.
The plugin keeps what it learns on the user's own machine, under ~/.tokeneconomizer. It needs no API key of its own and runs on the agent's own plan or login.
Source
microsoft/TokenEconomizer on GitHub. Paper: TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents (arXiv:2610.22732).
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.
