# Microsoft Research — TokenEconomizer: Learning from Experience to Make AI Coding Agents More Efficient

- Company: Microsoft Research (microsoft.com)
- Announced: 2026-11-16T17:01:35+00:00
- Category: developer-tool-release
- Coverage: not counted
- Announcement: yes
- Group: announcements
- Source: https://www.microsoft.com/en-us/research/blog/tokeneconomizer-learning-from-experience-to-make-ai-coding-agents-more-efficient/
- Record: https://forck.live/items/36765-tokeneconomizer-learning-from-experience-to-make-ai-coding-agents-more-efficient
- Subject: Research / Phi
- Models affected: Claude Code
- License: open-source

UC Berkeley, Microsoft Research and Microsoft Security have released TokenEconomizer, an open-source plugin that learns from an agent's past sessions in a repository to cut token waste in later ones. Developers return to the same codebases day after day, yet agents often start each session from scratch, rediscovering familiar facts, loading unused tools and repeating unsuccessful approaches. Across 277 real bug-fixing tasks from six repositories and five agent and model combinations, the plugin lowered average cost by 18.4–30.9% and saved the most in all 30 repository-combination pairs without performance loss. It works through three mechanisms: micro-skills that capture repository-specific knowledge in one-line notes, pruning of tools history suggests the agent will not use, and intervention when an agent keeps hitting the same failure. Savings grow as experience accumulates, with cumulative costs falling below the default in every repository by the sixth task, and they carried over to sequential web development, where costs were 16.0–21.2% lower on Web-Bench. The plugin runs alongside existing agents without modifying their underlying models, requires no API key of its own, and keeps what it learns on the developer's machine.

## Evidence

Verbatim from https://www.microsoft.com/en-us/research/blog/tokeneconomizer-learning-from-experience-to-make-ai-coding-agents-more-efficient/:

> Developers use AI coding agents in the same codebases day after day, yet agents often start each session from scratch: rediscovering familiar facts, loading unused tools, and repeating unsuccessful approaches.
> 
> TokenEconomizer is an open-source plugin that learns from an agent’s past sessions in a repository to reduce waste in future sessions, without modifying the agent or its underlying model.
> 
> Across 277 real bug-fixing tasks, TokenEconomizer reduced costs by 18.4–30.9% across multiple AI coding agents. Costs fell in every repository tested, while task success rates remained broadly stable.
> 
> AI coding agents are increasingly help developers fix bugs and build features largely on their own, but every interaction with their models consumes tokens. In each session , an agent sends instructions, tool descriptions, and session history to its model. Most efforts to reduce this cost focus on individual tasks. Yet developers return to the same repositories, giving agents an opportunity to learn from previous work. Without that learning, an agent may repeatedly rediscover how to run tests, load tools it never uses, or spend dozens of turns revisiting the same error.

---

Record: https://forck.live/items/36765-tokeneconomizer-learning-from-experience-to-make-ai-coding-agents-more-efficient
Catalogue: https://forck.live/llms.txt
Current issue: https://forck.live/feed.md
