Microsoft Research and UC Berkeley open-source TokenEconomizer, a plugin that cuts Claude Code and Codex costs by 18.4–30.9% on SWE-Bench without changing the agent
Microsoft Research, Microsoft Security and UC Berkeley open-sourced TokenEconomizer on GitHub (Apache 2.0, v0.1.0 released October 26), a plugin for Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental opencode support. It learns from earlier sessions in the same repository: micro-skills remember repo facts, tool pruning drops tool definitions that go unused, and a loop guard nudges an agent that is stuck. The paper reports 18.4–30.9% lower mean cost across five agent and model combinations on 277 SWE-Bench tasks (paper figures).

Key Takeaways
- Cost: on 277 SWE-Bench tasks across 6 repositories and 5 agent and model combinations, mean cost fell 18.4–30.9%, and all 30 repository-by-combination cells got cheaper (paper figures, including the plugin's own model calls)
- Success rate: Pass@1 rose in 4 of 5 combinations, e.g. Copilot CLI with Sonnet 5 cost 18.4% less with Pass@1 +2.6, while Claude Code with Opus 4.8 cost 30.9% less with Pass@1 -1.0
- Three mechanisms: micro-skills (repo facts stated only after three sessions confirm them), tool pruning (by default a tool unused over 10 prompts across 2 sessions is left out), and a failure-loop guard (one redirect when a judge is at least 0.7 confident, never stopping a turn itself)
- Generalization: 16–21% lower cost on Web-Bench and 6–20% lower on two security-auditing benchmarks where every task is a new repository
- Deployment: Apache 2.0, Python 3.10+, no API key of its own, and learned experience stays local in ~/.tokeneconomizer
