XNews

Microsoft Open-Sources TokenEconomizer Plugin to Cut Coding Agent Token Costs

Microsoft Open-Sources TokenEconomizer Plugin to Cut Coding Agent Token Costs

Microsoft released TokenEconomizer, an open-source plugin that reduces token consumption for coding agents without changing the model or agent. The tool learns from prior project sessions, uses a judge model to detect loops, unloads unused tools, and injects summarized rules; on 277 SWE-Bench tasks across five agent-model combinations, mean cost fell 18.4% to 30.9% and Pass@1 rose in four of five.

Event version 1.

Key insights

Loop detection via judge model

When an agent repeats the same error and stalls, TokenEconomizer calls a judge model to confirm the loop and prompts the agent to change approach.

Tool unloading and rule injection

Tools unused across several consecutive project sessions are no longer loaded, and recurring pitfalls are summarized into one-line rules given to the agent before a session starts.

Measured cost and completion results

On 277 SWE-Bench coding tasks across five agent-model combinations, mean cost dropped 18.4% to 30.9%, and completion rate rose slightly in four of the five combinations.

Supported agents and local storage

The plugin supports Claude Code, Codex, GitHub Copilot CLI and Pi, uses existing subscription or login methods, and stores learned data only on the local machine.

Source posts