Skip to content
aicoolies logo
TokenEconomizer logo

TokenEconomizer

Microsoft Research and UC Berkeley's open-source plugin that cuts coding-agent costs by learning from past sessions

TokenEconomizer is an Apache-2.0 plugin from Microsoft Research, Microsoft Security and UC Berkeley that lowers the cost of running coding agents in repositories you use often, without changing the agent. It learns from earlier sessions to inject confirmed repository facts (micro-skills), stop loading tools that go unused (tool pruning) and redirect turns stuck in failure loops. It supports Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental opencode and Cursor Agent support.

About TokenEconomizer

TokenEconomizer targets a specific source of coding-agent cost: when the same agent works in the same repository again and again, each session pays to rediscover the same facts, resend definitions of tools it never uses, and sit in the same kinds of failing loops. The plugin leaves the agent's model, weights and code alone and learns across a repository's sessions instead.

It has three mechanisms, each of which can be turned on or off. Micro-skills learn repository facts, such as the command that actually runs the tests, from failures that repeat across sessions and from a periodic model review of recent sessions; a fact is stated at the start of a session once three sessions have confirmed it and dropped if later sessions contradict it. Tool pruning removes tools that have gone unused for a set number of prompts or sessions through the agent's own settings, and one command brings them back. The failure-loop guard asks a judge model whether a turn is stuck and, if confident, adds a short redirect; it never stops a turn itself.

The authors report that on 277 SWE-Bench tasks across six repositories and five agent–model combinations, mean cost fell by 18.4–30.9%, with Pass@1 up in four of the five combinations, and that savings held on Web-Bench (16–21%) and two security-auditing benchmarks (6–20%). These are the authors' own measurements from the paper and README, not independent tests.

Installation is from a local clone of the repository through each agent's plugin mechanism (for example the Claude Code and Codex plugin marketplaces, the Copilot CLI plugin command, or pi install). Supported agent versions are pinned to tested ranges in the README, and newer versions are not yet tested. If any part of the plugin fails, the session continues as if it were not installed, and what it learns is stored locally in ~/.tokeneconomizer.

Pricing & Platform Specs

Pricing Summary

TokenEconomizer is free and open source under the Apache-2.0 license. It needs no API key of its own: its own model calls (the fact proposer and the loop-guard judge) run through your existing coding agent on the same plan or login, and the README says their cost is included in its reports.

Supported Platforms

Plugin for Claude Code (2.1.300–2.1.310), Codex (0.153.1–0.164.0), GitHub Copilot CLI (1.0.83–1.0.102) and Pi (1.2.0–1.3.0); experimental opencode and Cursor Agent (Cursor on macOS and Linux only); Python 3.10+; learned data stays local in ~/.tokeneconomizer

Explore categories, tags & use cases

Community experience

Sources & verification

Sources checked
Content verified

Verification dates are editorial checks. Routine CMS saves and automatic updatedAt timestamps do not advance them.

FAQ

What is TokenEconomizer?

TokenEconomizer is an Apache-2.0 plugin from Microsoft Research, Microsoft Security and UC Berkeley that lowers the cost of running coding agents in repositories you use often, without changing the agent. It learns from earlier sessions to inject confirmed repository facts (micro-skills), stop loading tools that go unused (tool pruning) and redirect turns stuck in failure loops. It supports Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental opencode and Cursor Agent support.

Is TokenEconomizer free?

Yes — TokenEconomizer is open source and free to use. TokenEconomizer is free and open source under the Apache-2.0 license. It needs no API key of its own: its own model calls (the fact proposer and the loop-guard judge) run through your existing coding agent on the same plan or login, and the README says their cost is included in its reports.

Is TokenEconomizer open source?

Yes — TokenEconomizer is open source.

Is TokenEconomizer still maintained?

Yes — TokenEconomizer is active. Its listing was last verified on November 3, 2026.