Skip to content

Evaluating Code Slop in Long-Horizon Coding Agents

Shubham Gandhi, Shyam Agarwal, Nachiket Kotalwar, Atharva Naik

cs.SE

Abstract

Coding-agent evaluations typically measure whether an agent solves a task and ignore the code it leaves for humans to review and maintain. We call unnecessary code volume, control-flow complexity, and maintainability debt beyond task requirements code slop, and operationalize it as trajectory-induced changes in three static-analysis metrics. Across a 2,268-run evaluation covering 42 SWE-EVO tasks, three coding models, three seeds, and six cleanup settings, we measure functional outcomes alongside code slop. Aggregate functional utility stays within a narrow band (70-76%), yet code-volume deltas range from -14.3 to -79.3 across policies, with substantial differences in complexity and debt. A single final cleanup pass barely reduces slop. Periodic in-trajectory cleanup reduces slop but is costly and requires a fixed cadence, whereas a monitor-triggered policy gives the largest reduction on all three slop metrics and costs about 25% less than the strongest periodic schedule. The reduction holds across most runs and does not depend on a few outliers. It is largest for weaker models; the strongest model already writes compact code and changes little. We therefore argue that coding agents should be evaluated by the maintainability of their work as well as by whether they complete tasks.

Create a lesson

Metadata

Categories
cs.SE, cs.AI