Meet TokenEconomizer: Microsoft’s Plugin That Cuts Coding Agent Costs by Up to 30.9%
Sentiment: Neutral ⚖️A team of researchers from Microsoft Research and UC Berkeley have released TokenEconomizer, an open-source cost controller for coding agents.
TokenEconomizer is a plugin that learns from past sessions in a repository to cut waste in later ones.
Previous in Artificial Intelligence
It works with Claude Code, Codex, GitHub Copilot CLI and Pi.
It does not touch model weights or agent code.
On 277 SWE-Bench tasks, it lowered mean cost by 18.4% to 30.9% across 5 agent-model settings.
TL;DR Package: A standard-library Python package and agent plugins, with 3 switchable mechanisms.
Runs on: Any machine running Claude Code, Codex, Copilot CLI or Pi with Python 3.10+.
No GPU and no API key of its own.
Performance: 18.4% to 30.9% lower mean SWE-Bench cost, and cheaper in all 30 repository-setting cells.
Best: 30.9% lower cost on Claude Code with Opus 4.8 (33.2% when combined with RTK).
Worst: Only 6.4% to 9.3% savings on ReposVul audits; Pass@1 drops 1.0 point on Opus 4.8.
Why do coding agents waste tokens?
Every agent turn re-bills the system prompt, every loaded tool schema and the full history.
The research team profiled 60 SWE-Bench tasks across 6 repositories using Claude Code with Opus 4.8.
They found 3 recurring sources of waste: Repeated discovery: once 5 tasks precede the current one, 30% of tool calls repeat an earlier action.



