APIUp to 25% cheaper than official pricesTry the API →
Hermes
Back to News

Microsoft's TokenEconomizer Slashes Coding Agent Costs by 31% Without Touching Models

Microsoft Research and UC Berkeley released TokenEconomizer , a plugin cutting coding agent costs 18-30% on SWE-Bench. Works with Claude Code, Codex, GitHub Copilot CLI, and Pi without modifying the agent itself.

Microsoft's TokenEconomizer Slashes Coding Agent Costs by 31% Without Touching Models
Source
AlphaSignal
Published
Author
AlphaSignal
Read
2 min read

Takeaways

  • Microsoft Research and UC Berkeley released TokenEconomizer , a plugin cutting coding agent costs 18-30% on SWE-Bench.
  • Works with Claude Code, Codex, GitHub Copilot CLI, and Pi without modifying the agent itself.
  • Three mechanisms: micro-skills (remembered repo facts), tool pruning, and failure-loop intervention.
  • Cost was lower in all 30 repo x agent-model cells tested, with Pass@1 up in 4 of 5.
  • Model calls route through your own agent login, state stored locally in ~/.tokeneconomizer .
  • Apache 2.0 licensed; paper and project page have full results.

Microsoft Research and UC Berkeley researchers have released TokenEconomizer , an open-source plugin that targets recurring waste in coding agents such as Claude Code and Codex. It records repository-specific lessons, removes unused tool definitions, and interrupts repeated failure loops without changing model weights or routing requests through a separate proxy.

The plugin addresses familiar sources of token use: agents repeatedly discover that the pytest executable is unavailable even though python -m pytest works, carry tool schemas they never invoke, or retry a failing approach until the context window fills. According to the authors, TokenEconomizer reduced mean cost by 18.4% to 30.9% across five agent-model combinations on SWE-Bench while increasing Pass@1 in four of five combinations. It supports Claude Code, Codex, GitHub Copilot CLI, and Pi under the Apache 2.0 license.

Three ways to trim repeat work

TokenEconomizer combines three independent mechanisms, each aimed at a different source of repeated spending. Learned state persists across sessions in the same repository, allowing later tasks to reuse information gathered during earlier work.

  • Micro-skills: A proposer model reviews recent sessions after every third session and extracts candidate facts, such as required build steps, working command syntax, environment variables, and generated-file locations. A fact enters the agent’s context after evidence from three sessions confirms it. Later contradictions remove it.
  • Tool pruning: Loaded tool schemas consume context on repeated requests. TokenEconomizer omits a tool after it goes unused for 10 prompts across at least two sessions, or for five sessions of any length. The host agent’s settings control the change, and one command restores the tool.

Reporting is indexed from AlphaSignal. Rights remain with the original publisher and cited sources.

Read original report

Sources

  1. 01github.com
  2. 02arxiv.org
  3. 03tokeneconomizer.github.io