Microsoft, UC Berkeley Release Coding Agent Cost Plugin
- •Microsoft and UC Berkeley researchers release an open-source plugin that cuts coding agent costs by up to 30.9%.
- •Tests covered 277 tasks across six SWE-bench repositories; Pass@1 rose in four of five agent-model combinations.
- •Web-Bench costs fell 16.0–21.2%, but the plugin still needs validation in long-term real-world development.
Microsoft and UC Berkeley researchers released TokenEconomizer, an open-source plugin that cuts AI coding agent costs by up to 30.9% while maintaining task success rates. They published it on arXiv, and it can work with Claude Code, Codex, GitHub Copilot CLI, Pi and other tools. It operates externally without changing model weights or internal structure.
The researchers evaluated five agent-model combinations on 277 tasks across six code repositories in SWE-bench. Costs fell 18.4–30.9% compared with the standard setup. Pass@1, a measure of task success on the first attempt, rose in four combinations and fell by 1 percentage point in the fifth. The cost calculation included different charges from reusing cached input tokens as well as the cost of additional model calls.
Savings grew as tasks were repeated in the same repository. Costs could rise at first because little information from prior tasks was available, but cumulative costs became lower than with the standard setup from the sixth task onward in every evaluated repository. The researchers identified repeated searches for previously found information and loading unused tool descriptions as sources of wasted costs. In experiments using Claude Code, after five or more tasks, about 30% of tool calls repeated earlier actions, and 16 of the 23 tools loaded each time went unused.
Ten failed runs accounted for 17% of the analyzed tasks but 32% of total costs. Tokens continued to be used as the agent made repeated edits and tests to fix the same errors. TokenEconomizer addresses such repetition with three features. “Micro-skills” store information found in past tasks as short instructions for future work. “Tool cleanup” removes unused tools from the next session’s list while keeping essential tools such as file reading and writing, and periodically checks the full list. “Failure-loop intervention” prompts the agent to try another approach when the same error repeats or progress stalls, and recommends stopping if failures continue. The plugin does not forcibly terminate tasks.
Unlike existing token-saving tools that compress command output or code structures in fixed ways, TokenEconomizer adjusts repository-specific strategies based on past task results. The researchers also reported cost reductions of 16.0–21.2% on Web-Bench, a web development benchmark; savings varied by task type and execution environment. The plugin is open source on GitHub and can be added to coding agents without a separate GPU. Micro-skills, which require additional model calls, are disabled by default, so actual savings may vary with enabled features and the work environment. The researchers said the evaluation used successive code-modification tasks in the same repositories, not long-term records from professional developers. They said the plugin’s effect in real development environments needs further validation.