Building a SaaS tool or MCP server? Get listed or sponsor AgentStackList →
Claude Coding By James Whitfield

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

  1. Clone it and keep the folder in place: git clone https://github.com/microsoft/TokenEconomizer.git
  2. In Claude Code, run claude plugin marketplace add /path/to/TokenEconomizer, then claude plugin install tokeneconomizer@tokeneconomizer.
  3. Start a new session, type /tokeneconomizer:status, then run /tokeneconomizer:toolprune refresh-catalog once.
  4. 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.

Share on X

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

All Claude tricks →