Python Developer Tools DevelopmentCLI DevelopmentPlugin DevelopmentTool Development 2 min read

Microsoft and UC Berkeley Release TokenEconomizer Plugin to Cut Agent Costs

New TokenEconomizer plugin reduces coding agent costs by up to 30.9% on SWE-Bench tasks by using micro-skills, tool pruning, and failure-loop guard mechanisms.

TokenEconomizer is a new plugin from Microsoft Research and UC Berkeley that cuts coding agent costs by 18.4% to 30.9% on SWE-Bench tasks across five agent-model combinations. It supports Claude Code versions 2.1.300 to 2.1.310, Codex, the GitHub Copilot CLI, Pi, and has experimental support for opencode, requiring Python 3.10 or newer.

The plugin modifies neither model weights nor code. Instead, it relies on three mechanisms: micro-skills, tool pruning, and a failure-loop guard. Micro-skills tracks repository facts across sessions, injecting them once three sessions confirm the information. Tool pruning drops unused tools if they go unselected over 10 prompts across at least two sessions or over five sessions. The failure-loop guard uses a judge model to detect stuck turns with at least 0.7 confidence, issuing a short redirect at most once per turn.

On SWE-Bench tests covering 277 tasks from six repositories, costs fell by 5% to 40% per repository-and-combination cell, while Pass@1 increased in four of the five tested combinations. Savings reached 16% to 21% on Web-Bench and 6% to 20% on two security-auditing benchmarks.

Tool pruning and the loop guard are active by default, whereas micro-skills starts disabled. Installation for Claude Code involves cloning the repository, adding a local plugin marketplace, running tokeneconomizer@tokeneconomizer, and executing specific commands like /tokeneconomizer:status and /tokeneconomizer:toolprune refresh-catalog.