Microsoft's free plugin makes Claude Code, Codex and Copilot CLI cheaper the more you use them
TokenEconomizer is an open-source plugin from Microsoft Research and UC Berkeley that learns from the sessions your agent has already run in a repository. It remembers repo facts so each session stops rediscovering them (like which test command actually works), stops loading tools that never get used there, and nudges the agent once when a turn is stuck repeating the same failure. On SWE-Bench tasks the authors measured 18.4% to 30.9% lower mean cost across five agent and model setups, with success rates up in four of five.
Why it matters
A lot of agent spend goes on re-learning the same repo, loading unused tools and going round in circles. This attacks all three without changing your agent or model.
Who it's for
Developers who work in the same repositories every day with Claude Code, Codex, GitHub Copilot CLI or Pi and want their limits or API bill to last longer.
How to try it
- Clone it and keep the folder in place: git clone https://github.com/microsoft/TokenEconomizer.git
- In Claude Code, run claude plugin marketplace add /path/to/TokenEconomizer, then claude plugin install tokeneconomizer@tokeneconomizer.
- Start a new session, type /tokeneconomizer:status, then run /tokeneconomizer:toolprune refresh-catalog once.
- Work normally; the savings build up after a few sessions in the same repo, and /tokeneconomizer:toolprune restore brings back any tool it left out.
Plan & availability: Free and open source (Apache 2.0); needs Python 3.10+ and no extra API key, and it works with subscription or API sign-ins. Supports Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental opencode support. Savings figures are the authors' own benchmark results. Checked November 1, 2026.
Related
Source: Microsoft Research and UC Berkeley on github.com
Written by James Whitfield from the original post. Checked Nov 1, 2026. Features, plans and availability can change, so confirm on the source before you rely on it.
tokenscostmicrosoftclaude-codecodexcopilotplugin
More Claude tricks
- One URL and one key for all your MCP servers: ngrok's MCP Gateway is live · Dec 2
- OpenCode 2.4.2 cuts about 700 tokens per request and tunes GPT-6.2 · Nov 26
- OpenCode 2.4 gives your coding agent a browser, automations, and video generation · Nov 24
- Claude Code 2.1.330 draws your charts with easel and lets scheduled tasks run 30 days · Nov 21