2026-11-16 · ← News
TokenEconomizer cut coding agent costs by up to 30.9% by learning each repository
Microsoft Research, UC Berkeley and Microsoft Security introduced an open source plugin that learns from a coding agent's previous sessions. Across 277 SWE Bench tasks, it reduced costs by 18.4% to 30.9% while keeping success rates broadly stable.
The image could not be loaded.
TokenEconomizer uses work history from one repository so a coding agent does not repeat the same exploration in every new session. The researchers tested it on 277 SWE Bench tasks across six repositories and five agent and model combinations.
Three interventions target repeated exploration, unused tools and failure loops
After a session, the plugin reads its log and updates three forms of assistance. Micro skills store one line repository facts, tool pruning hides tools unlikely to be useful in that project, and failure loop intervention warns the agent when it repeats an unsuccessful approach.
A profile of 60 tasks shows where waste accumulated. After at least five completed tasks, 30% of tool calls repeated an action from an earlier task in the same repository. The agent received descriptions for 23 tools on every turn although 16 were never used. The 17% of tasks that failed consumed 32% of spending.
The savings come from a control layer around the model
TokenEconomizer changes neither the underlying model nor the agent. It adds an adaptive controller through interfaces the agent already exposes, and the reported results include the controller's own model calls. For teams that repeatedly work in the same codebase, operational memory may be a more practical optimization than another model swap.
The plugin delivered the largest savings in all 30 repository and configuration pairs without a performance loss. Cumulative costs fell below the baseline by the sixth task in every repository. Costs dropped by 16.0% to 21.2% on Web Bench and by 6.4% to 19.6% in security auditing where each task used a new repository.
Sequential benchmarks still leave memory maintenance to production
The results come from the authors and sequential benchmarks. A real team will face stale notes, changing tools and cases where a pattern from earlier tasks stops being valid. The plugin waits for several sessions before confirming micro skills and retires them when evidence conflicts, but users still need to test its long term behavior in live repositories.
Early tasks can also cost more while the system learns. Repositories with recurring work are therefore the natural target, rather than isolated tasks with no shared context.
Real bills will reveal the cost of a bad lesson
The next useful evidence is independent measurement on long lived projects: how often the plugin retracts knowledge, restores a pruned tool and shortens a failure loop. The open source release makes those checks possible outside the lab.
Developer time matters too. Fewer tokens help a budget, but a stale lesson can add another review cycle for the person at the keyboard.
Lilith's verdict
A coding agent that searches for the light switch every morning is not becoming more autonomous just because it moves quickly. TokenEconomizer finally leaves it a note on the door.