Tag Archives: 开源插件

Open-source plugin lets AI coding agents learn from past sessions to cut token costs

Original author: Brenda Potts

Researchers from UC Berkeley, Microsoft Research and Microsoft Security have released TokenEconomizer, an open-source plugin that helps AI coding agents spend fewer tokens by learning from earlier work in the same code repository. Developers often return to the same projects, yet agents usually begin every session from zero. They relearn how to run tests, load tool descriptions they never use, and burn many turns on the same error.

The team profiled Claude Code on 60 SWE-Bench tasks and found three recurring kinds of waste. Once a repository had at least five finished tasks, about 30% of tool calls repeated an earlier action in that repository, compared with only 7% matching another repository's history. The agent was given 23 tool descriptions every turn but never called 16 of them. Failed tasks made up 17% of the total but 32% of the spending.

TokenEconomizer reads each session's log and acts through three mechanisms. Micro-skills are one-line, repository-specific notes that enter the starting context only after several sessions confirm a pattern, and they are retired if later evidence contradicts them. Tool pruning removes tools the history suggests will go unused, while keeping core ones and allowing restoration. Failure-loop intervention uses a judge model to detect a stuck agent, suggests another approach, and alerts the developer if the agent stays stuck.

Tested on 277 SWE-Bench tasks across six repositories and five agent and model combinations, average costs fell by 18.4 to 30.9%, with success rates broadly stable. Savings grew as experience built up, and cumulative costs dropped below the default by the sixth task in every repository. Costs were also 16.0 to 21.2% lower on sequential web development and 6.4 to 19.6% lower on security auditing. Simply lowering reasoning effort saved similar amounts but hurt performance.

The plugin runs alongside existing agents without changing the underlying model, needs no API key of its own, and keeps what it learns on the developer's machine. For engineers and teams who rely on AI coding tools, it points to a practical way to reduce rising AI costs.


Source: Microsoft Research
Original title: Helping AI coding agents work smarter, for less
Original link: https://www.microsoft.com/en-us/research/blog/tokeneconomizer-learning-from-experience-to-make-ai-coding-agents-more-efficient/
Published: 2026-11-16

This is a summary written by our Editorial Team, not the full original text. Copyright remains with the original author and publisher; see the original link for the full article.

Disclaimer: The views and opinions expressed in this article are solely those of the original author(s) and do not necessarily reflect the views or positions of Overseas Chinese (overseaschinese.org). We republish, translate or summarize it for informational purposes only.