TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents
Abstract
TokenEconomizer reduces recurring token costs of coding agents across sequential real-world tasks by pruning irrelevant tools, injecting micro-skills, and interrupting failure loops.
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.
Community
Coding agents keep paying for the same waste in the same repo. TokenEconomizer is a black-box controller that learns from past tasks to inject micro-skills, prune unused tools, and break failure loops. It cuts cost by 18.4โ30.9% across Claude Code, Codex, and Copilot CLI on SWE-Bench with comparable Pass@1, saving token cost in every repo and setting we tested.
๐ https://tokeneconomizer.github.io
๐ป https://github.com/microsoft/TokenEconomizer
Happy to answer questions!
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- An Empirical Study of Harness Design for Coding Agents (2026)
- Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agents (2026)
- WideSWE: Can Coding Agents Coordinate Changes Across Repositories? (2026)
- Grow the Harness, Not the Context: From Strategy-Free Scaffolds to Reusable Specialist Agents (2026)
- StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents (2026)
- Beyond Token Savings: A Systematic Study of Context Compression in LLM Agents (2026)
- XRepoSkill: Learning Transferable Skills for Software Engineering Agents (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2610.22732 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper