Evaluating Code Slop in Long Horizon Coding Agents
Shubham Gandhi ⋅ Shyam Agarwal ⋅ Nachiket Kotalwar ⋅ Atharva Naik
Abstract
Coding-agent evaluations usually ask whether an agent solves a task, but real software work also depends on the code an agent leaves behind for humans to read, revise, and maintain. This matters most in long-horizon workflows such as release-to-release migration, which are rarely finished in a single turn: the intermediate code an agent produces becomes the shared working state for the next round of human-agent collaboration, even when the current turn does not pass the tests. We call this "code slop" (unnecessary code volume, control-flow complexity, or maintainability debt beyond what a task requires) and measure it as the change a trajectory induces in three static-analysis metrics. Using the SWE-EVO benchmark with three coding models, we evaluate agents on both functional metrics (resolve rate, fractional test-pass utility, and regression rate) and these slop metrics, across four cleanup policies: no cleanup, a single pass at the end, periodic in-trajectory cleanup, and a monitor-triggered policy. Functional utility stays within a narrow band ($70$-$76\%$) across all policies, yet the code left behind differs by more than a factor of five in code volume, and more in complexity and debt. A single final pass does not meaningfully reduce slop; periodic in-trajectory cleanup does, but its fixed cadence is arbitrary and the most costly; and a trajectory-monitored policy gives the largest reduction on all three slop metrics at about a quarter lower cost than the strongest periodic schedule and with no cadence to tune. The reduction holds across the bulk of tasks rather than reflecting a few outliers, and it is strongly model-dependent: the largest reductions occur in weaker models, while the strongest already writes compact code and changes little. These results argue for evaluating coding agents not only by whether they complete tasks, but by the maintainability of their work as well.
Chat is not available.
Successful Page Load