TokenEconomizer: Learning from Experience to Make AI Coding Agents More Efficient

In one sentence

Microsoft Research and partners introduced TokenEconomizer, an open-source plugin that learns from past coding agent sessions to cut token costs without modifying the model.

Key points

  • Addressing waste from repeated exploration, unused tools, and failure loops, Microsoft Research and partners released the open-source plugin TokenEconomizer.
  • It optimizes future tasks from past repository sessions using three mechanisms: micro-skills, tool pruning, and failure-loop intervention.
  • Across 277 real bug-fixing tasks, TokenEconomizer cut average costs by 18.4% to 30.9% across multiple agents while keeping success rates stable.
  • The plugin requires no changes to the underlying agent or model, keeping all learned experience on the developer's local machine.

In depth

An AI-written overview of the original article, not the article itself.

Researchers from UC Berkeley, Microsoft Research, and Microsoft Security have released TokenEconomizer, an open-source plugin that helps AI coding agents learn from past sessions to cut costs without modifying models. Across 277 bug-fixing tasks, it reduced average costs by 18.4% to 30.9% while keeping success rates stable.

Where tokens are wasted

According to the article, coding agents often start from scratch in familiar repositories. Profiling Claude Code revealed three main sources of waste: repeating known actions, loading 16 unused tools per turn, and spending 32% of costs on the 17% of tasks that failed.

Three optimization mechanisms

TokenEconomizer reads session logs to update its repository knowledge through three mechanisms: adding verified one-line micro-skills to the starting context, pruning rarely used tools, and intervening in failure loops by suggesting new approaches or alerting developers.

Test results and deployment

Tested across five agent-model combinations, the plugin lowered costs in every repository. It also cut costs by 16.0% to 21.2% on Web-Bench and 6.4% to 19.6% on security auditing. The plugin requires no extra API key and stores learned data locally.

Read originalOpens microsoft.com

This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.

Recent stories from this source