Do Coding Agents Reuse Existing Code or Reinvent the Wheel?
Dongsheng Ma, Sizhe Wang, Xinyi Huang, Zhengren Wang, Yuhan Wang, Luyang Si, Xincheng Wei, Wentao Zhang
Abstract
Coding agents are increasingly deployed for iterative development on real repositories, yet existing evaluation barely answers a basic question: do coding agents reuse existing code or reinvent the wheel? The question matters: every duplicated implementation is a fix applied twice and agents produce code far faster than humans can audit, so redundancy accumulates unsupervised. Thus, we present RepoReuse, a multi-turn benchmark for auditing code reuse in real repositories, where requirements are revealed turn by turn and the workspace accumulates across turns. It is built by a fully automated pipeline combining AST-based dependency graphs, guided evidence collection, and execution-verified task synthesis, and scales readily to new repositories. Beyond pass rates, we measure the reuse rate together with recall and cross-turn structural redundancy. An audit over 3,000 turns shows that agents progressively stop exploring relevant repository code, reuse their own history less even when it is fully in the workspace, and leave duplicated logic in 50.8\% of task chains by turn~5---all while pass rates barely move. Such deficiencies are invisible to pass rates, underscoring the need to evaluate code generation beyond functional correctness.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI, cs.CL
Related papers
Evaluating Code Slop in Long-Horizon Coding Agents
Shared title terminologycs.SEShubham Gandhi, Shyam Agarwal, Nachiket Kotalwar et al.
ReleaseSynth: Scaling Data from Software Evolution for Long-Horizon Coding Agents
Shared title terminologycs.SEMan Ho Lam, Chaozheng Wang, Zongjie Li et al.
Proceeding After Seeing: When Coding Agents Act on Users' False Claims About the Code
Shared title terminologycs.SEYi Sun
MergeReady-Bench: Evaluating and Improving Coding Agents Beyond Test Passing
Shared title terminologycs.SEPriyatham Kattakinda, Wenxiao Wang, Soheil Feizi
Context Clash: Prevalence and Limits of Lightweight Detectors for Cross-Tool Coding-Agent Instruction Conflicts
Shared title terminologycs.SEAditi Patodiya
Information Needs in Code Review: What Can an Agent's Trajectory Answer?
Shared title terminologycs.SEHannah Estes, Saba Khanmohammadi, Amirali Rayegan et al.