TokenEconomizer Cuts Coding-Agent Token Cost ~18–31%
Microsoft Research and UC Berkeley open-source TokenEconomizer, a plugin that cuts SWE-Bench mean cost ~18.4–30.9% for Claude Code, Codex, and Copilot CLI.
Coding agents keep getting more capable—and more expensive. Every turn roughly re-bills instructions, tool definitions, and the trail so far. TokenEconomizer, open-sourced by Microsoft Research, UC Berkeley, and Microsoft Security, targets that recurring, environment-specific waste without changing the model or the agent loop. It is an external controller that sits beside the harness you already use.
The plugin supports Claude Code, Codex, GitHub Copilot CLI, and Pi, with experimental opencode support. Three mechanisms do the work. Micro-skills distill repository facts from prior sessions and inject only confirmed ones into later sessions, so the agent stops rediscovering the same build quirks. Tool pruning drops tool definitions that stay unused across sessions, because loaded tools are billed every turn whether or not they fire. A failure-loop guard redirects once when a turn looks stuck and then tells you how to stop—without killing the turn itself. State stays on your machine under ~/.tokeneconomizer, and the controller’s own model calls are included in cost reports.
On 277 SWE-Bench tasks run in repository order across five agent–model combinations, the paper reports about 18.4–30.9% lower mean per-task cost, cheaper results in all 30 repository × combination cells, and higher Pass@1 in four of five settings. Savings also show up on Web-Bench and security-auditing benchmarks in roughly the 6–21% range, depending on whether each task is a fresh repository (micro-skills turn off there). Fixed open-source cost plugins often help one repo and hurt another; TokenEconomizer’s bet is repository-adaptive control rather than one compression trick for every codebase.
For teams that live in the same monorepo with Codex or Claude Code all day, that is more practical than chasing yet another “smarter” model. The agent is already strong; what hurts is paying it to relearn the environment. Keeping experience on the repo side and kicking unused tool schemas out of context sounds mundane—and that is exactly where continuous coding work bleeds money. The GitHub repo and project page are public; install the plugin and check /tokeneconomizer:status.