Skip to content

Coding Agents: Microsoft Approach Aims to Noticeably Cut Token Costs

Microsoft Research has introduced TokenEconomizer. The tool analyzes completed sessions of AI coding agents in a codebase and is intended to lower the token costs of future tasks. According to the authors, costs drop by 18.4 to 30.9 percent with a comparable success rate. The agent and model remain unchanged. Independent verification of the results is still pending.

AI-generated: This story was selected, checked against the primary source and written with AI, without editorial review before publication.

Executive Summary

  • Microsoft Research has introduced TokenEconomizer, an external controller for AI coding agents. According to the paper, it lowers average token costs for Claude Code, Codex and GitHub Copilot CLI by 18.4 to 30.9 percent while maintaining comparable task success.
  • The tool changes neither the agent nor the underlying model. Instead, it learns from previous sessions in the same codebase.
  • According to the blog post, the learning phase initially adds costs. From the sixth task per repository onward, cumulative costs were below those of standard operation.
  • The results come from the authors themselves and are based on benchmarks using open-source Python projects. No independent replication is available yet.
  • The tool is mainly relevant for companies with in-house software development that regularly work in the same codebases.

What happened?

In November 2026, Microsoft Research introduced the TokenEconomizer project on its blog. The accompanying paper is titled TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents. According to the blog post, the tool is an open-source plugin jointly developed by UC Berkeley, Microsoft Research and Microsoft Security.

The starting point: according to the authors, AI coding agents essentially start every session from scratch. They rediscover known facts, load tools they never use and repeat unsuccessful approaches. For a preliminary analysis, the blog post says the authors had Claude Code work on 60 tasks from the SWE-Bench benchmark, a collection of real-world bug fixes in open-source Python projects. Three patterns stood out:

  • 30 percent of tool calls repeated an action from an earlier task in the same repository.
  • Of 23 tools provided, 16 were never called.
  • The 17 percent of tasks that failed accounted for 32 percent of spending.

TokenEconomizer analyzes the log after each session and intervenes through three mechanisms, which the paper confirms:

  • Micro-skills: short, repository-specific hints given to the agent at the start of a session.
  • Tool pruning: removing tools that consistently go unused.
  • Failure-loop intervention: stepping in when the agent is stuck in an unproductive error loop.

According to the blog post, an evaluation model checks whether the agent is actually stuck. If so, the agent first receives a hint pointing to a different approach. If it remains stuck after that, the developer is notified. The work is not terminated automatically.

The paper reports an average cost reduction of 18.4 to 30.9 percent across all tested agent-model combinations, with comparable task success. According to the paper, savings occurred in every repository under every combination. The blog post puts the test scope at 277 SWE-Bench tasks from six repositories and five agent-model combinations. According to the post, the success rate (Pass@1) increased in four of the five combinations. The blog post also says that reducing the model’s reasoning depth saved a similar amount or more, but significantly worsened results. According to the authors, the cost of TokenEconomizer’s own model calls is already factored into the savings.

In other application areas, the paper reports cost reductions of 6.4 to 21.2 percent, depending on task structure. The blog post breaks this down further: 16.0 to 21.2 percent for sequential web development and 6.4 to 19.6 percent for security audits.

Why does it matter?

Analysis: AI coding agents are typically billed based on usage, so costs grow as adoption increases. The approach presented here does not target the model, but rather recurring inefficiencies in day-to-day work. In principle, it could therefore be combined with tools already in place, without switching vendors or models.

The authors’ conclusion is also noteworthy: fixed cost-saving strategies do not help everywhere. According to the blog post, three popular open-source plugins with fixed strategies reduced costs in only some repositories. Cost control that adapts to each codebase therefore seems more plausible than blanket rules.

At the same time, there are clear limitations. The figures are self-reported and based on benchmarks using public Python projects. How well they carry over to proprietary codebases, other programming languages or legacy enterprise systems remains an open question. The source’s wording on result quality is also not entirely consistent, ranging from largely stable to no loss of performance.

What does this mean for mid-sized companies?

Analysis: Directly affected are mid-sized companies with their own software development or IT department that use or are evaluating coding agents such as Claude Code, Codex or GitHub Copilot CLI. According to the source, the approach only pays off after several tasks in the same repository. It is therefore best suited to the ongoing maintenance of internal systems, such as ERP extensions, interfaces or line-of-business applications. For one-off projects or companies without in-house development, the benefit is limited.

From a data protection perspective, one point is relevant: according to the blog post, what the tool learns stays local on the developer’s machine, and the plugin does not require its own API key. These claims are not confirmed in the paper itself. In any case, the data protection assessment of the coding agent in use remains unaffected.

For budget owners: the percentages cited are lab results. They are useful as a reference point, not as a basis for planning. Savings depend on the codebase, agent, model and the team’s way of working.

Related: AI Agent Generator

Recommendation from Future AI Solutions

Recommendation: Companies already using coding agents in production should evaluate TokenEconomizer in a controlled pilot project. Based on the information available, the following steps make sense:

  • Establish a baseline before testing: token consumption and success rate per task without the plugin.
  • Choose a repository that is worked on regularly and plan for well over six tasks, since according to the source the learning phase initially adds costs.
  • Check result quality in addition to costs, for example through test results and code reviews.
  • Involve IT security and verify the claims about local data storage directly in the source code.
  • Base budget decisions on your own measurements, not on the published benchmark figures.

Companies without in-house development teams have no immediate need to act. However, they can raise the topic of cost control in discussions with external software service providers that use coding agents.

Source and transparency

Primary source TokenEconomizer: Learning from Experience to Make AI Coding Agents More Efficient Microsoft dated November 16, 2026

This story was selected automatically, checked against the primary source, put into context and translated from the German edition. Facts, analysis and recommendation are shown separately in the text.

Read this story in German