When researchers profiled Claude Code on 60 tasks from SWE-Bench, they found a detail that explains much of the invisible cost in AI coding agents: at each turn the agent received 23 tool descriptions, but 16 were never called. The same pattern appeared in repeated actions already executed in earlier sessions of the same repository. TokenEconomizer was built from this observation: an open-source plugin, presented by UC Berkeley, Microsoft Research, and Microsoft Security, that turns completed sessions into operational memory for the project.

The plugin does not touch the agent or the underlying model. After each session, TokenEconomizer reads the log and updates its repository knowledge through three mechanisms. Micro-skills condense recurring facts into one-line notes; they enter the starting context only after several sessions confirm the pattern and are retired if later evidence contradicts them. Tool pruning removes tools that repository history suggests are unlikely to be used, while always preserving core commands and allowing tools to be restored. Failure-loop intervention uses a judge model to distinguish an agent that is stuck from one still making progress: if stuck, the agent receives a short note with a different approach, and if it remains stuck the plugin alerts the developer rather than stopping work autonomously.

On 277 real bug-fixing tasks from six SWE-Bench repositories and across five different agent-model combinations, average cost fell by 18.4 to 30.9 percent. The savings appeared in every repository tested and in all 30 repository-combination pairs, without performance loss: Pass@1 rose in four of the five cases. The figures include the cost of TokenEconomizerโ€™s own model calls, so they are not gross savings.

For teams running local or self-hosted stacks, the point is not only the monthly provider bill. Every token saved reduces inference load, lowers pressure on compute and memory capacity, and can free throughput for other processes. A precise argument emerges here: TokenEconomizer shifts optimization from the model layer to the orchestration layer. Instead of reducing the modelโ€™s reasoning effort โ€” which in the study produced similar or larger savings but with substantial performance degradation โ€” the plugin removes work that is not actually needed. It requires neither fine-tuning nor model quantization: it is a black-box, experience-driven cost control operating through the interfaces the agent already exposes.

Repository memory changes incentives. Many fixed cost-saving approaches work in some repositories and not others; TokenEconomizer adapts its strategy to the concrete history of the project. There is a second-order consequence for teams evaluating on-premise or hybrid deployments: the accumulated knowledge remains on the developerโ€™s machine and the plugin does not require its own API key. Organizations with data residency or audit constraints can use the mechanism without sending repository history to external services. For those evaluating these trade-offs, AI-RADAR provides analytical frameworks at /llm-onpremise. One trade-off should not be ignored: early sessions can cost more while the system learns. Cumulative cost falls below the default by the sixth task, an acceptable horizon for long-lived repositories but perhaps less so for occasional tasks.

The results extend beyond SWE-Bench: on sequential web development tasks costs were 16.0 to 21.2 percent lower, and on security auditing tasks, where every activity starts from a new repository, 6.4 to 19.6 percent lower. This suggests the plugin can reduce generic waste even without a large repository-specific memory.

The structural signal is clear: agent efficiency does not depend only on model quality or quantization. Orchestration and operational memory become independent levers for reducing total cost of ownership. For teams managing local infrastructure, this is a meaningful direction: it allows less computation to be spent without changing the model and without moving data. It is not a silver bullet: it introduces a judge model, consumes tokens for its own decisions, and must be integrated carefully. But it is a concrete step toward agents that learn not only how to solve tasks, but also how to spend computation more effectively.