> ## Content Index
> Fetch the complete content index at: https://globalfeed.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# Microsoft plugin on GitHub stops you paying again for the same coding agent work
- URL: https://globalfeed.ai/en/microsofts-open-tokeneconomizer-plugin-cuts-the-repeated-costs-of-coding-agents/
- Published: 2026-10-31T00:54:08.000Z
- Updated: 2026-10-31T00:54:08.000Z
- Description: The plugin from Microsoft and UC Berkeley researchers lowered mean cost by 18.4% to 30.9% in testing. Success rose in four of five combinations and slipped slightly with Claude Code and Opus 4.8.
- Author: GlobalFeed Editor
- Tags: Microsoft, TokenEconomizer, coding agents, open source, x-MicrosoftAI, dil-en, elle

Researchers from Microsoft Research, Microsoft Security and UC Berkeley have released TokenEconomizer on [GitHub](https://github.com/microsoft/TokenEconomizer?ref=globalfeed.ai) under Apache 2.0\. It aims to lower the cost of coding agents without changing the model or the agent's code. The paper went up on arXiv on October 15, 2026, and the repository was still being updated on October 30\. The plugin works with Claude Code, Codex, GitHub Copilot CLI and Pi, with experimental support for opencode.

## Agents keep paying for the same work

The team starts from the fact that coding agents are mostly measured on single tasks. In practice, developers use the same agent on the same project again and again, and every turn bills the agent's instructions, the definitions of loaded tools and the conversation so far. The team studied 60 SWE-Bench runs of an unmodified agent. Once a repository had five or more tasks behind it, 30% of tool calls repeated an earlier task's action. Of the 23 tool descriptions billed on every turn, 16 were never called. The 17% of tasks that failed took 32% of the spend.

## Three mechanisms work from outside the agent

The first mechanism, micro-skills, learns facts specific to a repository, such as a build step that must run first, the command spelling that works there or an environment variable a command needs. A fact is given to the agent at session start once three sessions confirm it, and dropped if later sessions contradict it. The second is tool pruning. A tool unused over ten prompts across at least two sessions, or over five sessions, is left out of later sessions through the agent's own settings, and one command brings it back. The third is the loop guard. When a turn keeps hitting the same failures, a judge model reviews it, and if it is at least 70% sure the turn is stuck, the agent gets a short note to try another approach. If the turn still does not move, the plugin tells the user how to stop it and does not end the turn itself.

## Cost fell, but success did not rise everywhere

The team ran 277 SWE-Bench tasks from six repositories (Django, Matplotlib, scikit-learn, Sphinx, SymPy, xarray) on five agent and model combinations. Mean cost fell 18.4% on Copilot CLI with Sonnet 5, 23.6% on Claude Code with Sonnet 5, 24.7% on Codex with GPT-5.6 Terra, 26.1% on Codex with GPT-5.6 Sol and 30.9% on Claude Code with Opus 4.8\. The costs include the plugin's own model calls. First-attempt success rose in four combinations, for example from 75.0 to 77.6 on Copilot CLI with Sonnet 5\. On Claude Code with Opus 4.8, where savings were largest, it slipped from 74.0 to 73.0.

The same table shows the price of simpler options. On Claude Code with Sonnet 5, moving to low effort cut cost by 45.5% but took success from 74.7 to 65.1\. The fixed-configuration tools RTK and RepoMap raised cost in some combinations. Savings within a repository ranged from 5% to 40%. On Web-Bench the drop was 16% to 21%. On two security-auditing tests, where every task is in a new repository, it was 6% to 20%, because the system learns from repeated work in one repository.

## What the plugin does

- It learns repository facts and carries them into later sessions. This is optional and off by default.
- It leaves unused tools out of later sessions, and one command brings them back.
- When an agent keeps hitting the same failure, it adds a note to try another approach.
- It runs through hooks at session start, on every prompt, on tool calls and at session end.
- It reads session logs and hands some work to a separate background process.
- For tool pruning, it writes deny rules into the repository's .claude/settings.local.json.
- On Claude Code, its extra model calls run on Haiku by default through the user's own account.

## What it does not do

- It does not change the model or the agent's code.
- It does not ask for a separate API key, and model calls go through the user's agent.
- It does not update itself. Updates come from a git pull the user runs.
- It does not stop a stuck turn itself, and leaves that decision to the user.
- Our code scan found no connection to outside servers in the plugin's own code. We did not review every file line by line.

## Who it suits

People who work often in the same project gain the most, because the system learns from repeated work. Savings drop for those who do each job in a new repository. On monthly plans, the gain may show up in usage limits rather than money. It needs Python 3.10 or newer, and setup uses git clone and the agent's plugin commands. Before removing it, toolprune restore brings back the tools it turned off. Users also need to decide whether the hooks and log reading suit the way they work.

## The plugin's defaults differ from the paper

In the version users get, tool pruning and the loop guard are on and micro-skills is off. The repository says that is because the fact proposer adds model calls. The three-mechanism results in the paper may therefore not match a default install. On Claude Code, the plugin's extra calls run on Haiku by default through the user's own account. It needs no separate API key and keeps what it learns on the user's machine in \~/.tokeneconomizer. On the other hand, it runs hooks at session start, on prompts and on tool calls, reads session logs, hands some work to a separate background process and writes deny rules into repository settings for tool pruning. Users who do not want their tool list to change on its own can set toolprune=propose to get proposals only. The figures are the team's own measurements. For a fuller picture, follow reviews from independent researchers too.

Sources: [GitHub](https://github.com/microsoft/TokenEconomizer?ref=globalfeed.ai), [arXiv paper](https://arxiv.org/abs/2610.22732?ref=globalfeed.ai), [Project page](https://tokeneconomizer.github.io/?ref=globalfeed.ai)