Microsoft Research plugin cuts AI coding agent costs by up to 31% by learning from past sessions
TokenEconomizer, an open-source plugin from Microsoft Research and partners, reduces token waste in AI coding agents by adapting to repository-specific patterns without altering the agent or underlying model.
1 source · cross-referenced
- TokenEconomizer is an open-source plugin that reduces token waste in AI coding agents by learning from past sessions in the same repository.
- Across 277 real bug-fixing tasks, it cut costs by 18.4–30.9% across five agent–model combinations without reducing task success rates.
- The plugin adapts to repository-specific patterns using micro-skills, tool pruning, and failure-loop intervention, with savings growing as experience accumulates.
- Evaluated on SWE-Bench and extended to web development and security auditing benchmarks with measurable cost reductions.
AI coding agents frequently repeat work across sessions in the same repository: rediscovering facts, loading unused tools, and revisiting the same failures. Microsoft Research and collaborators propose TokenEconomizer, an open-source plugin that learns from past sessions to reduce this waste without modifying the agent or its underlying model.
In experiments on 277 SWE-Bench bug-fixing tasks across six repositories and five agent–model combinations, TokenEconomizer reduced average cost per task by 18.4–30.9% while broadly maintaining task success rates. Savings grew as the plugin accumulated experience, with cumulative costs falling below default by the sixth task in every repository.
The plugin operates through three mechanisms: micro-skills that capture repository-specific knowledge as one-line notes, tool pruning that removes tools unlikely to be used based on historical patterns, and failure-loop intervention that redirects agents stuck in repetitive loops. All three contribute to savings, with the combined approach delivering the largest reductions.
TokenEconomizer’s reported savings account for its own model call costs. On SWE-Bench, the plugin achieved cost reductions across all 30 repository–agent combinations tested, outperforming fixed cost-saving strategies that did not adapt to the repository. Similar savings were observed in sequential web development (16.0–21.2% lower costs) and security auditing (6.4–19.6% lower costs).
The work is documented in the paper TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents, authored by researchers from UC Berkeley, Microsoft Research, and Microsoft Security. The plugin is designed to integrate with existing coding agents, offering a practical route to more efficient agentic workflows in software development.
- Dec 2, 2026 · The Verge — AI
Walmart enables Meta’s Muse AI agent to shop on its platform via Agent Gateway
Trust79 - Dec 2, 2026 · TechCrunch — AI
Ora raises $75M to adapt websites for AI agent interactions
Trust79 - Dec 2, 2026 · Latent Space — swyx
Google DeepMind researchers describe how Gemini 4 performs multi-day engineering tasks
Trust79