AI · Oct 28, 2026
RTX Spark laptops get open speech models and a dial for background agentsCoding agents keep relearning the same repo. TokenEconomizer makes them remember, and cuts bills by up to 31%
· Updated · Signal Desk newsroom
Analysis of reporting by Microsoft Research. How we work

A UC Berkeley and Microsoft open-source plugin learns from past agent sessions in a repository to trim repeated work, unused tools and failure loops. Reported savings of 18.4% to 30.9% come without changing the agent or model.
Key takeaways
- Profiling Claude Code on SWE-Bench, researchers found 30% of tool calls repeated earlier actions once a repo had five completed tasks.
- The agent loaded 23 tool descriptions per turn but never called 16; the 17% of failed tasks consumed 32% of spending.
- TokenEconomizer uses micro-skills, tool pruning and failure-loop intervention, all through interfaces agents already expose.
- Across 277 tasks and five agent-model setups, average cost fell 18.4% to 30.9%, with Pass@1 rising in four of five combinations.
- It is open source, needs no API key of its own, and keeps learned data on the developer’s machine.
The amnesia tax
Every coding-agent session starts cold. The agent rediscovers how to run the tests, loads every tool it has, and sometimes spends dozens of turns circling the same error it hit yesterday. Each of those steps costs tokens. TokenEconomizer, an open-source plugin from UC Berkeley, Microsoft Research and Microsoft Security, asks a sensible question: if developers return to the same repositories daily, why don’t their agents learn anything from it?
The team’s profiling of Claude Code on 60 SWE-Bench tasks quantifies the waste. Once a repository had at least five completed tasks, 30% of tool calls repeated an action from an earlier task in that same repo, versus only 7% matching another repo’s history. The agent received 23 tool descriptions on every turn and never called 16 of them. And the 17% of tasks that failed ate 32% of the spending. Three off-the-shelf cost-cutting plugins each helped in some repos and not others, which suggests fixed strategies don’t generalize.
How it works
After each session, TokenEconomizer reads the log and updates its picture of the repo. It then intervenes three ways. Micro-skills are one-line notes about repository-specific facts, added to the agent’s starting context only after several sessions confirm the pattern and retired if later evidence contradicts them. Tool pruning drops tools history suggests won’t be needed, always keeping core command and edit tools, and restoring others on demand. Failure-loop intervention uses a judge model to decide whether an agent is truly stuck; if so, it injects a short note suggesting a different approach, and in the open-source version it alerts the developer rather than killing the run.
The design choice we like most is that it treats the agent as a black box. It doesn’t retrain models or patch agent code, so it can sit alongside whatever coding agent a team already uses. That matters in a market where developers switch agents often, a theme in Microsoft Research’s recent work on coding-agent failures and backtracking.
Results and their limits
On 277 SWE-Bench tasks across six repositories and five agent-model combinations, each starting with no history, TokenEconomizer cut mean cost per task by 18.4% to 30.9%, and Pass@1 rose in four of the five combinations. The researchers say savings account for TokenEconomizer’s own model calls. Lowering reasoning effort saved similar or more money but substantially hurt performance, which is the trade-off TokenEconomizer avoids. Early tasks can cost more while it learns, but cumulative costs dipped below default in every repository by the sixth task. Savings carried over to web development tasks (16.0% to 21.2%) and even to security audits in fresh repos (6.4% to 19.6%).
Caveats: SWE-Bench tasks are Python bug fixes in open-source projects, a cleaner environment than most corporate monorepos, and these are the authors’ own results. Stale or wrong micro-skills are a real risk in fast-changing codebases, though the retire-on-contradiction rule is a reasonable safeguard.
Why it matters
As teams run agents all day, token bills are becoming a line item that finance departments notice. A 20% to 30% cut without accuracy loss is meaningful at scale. More broadly, this points at a design pattern that should become standard: agents that accumulate local, verifiable experience about the environment they work in, rather than relying on ever-larger context windows. Keeping that memory on the developer’s machine is also the right privacy default.
Who benefits
- Developers using coding agents
- Lower per-task costs in repos they revisit, without switching agents or models.
- Engineering managers
- A practical lever on rising agent spend that doesn’t trade away accuracy.
- Agent vendors
- Evidence that persistent repo memory and tool pruning belong in the product itself.
- Security teams
- Learned data stays local, and failure loops escalate to a human instead of running unchecked.
What to watch
- Independent results on large private codebases beyond SWE-Bench’s Python projects.
- Whether commercial coding agents build similar experience-driven memory natively.
- How micro-skills hold up when repositories change quickly.
- Community adoption and integrations for the open-source plugin.
FAQ
What is TokenEconomizer?
An open-source plugin from UC Berkeley, Microsoft Research and Microsoft Security that learns from past coding-agent sessions in a repository to reduce token waste.
How much does it save?
18.4% to 30.9% in average cost across 277 SWE-Bench tasks and five agent-model combinations, per the researchers.
Does it hurt accuracy?
The researchers report no performance loss; Pass@1 rose in four of five combinations.
Does it change the agent or model?
No. It works through interfaces the agent already exposes and keeps learned data on the developer’s machine.
Companies: Microsoft
More on Microsoft
AI · Nov 12, 2026
Microsoft Research finds 8% of coding-agent sessions drive 44% of AI costs, plus a KLS proofAI · Oct 29, 2026
Microsoft research finds coding agents struggle most with reading unfamiliar codeAI · Oct 30, 2026
A single robots.txt line to block AI training: what the OpenAI-Google-Microsoft-Anthropic pledge does and doesn’t fixAI · Oct 27, 2026
Rohit Patel leaves Meta to build Ndoc, an auditable AI-native rival to Office and Workspace