Microsoft Research and UC Berkeley researchers have released TokenEconomizer, an open-source cost controller plugin that cuts coding agent costs by up to 30.9 percent. Tested across 277 SWE-Bench tasks, the tool lowered mean costs between 18.4 percent and 30.9 percent across five agent-model settings without touching model weights or agent code.
The plugin functions as an external controller that treats the agent as a black box, maintaining state per repository from completed traces. It utilizes micro-skills to convert trace digests into one-line facts, prunes unused tools after consecutive idle tasks, and intervenes in failure loops by enforcing turn budgets and detecting stuck states. The system works with Claude Code, Codex, GitHub Copilot CLI, and Pi using Python 3.10 or newer.
In evaluations, TokenEconomizer improved Pass@1 accuracy in four out of five settings while delivering consistent savings over time across multiple repositories and benchmarks like Web-Bench and CredData. The open-source project demonstrates how external repository state management can significantly reduce token waste in automated software engineering workflows.
Why it matters: This cost controller offers developers a practical way to reduce expensive coding agent token waste by up to nearly a third without modifying underlying model weights.