TokenEconomizer exists because you've probably seen this movie before: you open your AI coding agent on a project you've been working on for months, and the first thing it does is ask where the tests live — or run a build command that's been broken in your repo since last spring. By the time it's actually useful, you've paid for a tour of your own house.

TokenEconomizer, a free plugin from researchers at Microsoft Research and UC Berkeley, is built to stop that. It plugs into Claude Code, Codex and Copilot CLI — "coding agents," meaning programs that read your project files, run commands and write code on your behalf. On the same 277 coding tasks, it made those agents 18.4% to 30.9% cheaper to run. The agent itself doesn't change. You're not swapping in a weaker model or flipping off features.

What happened

TokenEconomizer learns from the sessions you've already run inside a repository. A repository ("repo" for short) is the folder where your code and its history live — think of a filing cabinet that remembers every change ever made to it. The plugin watches what happens in that cabinet and takes notes.

Costs dropped in all 30 repo-and-agent combinations the team tested. Tasks were solved more often in 4 of the 5 agent setups, so it isn't buying savings by doing worse work. The project has been public on GitHub since October and has nearly 6,900 stars. The full methodology is in the arXiv preprint.

The three things it actually learns

1. Facts the agent keeps rediscovering. Which test command works here. Where the config file sits. The kind of thing you'd tell a new teammate once and never again — except an agent forgets every single session, so you pay to work it out from scratch.

2. Tools that never get used. Every tool an agent can reach comes with a written description, and that description is sent with every request. It's like paying postage on a catalogue of every tool in the workshop each time you mail a letter. If your repo never touches a tool, TokenEconomizer stops loading it.

3. Turns stuck on the same error. When the agent keeps banging into the same wall, the plugin nudges it to try a different route instead of retrying the same broken move until the budget drains.

What "tokens" have to do with your bill

Tokens are the units AI models are billed in — roughly word-chunks. Every file, tool description and instruction your agent sends up counts toward the total. Cut the amount of stuff sent, and the bill drops without anyone changing the model. That's the whole trick: an 18.4% to 30.9% reduction in what the agent has to transmit, measured on real tasks rather than a promo discount.

What it means for you

At home and on the job

If you tinker with a personal project on weekends, the win is mostly about patience. A stuck agent that loops on the same failing test burns your time as much as your credits, and nudging it out of that loop is worth more than the money. If you use an AI agent at work, the appeal is different: predictability. Teams that pay per seat or per token see the same job cost less, and one fewer line item to defend in a budget review. You don't have to change your workflow or learn a new tool — you keep typing to Claude Code or Copilot CLI exactly as before, and the plugin quietly does its bookkeeping in the background.

For business owners and side-income builders

This is where percentages turn into something you can feel. If you run a small shop, an agency or a one-person software business, AI coding agents are a real operating cost — and a variable one, which is the worst kind when you're forecasting. A 30% haircut on the same work means more experiments per month for the same spend, or the same output for less. Side-income builders get a subtler benefit: the plugin notices dead weight in your repo, so the agent spends its effort on your actual problem instead of on tools you never call. That's especially handy if you're shipping several small projects rather than maintaining one giant codebase. Pair it with other free AI tools from mykreatool and your whole stack starts costing close to nothing.

For students and creators

If you're learning to code, your budget is usually the hard limit — you stop when the credits run out, often mid-lesson. Cheaper sessions mean more attempts, and the loop-breaking feature matters even more: beginners get stuck on the same error constantly, and a nudge toward a different approach is roughly what a good TA would give you. Creators building small tools, landing pages or automations get the same deal. You're not optimizing a data center; you're trying to get one more idea shipped before the month ends, and getting a chunk of every session back is one or two extra shots on goal.

How to try it right now

It's free, open source, and the whole thing runs locally — what the plugin learns stays on your machine. For Claude Code, the install is three commands:

1. Clone the repository from Microsoft's TokenEconomizer repo:

```

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

```

2. Register the plugin marketplace from the folder you just cloned:

```

claude plugin marketplace add "$PWD/TokenEconomizer"

```

3. Install the plugin itself:

```

claude plugin install tokeneconomizer@tokeneconomizer

```

Then use Claude Code the way you normally would on a repo you've already worked in. The plugin builds its notes from sessions that have already happened, so a project with some history is where you'll notice it first. If you use Codex or Copilot CLI, the research covers those agents too — check the repo README for the current setup steps, since the three-command path above is the Claude Code route.

Upsides and what changes

The obvious upside is money, but that's not the interesting part. Cost fell in every single one of the 30 repo-and-agent combinations, which suggests the waste it removes is structural rather than lucky — every agent, on every repo, was paying some tax to re-learn the same things. And because the savings come from sending less, they stack with whatever else you're doing: they don't depend on a particular model version or a vendor's pricing page.

What changes day to day is small but real. Fewer wasted turns. Fewer moments where the agent confidently runs the wrong test command. A cleaner signal about what your project actually needs. And since tasks solved went up in 4 of 5 setups, the cheaper version wasn't the dumber one — which is the failure mode people reasonably expect when they hear "cost cutting."

Limitations

Be clear-eyed about the scope. These numbers come from 277 benchmark coding tasks run across 30 repo-and-agent combinations — a solid study, not a promise about your particular codebase, and your savings could land anywhere inside, above or below that 18.4%–30.9% band. One of the five agent setups didn't improve its solve rate, so the quality gain isn't universal. The plugin also needs history to learn from, which means a brand-new repo gets little at first, and it's a research project rather than a commercial product with a support contract — read the README before you wire it into anything that matters. And the researchers measured cost and task success, not whether the code it produced got nicer to maintain.

Conclusion

The headline isn't that a plugin shaved a few percent off an AI bill. It's that coding agents were quietly wasting a chunk of every session re-learning things they'd already been told, and someone measured exactly how much. For anyone paying for Claude Code, Codex or Copilot CLI — whether that's a company card or your own — a free, local, three-command fix that recovers up to 30.9% is close to a no-brainer.

One action for today: open your terminal and run `git clone https://github.com/microsoft/TokenEconomizer.git`, then finish the two install commands. Ten minutes now, cheaper sessions from here on.