Your Coding Agent Keeps Relearning Your Repo. That's the Bill.

Here is a bill that will be familiar. You run a coding agent on the same repository every day. It re-learns that tests need python -m pytest instead of pytest. It loads a browser tool it never calls. It hits the same failing error three times in a row, tries the same fix four times, and then tells you it is stuck.
None of that is a model problem. It is a memory problem, and TokenEconomizer — from Microsoft Research, UC Berkeley and Microsoft Security — attacks it by never touching the model at all.
What it measures
The paper (arXiv 2610.22732) reports, on SWE-Bench tasks, 18.4% to 30.9% lower mean cost across five agent–model combinations. Cheaper in all thirty repository × combination cells. Pass@1 up in four of the five.
The per-combination numbers are the ones worth reading closely, because they show where the savings come from:
- Claude Code with Sonnet 5: cost −23.6%, Pass@1 +1.3
- Claude Code with Opus 4.8: cost −30.9%, Pass@1 −1.0
- Codex with GPT-5.6 Terra: cost −24.7%, Pass@1 +0.9
- Codex with GPT-5.6 Sol: cost −26.1%, Pass@1 +1.6
- Copilot CLI with Sonnet 5: cost −18.4%, Pass@1 +2.6
One regression, four improvements, all cheaper. That pattern — cheaper almost everywhere, quality roughly flat to slightly better — is what a well-targeted waste-removal tool looks like. It is not making the model smarter. It is stopping it from paying for the same lesson twice.

Three mechanisms, one idea
The framing sentence in the README is the whole thesis: coding agents are built to finish tasks, not to keep them cheap. Every turn re-pays for the agent's instructions, every loaded tool, and the conversation so far.
Micro-skills: remember how the repository works. Sessions keep rediscovering the same facts. A build step that must run first. The spelling of a command that works here. An environment variable a command needs. Where generated files live. Micro-skills learns these from two sources: failures that repeat across sessions, and a model that reviews recent sessions every third session and proposes facts. A fact is only promoted into the context once three sessions have confirmed it.
That confirmation threshold is the design detail I like most. It is the difference between a memory and a rumour.
Tool pruning: stop sending tools this repo never uses. Coding agents ship with a large toolset. A repository that never touches a notebook never needs the notebook tool, and every unused tool is paid for on every turn. Tool pruning removes them through the agent's own settings, which is why it works without the agent knowing anything about it.
Failure-loop intervention: notice the loop. The same error three times triggers a nudge to try a different approach. This is the cheapest mechanism and probably the most valuable, because failure loops are where agents burn the most money for the least output.
The accounting detail nobody else does
One line in the "how it works" section explains why the headline number is credible: most tokens in a session are cached re-reads, so cost is computed with cache pricing, and it includes the plugin's own model calls.
That is a rare bit of honesty. A tool that reports savings while billing its own overhead outside the accounting is marketing, not measurement. Counting cache re-reads at cache prices also reframes the problem: the expensive part of an agent session is not the fresh tokens, it is the accumulation.
Installing it
It is a plugin for the agent you already use, run from a clone. Python 3.10 or newer on PATH, no API key of its own, never touches credentials.
git clone https://github.com/microsoft/TokenEconomizer.git
claude plugin marketplace add "$PWD/TokenEconomizer"
claude plugin install tokeneconomizer@tokeneconomizer
Codex and the Copilot CLI have equivalents — codex plugin marketplace add, copilot plugin install — and opencode is supported too. Then check status with /tokeneconomizer:status inside the agent. Two setup notes matter: the folder has to stay where you cloned it, because the plugin runs from the clone, and for Claude Code you need to run /tokeneconomizer:toolprune refresh-catalog once per machine and again after Claude Code updates, because the tool catalogue is version-specific.
In Codex you will be asked to trust the folder and then to review hooks. The hooks take effect from the next session, so quit and restart. That is the least elegant part of the install, and it is worth doing properly rather than clicking through.
What it does not do
It does not change the model, the weights, or the agent's code. That is the point of calling it black-box: everything it does happens through context at session start and the agent's own settings.
It does not help you on a repository you touch once. The economics are explicitly "paid back over the sessions that follow," which means the first two or three sessions are an investment. If your work looks like a different repo every week, this is the wrong tool and the paper would agree with you.
And it does not fix the quality problem. One combination got slightly worse. Removing waste changes what the agent spends, not how well it thinks, and there is no reason to expect a free lunch on both axes every time.
One caution about measurement. Run a control week before you believe any of this. Token counts in agent sessions are noisy, and a repository with an unusually productive week will look like a cost win regardless of what plugin you installed. Compare cost per completed task, not cost per day, and keep the task list roughly constant. The paper's thirty cells are a useful prior, not a substitute for your own baseline.
Why this is the shape of the next year
Agent pricing has been a story about model costs going down. That is the wrong lever for most teams, because the bill is dominated by how much the agent re-reads, not by the per-token price. A 25% cut from a cheaper model is nice; a 25% cut from not re-discovering your build command is structural, and it compounds with the cheaper model instead of competing with it.
We spent two years optimising prompts. The numbers here suggest the next two are about optimising sessions: what enters the context, what tools get loaded, and when to interrupt a loop. None of that requires a better model, which is exactly why it is likely to work.
If you run an agent on one repository more than ten times a month, install it and measure your own bill for a week. The interesting number is not the 18–31% in the paper. It is how many of your sessions were rediscovering something you already knew.
Related articles
AMD Got 19 Percent for Being the Other Option
Money did not leave AI. It left the one name with a governance problem and went to the two without one.
The $99 Billion Loop Nvidia Built Around Its Own Customers
Selling shovels is a good business. Lending money to the people buying shovels is a different one.
The 74 Percent Gross Margin Has a Shelf Life
Three forces arrive in the same four quarters, and each one costs about $3 billion per point.
175,000 Signatures Will Not Put Him Back. Here Is What Would.
The longer the campaign takes to win, the weaker its case becomes. That is the trap built into it.