Back to News
RSS feedarxiv.org

Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agents

Summary

This study examines recurring cost-inefficient behavior in coding agents, using 1,200 trajectories from Claude Code and Mini-SWE-Agent across four configurations on SWE-bench Verified. The authors identify three patterns: subsumed retrieval, similar script generation, and test re-execution. Together, these behaviors appear in 79.00% to 98.00% of coding tasks and can account for as much as 22.75% of task cost. The study then evaluates three mitigation approaches, using more than 10,000 trajectories from held-out SWE-bench Verified and Pro tasks: structure-aware retrieval, agent-synthesized skills, and developer-designed skills. Structure-aware retrieval does not consistently improve efficiency because its own retrieval overhead can change agent delegation; in some cases, it increases cost by up to 28.14%. Agent-synthesized skills tend to be low-level and specific to individual traces, limiting their transferability. Developer-designed skills instead provide higher-level, trace-agnostic guidance and reduce costs by up to 41.73%, roughly twice the maximum reduction achieved by agent-synthesized skills.