A version of this story would have you believe that a project can cut a coding agent's bill by 30% without touching the model or the agent at all, just by reading the repository's own history. The code and paper tell a more restrained story. As of November 19, 2026, TokenEconomizer from Microsoft Research, Microsoft Security, and UC Berkeley sits on GitHub as TokenEconomizer, with the plain repository address https://github.com/microsoft/TokenEconomizer. The current release is v0.1.0, still a research-stage project with no formal release tag, and nothing you would call production-ready. Its thesis fits in one line: let a coding agent learn from the history of the same repository and stop paying for repeated actions, unused tool descriptions, and failure loops. The "30%" in the headline is a hook that tracks the author-tested high point of 30.9%, but the honest range is 18.4%-30.9% across five agent-model combinations, all from the paper and the authors' own tests, not an official conclusion and not an independent reproduction.
Keep the angle precise. TokenEconomizer targets the cost of a coding agent's tool calls and context, not the inference engine and not gateway routing and billing. The site has separate discussions of long-context cost and LLM API cost optimization that are about buying fewer tokens; this one is about doing the same work for less money. They can be read together but are not the same thing. It also does not replace Claude Code or Codex; it hangs off them as a throttle layer. "Black-box" means it cannot see model weights or change the agent's internals, so it only observes the text and tool calls going in and out and extracts savings from that observable behavior. That matters because it asks you to change neither model nor agent code, keeping the integration cost low.
First, the evidence: repo, license, paper
As of November 19, 2026, the repository is reachable, not archived, last pushed on November 18, with about 7,674 stars: active but very new. The paper is arXiv 2610.22732, titled "TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents," with authors from UC Berkeley, Microsoft Research, and Microsoft Security, including Aaron J. Li, Weijia Xu, Chandan Singh, Zixiao Chen, Jeevana Priya Inala, Charlotte Siska, Acar Tamersoy, Bin Yu, Ion Stoica, Michel Galley, and Jianfeng Gao. The project page is at tokeneconomizer.github.io. These are checkable details and the base for everything that follows. The author list also explains the project's double character: an academic paper's evaluation discipline combined with an engineering team's sensitivity to real session cost.
The license has to follow the LICENSE text, not secondhand summaries. The repository's LICENSE says plainly MIT License, with the copyright line "Copyright (c) 2026 Microsoft." Some secondhand articles call it Apache-2.0, which is a misreport; the original text governs, and the answer is MIT. The disagreement is worth naming because a license decides whether redistribution is safe, and trusting the front-page license badge is not enough. MIT's boundary is clear: you may modify and use it commercially as long as you keep the copyright notice; mislabeling it Apache-2.0 can make people assume patent terms that are not there.
Warm-up analysis: where the money goes
The paper first ran 60 SWE-bench tasks through Claude Code to break waste into three kinds. First, after five tasks in the same repository, about 30% of tool calls repeat earlier actions; across repositories the figure is only 7%, so repetition concentrates in familiar repositories, where revisiting an old project makes you pay twice for the same exploration. Second, each turn supplies 23 tool descriptions, of which 16 are never called, while 3 tools account for 98% of calls, so most descriptions are simply burning tokens. Third, failed tasks are only 17% of the total but consume 32% of the cost, meaning money goes to the work that stalls, not the work that succeeds. These three shape the three mechanisms that follow: repeated actions map to memory, idle tools to pruning, failure loops to intervention.
The value of this analysis is not the numbers but the way it turns "agents are expensive" from a complaint into an observable structure. The usual explanation blames a strong model or a long context. The paper instead logs every tool call, description, and failed turn, then asks which part could have been skipped. Waste has a clear shape and depends heavily on repository history: the longer you stay in one repository, the more you repeat. That is exactly why the method is experience-driven rather than a fixed rule applied everywhere.
Three mechanisms: learning from the repository's own history
The paper calls the approach black-box cost control: no model weights are touched and no agent code is changed; experience is extracted only from the repository's own history. Three mechanisms.
First, micro-skills. A repeated repository fact is compressed into one short line, such as how to run a build command or how to run a test, and it is not injected immediately: the same fact must be confirmed across multiple sessions before it enters the pool, and if a later session contradicts it, the skill is retired. That turns "ask again every time" into "ask once, remember it." The retirement rule matters most, because repositories change; a command that was once correct can go stale, and injecting it as a skill would turn saved exploration into misleading advice. Contradiction-triggered retirement is an expiry check on memory.
Second, tool pruning. If 16 of 23 descriptions per turn are useless, drop the unused tools and keep only core commands and read/write tools resident. The boundary is important: what is pruned is the description layer, not the tool itself; core commands and file read/write always remain. Prune too far and an unfamiliar task lacks a tool; prune carefully and the three tools behind 98% of calls stay front and center while the rest step back.
Third, failure-loop intervention. A judge model decides whether the agent is stuck in a loop and, if so, offers one line of redirection. The open-source release deliberately holds back here: it only reminds the developer and does not terminate the task on its own, leaving the decision to a human. That is both restraint on the safety side and a clear line against taking over: what you get is a suggestion, not a switch that decides for you.
The savings: where 18.4%-30.9% comes from
According to the paper and the authors' own tests, the evaluation ran 277 SWE-bench tasks across six repositories, Django, Matplotlib, scikit-learn, Sphinx, SymPy, and xarray, with five agent-model combinations, each repository starting from zero history. Average per-task cost fell between 18.4% and 30.9%: Copilot CLI with Sonnet 5 at 18.4%, Claude Code with Sonnet 5 at 23.6%, Codex with GPT-5.6 Terra at 24.7%, Codex with GPT-5.6 Sol at 26.1%, and Claude Code with Opus 4.8 at 30.9%. All 30 repository-combination units became cheaper, landing between 5.2% and 40.1%. Every one of these numbers is labeled author-tested and does not mean someone else reproduced the same result.
Two things matter when reading these figures. One, it is a range, not a point: 18.4% to 30.9% is the smallest to the largest of five averages, the low end is already a solid saving, and the high end is the 30.9% the headline borrows; treating the ceiling as the default is the most common misuse. Two, it holds up at the unit level: none of the 30 units got more expensive, and the best saved 40.1%, so the gain is not an average dragged up by one or two extreme tasks. Remember also that each repository started from zero history, so this measures the scenario of accumulating from a cold start, not a repository you have maintained for six months.
Quality did not collapse: Pass@1 rose in four of five groups and fell by just 1.0 point in the Opus 4.8 group. As a contrast, simply lowering reasoning effort saves a comparable or even larger amount of money but drops Pass@1 by 1.8-10.3 points; the fixed-strategy plugin RTK raised cost in 12 units and Aider RepoMap in 15 units. These comparisons complete the picture: saving money is easy, saving it without trading away quality is the hard part. On generalization, Web-Bench fell 16.0%-21.2% and security audits fell 6.4%-19.6%; the latter uses a new repository for every task, so history cannot accumulate and the saving is narrowest, which in turn confirms the main line that the gain comes from accumulated history.
Three tensions that must be stated
The first tension is between the headline figure and the default configuration. The paper's headline 18.4%-30.9% uses all three mechanisms, but the shipped plugin turns micro-skills off by default. Install it without configuration and you get a different set of numbers: ablation shows tool pruning alone at 13.2%-17.7%, micro-skills alone at 11.8%-14.3%, and the loop guard alone at 5.4%-7.1%. To stay near 30.9%, you have to enable micro-skills yourself and accept that it only pays off when you keep working in the same repository. Attaching the headline number to a default install is the misreading this article most wants to prevent.
The second tension is the rhythm of saving. The authors say that, except for xarray, every repository was more expensive early on in Claude Code and only became cheaper across the board by the sixth task; it trades a few upfront lessons for stable savings later, so expecting a single task to pay for itself will disappoint. This also explains why micro-skills is off by default: a new user who runs one or two tasks and leaves would lose money with it on. Whether the method is worth using depends on whether you deliver repeatedly in the same repository.
The third tension is between experiment and reality. SWE-bench tasks are related but independent fixes, not real user sessions; interactive use was not tested; and the hyperparameters were set on a development set built from the same six repositories. The paper's numbers show a direction, but they are a distance away from "your production repository will also save 30%." Set the three tensions side by side and the headline hook returns to its proper place: 30% is the author-tested ceiling, not a promise that holds for everyone.
Limits and getting started
As of November 19, 2026, the project is still v0.1.0, research stage, with no formal release tag; do not treat it as a GA product. The barrier to entry is low: Python 3.10 or newer, use your existing agent login, no separate API key, and everything learned stays locally in ~/.tokeneconomizer. It supports Claude Code, Codex, Copilot CLI, and Pi, with experimental support for opencode, Cursor, and Hermes. Keeping the learned data local has an extra benefit: repository facts and confirmation records never leave your machine, one less concern for teams sensitive about code privacy. For adjacent reading, the site has a coding agent comparison and a piece on context compression, both approaching the "spend less" question from another side.
FAQ
Q1: What exactly does TokenEconomizer change, and will it touch my model or agent code?
A1: Neither. The paper frames it as black-box cost control: no model weights, no agent changes, only learning from the repository's own history to produce three kinds of savings, micro-skills, tool pruning, and failure-loop reminders, with everything learned stored locally in ~/.tokeneconomizer.
Q2: Is the 30% in the headline an official promise?
A2: No. The 30% tracks the author-tested high point of 30.9%, which is the ceiling of the 18.4%-30.9% range across five combinations, all from the paper and the authors' own tests, not an official conclusion and not an independent reproduction. The headline uses the full three-mechanism configuration, while the plugin ships with micro-skills off, so your actual result depends on configuration.
Q3: Is the license MIT or Apache-2.0?
A3: The LICENSE text governs, and it is MIT License, with the copyright line "Copyright (c) 2026 Microsoft." Some secondhand articles say Apache-2.0, which is a misreport and not a valid conclusion; read the repository's LICENSE text before redistributing.
Q4: Why is it more expensive at first, and when does it pay back?
A4: The authors say that, except for xarray, Claude Code is more expensive early in every repository and only becomes cheaper across the board by the sixth task; it trades a few upfront lessons for later stable savings, so do not expect a single task to save money right away. The gain is also strongly tied to whether you keep working in the same repository.
Q5: Can I use it in production now, and which agents are supported?
A5: As of November 19, 2026, it is still v0.1.0, research stage, with no formal release tag, so it is not a GA production tool. It needs Python 3.10 or newer, uses your existing agent login with no separate API key; officially supported are Claude Code, Codex, Copilot CLI, and Pi, with opencode, Cursor, and Hermes experimental.
Related reading