17 November 2026Free Video Stack

Microsoft's Free Tool Made My Videos Look Instantly More Expensive

Short answer: I run Claude Code on the same repos again and again. Every session, it re-learns the same facts: which build step runs first, which test command actually works here, which tools I never use.

I run Claude Code on the same repos again and again. Every session, it re-learns the same facts: which build step runs first, which test command actually works here, which tools I never use. And I pay for that rediscovery every single time.

Microsoft Research and UC Berkeley just open-sourced the fix: TokenEconomizer. It is not a new agent. It is a plugin that learns from the sessions your agent already ran in a repo, then cuts the waste in the next ones.

How it works — 3 mechanisms

1. Micro-skills: it remembers how the repo works. The facts your agent keeps rediscovering — a build step that must run first, python -m pytest where pytest is missing, an env var a command needs — get stated at the start of each session once three sessions confirm them. A fact gets dropped when later sessions contradict it.

2. Tool pruning: it stops loading tools your agent never uses. Every loaded tool's definition is sent with every request. A tool that goes unused across sessions is left out of the next ones through the agent's own settings. One command brings it back.

3. Failure-loop intervention: it steps in when a turn is stuck. When a turn keeps hitting the same failure, a judge model checks if it is stuck and nudges the agent to try another approach — at most once per turn. It never stops a turn itself.

The results

Tested on SWE-Bench (277 tasks, 6 repos, 5 agent-model combos): 18.4–30.9% lower mean cost, cheaper in all 30 repo × combo cells, and accuracy (Pass@1) up in 4 of 5. Claude Code with Sonnet 5: 23.6% cheaper, +1.3 accuracy. Codex with GPT-5.6: 24.7–26.1% cheaper. Copilot CLI: 18.4% cheaper, +2.6 accuracy.

How to install it (Claude Code)

Step 1: Clone the repo.

git clone https://github.com/microsoft/TokenEconomizer.git

Step 2: Add it as a plugin marketplace and install it.

claude plugin marketplace add "$PWD/TokenEconomizer"
claude plugin install tokeneconomizer@tokeneconomizer

Step 3: Start claude, trust the folder, and check it with /tokeneconomizer:status. Once per machine, and again after Claude Code updates, run /tokeneconomizer:toolprune refresh-catalog.

The honest catch

It needs a few sessions in the same repo first — it learns from history, so session 1 will not be cheaper. Its own model calls run through your agent and count in its reports. And everything it learns stays on your machine, in ~/.tokeneconomizer.

It also works with Codex, GitHub Copilot CLI and Pi, with experimental support for opencode, Cursor Agent, Grok Build and more. Python 3.10+, no API key of its own, free under Apache-2.0.

Repo: https://github.com/microsoft/TokenEconomizer