Researchers from Microsoft Research and UC Berkeley have released TokenEconomizer, an open-source cost controller for coding agents that reduces API expenses by up to 30.9%. The tool acts as an external plugin compatible with Claude Code, Codex, GitHub Copilot CLI, and Pi without modifying underlying model weights or agent source code.
The system operates by maintaining repository-specific state traces to eliminate redundant token usage, such as repeated system prompts, tool schemas, and history overhead. Across 277 SWE-Bench benchmark tasks, TokenEconomizer lowered mean costs by 18.4% to 30.9% while simultaneously improving Pass@1 accuracy in four out of five tested configurations.
By leveraging prompt policies, tool masking, and automated loop guards, the plugin optimizes context window efficiency over continuous developer sessions. The project is accessible via Python 3.10 and stores learned optimization data locally on the user’s machine.
Why it matters
Cuts operational token expenditure for software engineering agents by up to 30.9% without modifying agent or model code.
Mitigates redundant system prompt re-billing and tool schema bloat in iterative multi-turn LLM agent sessions.
Source: marktechpost.com



