TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents
Aaron J. Li, Weijia Xu, Chandan Singh, Zixiao Chen, Jeevana Priya Inala, Charlotte Siska, Acar Tamersoy, Bin Yu and 3 others
UC Berkeley · Microsoft Research · Microsoft Security
Published October 15, 2026 · on the feed October 19, 2026 · ▲ 4 · arXiv 2610.22732
The abstract
Advances in frontier coding agents have sharply increased the token costs of AI-assisted software engineering. Their token efficiency is typically evaluated on isolated tasks, whereas real-world developers use them to continuously build, update, and maintain large-scale projects. This mismatch motivates us to evaluate agents over sequences of realistic coding tasks, where we find that agents exhibit recurring environment-dependent token costs that existing methods struggle to reduce. To minimize these costs, we introduce TokenEconomizer, an external controller that cuts environment-specific token costs over a sequence of tasks. These cuts come from determining (i) which operational micro-skills to inject, (ii) which persistently irrelevant tools to prune, and (iii) when to intervene in unproductive failure loops. Across Claude Code, Codex, and GitHub Copilot CLI paired with frontier models, TokenEconomizer reduces the average token cost by 18.4-30.9% with comparable task success. Savings hold in every repository under every tested agent-model setting and generalize to diverse domains such as sequential web development and security auditing, where costs fall by 6.4-21.2% depending on task structure. Our work establishes adaptive black-box cost control as a promising direction for reducing token costs of coding agents in realistic settings.
The Brief
2:28A short podcast summary of the paper. Written and voiced by AI.
Transcript
TokenEconomizer. Experience-Driven Black-Box Cost Control for Coding Agents. By Aaron J. Li and ten others, from UC Berkeley, Microsoft Research, and one other institution. Published on the fifteenth of October. Its code repository is worked out: about one hundred and forty source files, with a readme and a licence.
Advances in frontier coding agents have sharply raised the token cost of AI-assisted software engineering. Their token efficiency is usually measured on isolated tasks, but real developers use them differently: to keep building, updating and maintaining large projects over time. Evaluating agents over sequences of realistic coding tasks instead exposes something isolated tasks hide. The agents show recurring token costs that depend on the environment, paid again and again, and existing methods struggle to reduce them. The waste is not a one-off: it comes back with every new task in the same environment.
TokenEconomizer is an external controller that cuts those environment-specific costs across a sequence of tasks. It sits outside the agent and treats it as a black box, learning from experience in that environment over time. Since the costs it targets recur from task to task, a controller that watches the whole sequence is in a position to see them, where an agent focused on one task is not.
Its savings come from three decisions. Which operational micro-skills to inject into the agent. Which tools have stayed persistently irrelevant and can be pruned. And when to intervene in a failure loop that has stopped making progress. One decision adds something to the agent, one takes something away, and one cuts a run of wasted effort short. All three act on the agent from outside, without changing the agent itself.
It was tested across Claude Code, Codex and GitHub Copilot CLI, each paired with frontier models. Average token cost fell by eighteen point four to thirty point nine percent, with comparable task success. The savings held in every repository, under every agent and model setting tested. They also generalize beyond ordinary coding, to domains such as sequential web development and security auditing, where costs fall by six point four to twenty-one point two percent, depending on how the tasks are structured.
None of this requires changing the agents themselves. Because the controller works from outside and learns from the sequence of tasks, the same approach applies across three different agents. The authors present adaptive black-box cost control as a promising direction for cutting what coding agents cost in realistic, ongoing work.
More with an account
Listen to every day’s papers
Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.
Join free