Microsoft’s New Tool Can Cut AI Coding Costs by Up to 31%
Researchers from Microsoft and the University of California, Berkeley, have introduced a free tool called TokenEconomizer that can reduce the cost of using AI coding assistants by up to 31%.
Researchers from Microsoft and the University of California, Berkeley, have introduced a free tool called TokenEconomizer that can reduce the cost of using AI coding assistants by up to 31%.
Article outline
- What happened
- The key numbers
- Why it matters
- The details
- A closer look
- The bottom line
Key points
- Claude Code running Opus 4.8 recorded the largest cost reduction at 30.9%, followed by Codex with GPT-5.6 Sol at 26.1%.
- Gemini 4 Carbon Beats GPT-6 Astra and Claude Opus 5.5 as the World's Top AI Model.
- Cases where costs rose 0 out of 30 12 out of 30 Not specified 15 out of 30.
- While preventing repeated failed attempts saved another 5.4% to 7.1% when tested separately, remembering useful project information reduced costs by 11.8% to 14.3%.
- In tests involving 277 coding tasks, TokenEconomizer reduced costs by 18.4% to 30.9% while maintaining similar or better results in most cases.
For context, the tool works with popular AI coding assistants, including Claude Code, OpenAI Codex, GitHub Copilot CLI, and Pi.
In practice, the researchers have created the tool publicly available, allowing developers to apply it without paying for the software itself. How Does TokenEconomizer Work?
AI coding assistants employ tokens to understand instructions, read code, and complete tasks. Developers pay for these tokens when using paid AI services.
Nevertheless, researchers identified that these assistants often waste tokens by repeating work, using unnecessary tools, and trying the same failed solutions multiple times.
For example, an AI assistant might repeatedly search for the same file or instructions even though it discovered them during an earlier task.
TokenEconomizer helps avoid this difficulty by remembering useful information from previous sessions. It uses three methods to reduce unnecessary work.
First, it remembers significant details concerning a project, such as the commands needed to test the code. This prevents the AI assistant from searching for the same information again.
Second, it removes tools that the AI assistant does not need for a particular task. This reduces the amount of information the AI must process.
Third, it detects when the assistant keeps making the same mistakes and encourages it to try a different approach or stop wasting resources.
For context, the tool works alongside existing AI assistants, so developers do not need to change the AI models themselves. AI Coding Costs Drop by Up to 31%.
Meanwhile, the researchers tested TokenEconomizer on 277 software development tasks using different AI models. The results indicated that the tool consistently reduced costs. AI Coding Assistant Cost Reduction Success Rate Before Success Rate After. Claude Code + Sonnet 5 23.6% 74.7% 76.0%. Claude Code + Opus 4.8 30.9% 74.0% 73.0%. Codex + GPT-5.6 Terra 24.7% 73.8% 74.7%. Codex + GPT-5.6 Sol 26.1% 80.1% 81.7%. Copilot CLI + Sonnet 5 18.4% 75.0% 77.6%.
Source: TokenEconomizer research paper, Table 1. Success rates measure tasks completed correctly on the first attempt.
In practice, the researchers additionally checked whether spending fewer tokens affected the quality of the AI's work.
In four of the five tested setups, the AI assistants completed slightly more tasks successfully on their first attempt.
Nevertheless, Claude Code with Opus 4.8 experienced a small decline in its success rate, dropping from 74% to 73%.
Although results may vary, this suggests that developers can reduce AI usage costs without significantly affecting performance. Tool Gets Better With Continued Employ.
TokenEconomizer becomes more useful as developers continue working on the same project.
During the first few tasks, it collects information regarding the project and how the AI assistant works.
It then uses that information to avoid unnecessary steps in future tasks.
Notably, the researchers discovered that some projects initially cost slightly more as the tool needed time to learn.
Nevertheless, by the sixth task, all six tested projects became cheaper to work on.
Removing unused tools produced the largest individual savings, reducing costs by 13.2% to 17.7%.
While preventing repeated failed attempts saved another 5.4% to 7.1% when tested separately, remembering useful project information reduced costs by 11.8% to 14.3%. How Does It Compare With Other AI Cost-Saving Tools?
TokenEconomizer is not the only tool designed to reduce how much AI coding assistants cost.
Other tools, including RTK, Serena, and Aider RepoMap, additionally try to produce coding assistants more efficient.
Nevertheless, the researchers identified that these tools did not consistently reduce costs throughout every tested project. Feature TokenEconomizer RTK Serena Aider RepoMap.
Main purpose Learns from past tasks to reduce unnecessary work Reduces the size of command outputs Helps AI understand and navigate code Provides a summary of project code. Learns from previous tasks Yes No No No.
Backed AI tools Claude Code, Codex, Copilot CLI, Pi 18 AI coding tools AI tools supporting MCP Aider.
Average cost change in research tests 18.4%-30.9% lower 8.9% lower to 4.5% higher Not included in main tests 6.1% lower to 6.5% higher.
Source: TokenEconomizer research paper and project documentation. The cost comparisons reflect the study's tested configurations, not every feasible workload. TokenEconomizer reduced costs throughout all 30 tested project and model combinations.
While Aider RepoMap climbed costs in 15 cases, by comparison, RTK rose costs in 12 cases.
In practice, the researchers discovered that TokenEconomizer performed better overall as it adjusts its approach based on what it learns from each project instead of applying the same method everywhere. Free to Employ With Popular AI Coding Assistants. TokenEconomizer supports Claude Code, OpenAI Codex, GitHub Copilot CLI, and Pi.
It requires Python 3.10 or newer and can run on a regular computer without a dedicated graphics card.
Although developers may still need paid access to the AI coding assistants they apply, the tool additionally does not require a separate API key.
TokenEconomizer stores the information it learns regarding each project locally on the user's computer.
For now, microsoft's New Tool Can Cut AI Coding Costs by Up to 31% remains the part of the story worth watching, and further updates are likely as more details are confirmed.




