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, Ion Stoica, Michel Galley, Jianfeng Gao
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.
Create a lesson
Related papers
What Makes Good Data for Training Coding Agents? A Systematic Study on SWE-Gym
Shared title terminologycs.CLYikai Zhang, Mai Xu, Yunbei Zhang et al.
Do Conversational Agents Need Explicit Memory? A Controlled Comparison with Raw-History Retrieval
Shared title terminologycs.CLYongjie Zhou, Shuai Wang, Bevan Koopman et al.
Recognizing Atari and Assessing Sente: Controlled Evaluation Tasks for Language-Based Go Agents
Shared title terminologycs.CLTaiyi Chen, Iskar Deng, Amandalynne Paullada
Self-Evolving Coding Agents via Harness-Policy Optimization
Shared title terminologycs.CLZhepei Wei, Wenlin Yao, Baolin Peng et al.
OPRD: On-Policy Reminder Distillation for Long-Horizon Coding Agents
Shared title terminologycs.CLYuechen Luo, Zhiyi Lai, Miao Ziqi et al.
ToolBottleneckBench: Measuring Tool-Agent Performance under Controlled Pressures and Fixed Harness Budgets
Shared title terminologycs.CLZichuan Xu, Yuyang Dong, Makoto Onizuka et al.