---
title: "Evaluating Code Slop in Long-Horizon Coding Agents"
authors: ["Shubham Gandhi", "Shyam Agarwal", "Nachiket Kotalwar", "Atharva Naik"]
date: "2026-12-01"
version: "v1"
address: "https://iraven.io/papers/evaluating-code-slop-in-long-horizon-coding-2612-01914"
source: "https://arxiv.org/abs/2612.01914"
venue: "arXiv"
licence: "Creative Commons Attribution 4.0 International"
licence_url: "https://creativecommons.org/licenses/by/4.0/"
---

## 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.

## 1 Introduction

AI coding agents are usually evaluated on whether they can produce patches that satisfy tests. Benchmarks such as SWE-Bench (Jimenez et al., 2024) have made this functional criterion concrete, but task success is an incomplete account of agent behavior. In deployed software workflows, humans rarely care only that an agent produced a passing patch; they also need to review it, extend it, debug it, and integrate it into a codebase that other developers will continue to modify. An agent that reaches a correct outcome by leaving behind tangled control flow, duplicated abstractions, or unnecessary edits can increase the human cost of collaboration even when standard success metrics look favorable.

Software engineering has long held that most of a codebase’s cost comes from maintenance and evolution rather than initial authoring, so shortcuts that speed delivery accrue *technical debt* that must eventually be repaid (Cunningham, 1992; Kruchten et al., 2012). LLM coding tools intensify this tradeoff. Although practitioners and studies report productivity gains from AI assistants (Ziegler et al., 2024), recent causal studies of real open-source projects find that adopting AI assistants and coding agents gives only a short-lived gain in development velocity. The same adoption causes a substantial and *persistent* rise in static-analysis warnings and code complexity, that is, technical debt that the agents introduce and that slows projects over time (He et al., 2026; Agarwal et al., 2026). Controlled studies similarly find that developers using AI assistance write less secure code while overestimating its quality (Perry et al., 2023), and that the assistants themselves frequently emit code with known security weaknesses (Pearce et al., 2022). As agents write and evolve more code, the maintainability of what they leave behind becomes a first-class outcome that test-pass metrics do not capture.

This gap is especially important for long-horizon coding agents. Release-to-release migrations, multi-file feature work, and repository-evolution tasks are rarely single-turn interactions. They often involve multiple rounds of human-agent interaction, partial patches, debugging cycles, and review. The code the agent leaves at each stage becomes part of the working state that the human and the agent share, *even when a given turn does not solve the task*. The cleanliness of that code is therefore more than an aesthetic concern; it is a behavioral footprint of the agent, and standard success metrics do not record it. Whether a leaner intermediate state measurably eases the next turn is an open question that we cannot answer with our single-turn design (Section 8); in this paper we make the footprint itself measurable.

We call this footprint *code slop*: unnecessary code volume, control-flow complexity, or maintainability debt beyond what task completion requires. We measure slop through the signed change a trajectory induces in each static-analysis metric, where a leaner change means less slop; a reduction counts as an improvement only jointly with the functional metrics, so that deleting task-relevant code is not rewarded (Section 5.4). Because the minimal task-solving patch is generally unobserved, we operationalize slop through comparative static-analysis deltas computed before and after an agent acts. In addition to asking whether the agent passes tests, we can then ask what codebase state it leaves for a human collaborator.

We use SWE-EVO (Le et al., 2025) as our testbed; each task asks an agent to evolve a real Python repository from one release to a later one. These release-to-release tasks are longer and less localized than many single-issue repair settings, so they are closer to the iterative workflows where maintainability matters.

![Figure](figures/f1-fig-cleanup-loop.svg)

Figure 1: **Trajectory-time cleanup.** The standard ReAct loop (grey) alternates between a thought, one `bash` command, and edits to the working tree. Our monitor and cleanup pass (blue) operate inside this loop: at natural breakpoints, cleanup strips bloat while retaining the working fix, and the agent continues from the cleaned tree. The final diff is scored for functional behavior and code slop ($\Delta\mathrm{LOC}$, $\Delta\mathrm{Cog}$, $\Delta\mathrm{Rem}$). The policies differ only in when cleanup fires: never (**Base**), once at the end (**One-shot**), every $N$ steps (**Periodic-$N$**), or adaptively (**Monitor**).

In this work we ask: *Do coding agents leave clean work behind, and can software-engineering quality metrics reveal behavioral differences that success metrics miss?* We use cleanup policies as probes of the relationship between task progress and artifact quality; we do not study cleanup as a solution to slop. Our contributions are:

1. **Code slop as an evaluation dimension.** We define code slop and operationalize it with three static-analysis metrics (code volume, control-flow complexity, and maintainability debt) grounded in the software-engineering technical-debt literature.
2. **A controlled cleanup-policy study.** Across 2,268 SWE-EVO runs, we jointly score functional outcomes and artifact quality under six settings: no cleanup, a final pass, three periodic in-trajectory schedules, and adaptive monitor triggering.
3. **Evidence about timing and model dependence.** We show that trajectory-time cleanup changes slop without a corresponding pattern in functional utility; adaptive timing yields the strongest reductions at lower cost than the strongest periodic schedule, and the effect varies sharply by model.

Cleanup changes the agent’s behavioral footprint, but no single policy is best on every measure, so slop reductions must be evaluated jointly with strict success, fractional test utility, and regressions.

## 2 Related Work

**Evaluating and monitoring coding agents.**

SWE-Bench (Jimenez et al., 2024) made test-pass rate the standard way to score coding agents, and scaffolds like SWE-agent (Yang et al., 2024) scaled it up. Most such benchmarks test isolated, single-issue repairs; SWE-EVO (Le et al., 2025) instead has an agent evolve a repository across successive releases, the long-horizon setting we study. All of them judge the final patch only by whether its tests pass. We also measure the code the agent writes along the way and treat it as a behavioral signal, since two agents can pass the same tests while leaving the codebase in very different shape. Closest to our approach is work that acts on an agent *during* a run: process reward models give step-level feedback (Lightman et al., 2023), and recent work extends this to coding agents with small critic models that course-correct mid-trajectory (Gandhi et al., 2025; Gandhi et al., 2026). Our monitor-triggered cleanup is one such intervention, but it targets the maintainability of the evolving patch instead of task success, and it fires on a yes/no question posed to the agent’s own model, with no learned reward model.

**Code-quality and technical-debt metrics.**

A long line of software-engineering research quantifies code maintainability so that teams can monitor and manage it. The *technical debt* metaphor names implementation shortcuts that trade short-term speed for long-term cost (Cunningham, 1992; Kruchten et al., 2012), and static analysis makes the notion measurable: the SQALE method estimates the effort needed to remediate maintainability issues (Letouzey, 2012), cognitive complexity scores how hard control flow is to understand (Campbell, 2018), and tools such as SonarQube implement many of these measures and have themselves been studied empirically (Lenarduzzi et al., 2023). Our slop metrics (code volume, control-flow complexity, and maintainability remediation effort; Section 3.2) are drawn directly from this body of work. Whereas these measures are typically applied to a static snapshot of a human-written codebase, we compute them as signed before/after deltas over an agent’s trajectory and use them to evaluate agent behavior.

**Refactoring and automated cleanup.**

The established remedy for accumulated debt is *refactoring*: behavior-preserving transformation that restores clarity without changing what the code does (Fowler, 1999). A large body of work automates the detection of refactorings in real software histories (Tsantalis et al., 2018), and recent methods pair LLMs with static analysis to suggest and safely apply refactorings such as Extract Method (Pomian et al., 2024). These approaches operate *post hoc*, on code that is already complete. We instead apply cleanup *during* a long-horizon agent’s trajectory and ask whether trajectory-time refactoring can reduce the slop an agent leaves behind without sacrificing task progress.

## 3 Problem Formulation

### 3\.1 Code Slop as a Behavioral Footprint

We define *code slop* as the unnecessary code volume, control-flow complexity, or maintainability debt that an AI coding agent introduces beyond what the task requires for functional correctness. It is a behavioral footprint, produced by the agent’s trajectory and visible in the code humans inherit. The footprint exists even when the task is not strictly solved, because a partially successful trajectory still changes the codebase; we therefore measure it over all attempted tasks rather than solved ones alone.

Formally, let $C_{0}$ denote the initial codebase state and $C_{T}$ the state after an agent acts over $T$ steps, and let $f(C)$ be a static quality metric. The slop for metric $f$ is

$$
\mathrm{slop}_{f}=\big(f(C_{T})-f(C_{0})\big)-\big(f^{*}(C_{T})-f^{*}(C_{0})\big),
$$

where $f^{*}$ denotes the value under an idealized minimal-change solution. Since $f^{*}$ is generally unobservable, we approximate slop by the observable delta $\Delta f=f(C_{T})-f(C_{0})$ and compare it across cleanup policies against the no-cleanup baseline. Lower deltas indicate leaner outcomes; a negative delta means the final repository measures below its pre-task state.

### 3\.2 Slop Metrics

We operationalize slop with three static-analysis metrics, each computed with SonarQube and named by a plain-English term in prose and a symbol in tables. *Code volume* ($\Delta\mathrm{LOC}$; SonarQube metric `ncloc`) is the number of physical lines that contain at least one character that is neither whitespace nor part of a comment (SonarSource, 2025); it captures the code an agent adds or removes, where excessive additions signal over-engineering, redundant implementations, or unreused abstractions. *Control-flow complexity* ($\Delta\mathrm{Cog}$; `cognitive_complexity`) measures how hard the code’s control flow is to understand (SonarSource, 2025). Following its definition (Campbell, 2018), it adds a point for each construct that breaks the linear flow of control and a further point for each level of nesting that surrounds it, so deeply nested or convoluted branching scores higher than flat code; it is an understandability-oriented alternative to cyclomatic complexity. *Maintainability debt* ($\Delta\mathrm{Rem}$; `software_quality_maintainability_remediation_effort`) is SonarQube’s estimate of the time, in minutes, needed to fix all detected maintainability issues (SonarSource, 2025); it is the multi-quality-rule-mode counterpart of the legacy technical-debt index (`sqale_index`) and, unlike the other two, aggregates issue-level findings, counting only maintainability (code-smell) issues rather than bugs or security defects.

### 3\.3 Cleanup as a Behavioral Intervention

We use cleanup policies to test whether artifact quality can change while task success stays the same. Given a trajectory $\tau=(a_{1},\ldots,a_{T})$, a cleanup schedule $\mathcal{S}\subseteq\{1,\ldots,T\}$ specifies the steps after which a cleanup operation is applied (Figure 1): (i) **Base** ($\mathcal{S}=\emptyset$), no cleanup (baseline); (ii) **One-shot** ($\mathcal{S}=\{T\}$), a single cleanup pass after the task attempt completes; (iii) **Periodic** ($\mathcal{S}=\{N,2N,\ldots,T\}$), cleanup every $N$ steps during the run and again at the end, written **Periodic-$N$** for period $N$; and (iv) **Monitor**, cleanup invoked during execution whenever a trajectory monitor flags the current state as needing it. An ideal policy would minimize slop while preserving success, i.e. $\min_{\mathcal{S}}\sum_{f}w_{f}\,\Delta f(C_{T}^{\mathcal{S}})$ subject to $\mathrm{pass}(C_{T}^{\mathcal{S}})=1$. We do not claim to solve this optimization; instead we use these schedules to measure how sensitive software-quality metrics are to agent interventions, and how those metrics trade off against functional outcomes.

## 4 Method

### 4\.1 Benchmark: SWE-EVO

We use the SWE-EVO benchmark (Le et al., 2025), which consists of real-world version-to-version transitions from open-source Python repositories. Each task requires an agent to evolve a codebase from one release to the next, validated by the test suite introduced in the target version. We evaluate on 42 of the 48 tasks (excluding 6 whose Docker images fail to build), spanning repositories such as `dask/dask`, `iterative/dvc`, `conan-io/conan`, and `modin-project/modin`; the full list of instances is given in Appendix C. These transitions are longer and less localized than single-issue repair, making them a useful proxy for the iterative, multi-turn workflows we target.

### 4\.2 Agent Configuration

All conditions use the same agent harness, `mini-swe-agent https://github.com/SWE-agent/mini-swe-agent` (Yang et al., 2024), a deliberately minimal ReAct-style scaffold: at each step the agent emits a free-form thought and exactly one `bash` command, and there are no bespoke editing or navigation tools, so it edits files, runs tests, and inspects the repository entirely through the shell. This keeps the action space identical across models and isolates cleanup as the only intervention we vary. Following SWE-EVO, each run is capped at a $100$-step budget and terminates either when the agent submits or when it exhausts the budget; in both cases the `git` diff against the initial commit is the artifact we evaluate for both functional outcomes and slop. We evaluate three base coding models spanning a frontier proprietary model and two strong open-weight models: Claude Sonnet 4.6, DeepSeek V3.2, and Qwen3-Coder 480B.[^1] We use temperature $0$, run each condition with three seeds, and report results averaged over seeds (and over all 42 tasks and three models unless otherwise stated). The agent prompts and additional harness details are given in Appendix D.

### 4\.3 Cleanup Interventions

We order the cleanup conditions so that each policy’s limitation motivates the next. The **Base** condition runs the agent with no cleanup, measuring the footprint of the unmodified agent. The **One-shot** condition applies a single cleanup pass after the trajectory completes, the simplest possible intervention. The **Periodic-$N$** conditions invoke the same cleanup every $N$ steps and again at the end of the run; we report $N\in\{10,20,30\}$. This tests whether cleaning *during* the trajectory, rather than only at the end, reduces slop, at the cost of an arbitrary period $N$. The **Monitor** condition uses a trajectory monitor to decide when cleanup fires, replacing the fixed period with an adaptive trigger. At each step we pose a binary question to the model driving the agent: given the problem statement, the recent trajectory, and the current diff, has the agent *just completed a meaningful subtask and reached a natural breakpoint* where a cleanup pass would not interrupt mid-subtask work? Cleanup fires whenever the answer is `YES`, subject to two guards that suppress wasted passes (Appendix D), and runs the same operation as the periodic conditions.

### 4\.4 Static-Analysis Pipeline and Estimators

For each task and condition we run the static analyzer on the *entire repository tree* both before and after the agent’s intervention, and compute, for each metric $m$, the delta $\Delta m=m_{\text{after}}-m_{\text{before}}$. Fractional utility gives partial credit according to the proportion of relevant tests passed, while regression rate measures how often previously passing tests fail after the agent’s changes. Strict resolve rate, fractional utility, and regression rate are computed as per-seed rates over all tasks, averaged over the three seeds, then averaged over the three models. For slop metrics we pool in a *model-balanced* way: we compute the statistic per model and then average over models, so that a model with many runs does not dominate the pooled number. On these hard tasks most runs do not strictly resolve, and a small number of unsuccessful runs make very large edits (e.g. deleting or ballooning thousands of lines). The raw mean of $\Delta m$ therefore reflects total codebase impact but is sensitive to these tails. We report as our primary statistic the *mid-90% mean*: we drop the most extreme $5\%$ of runs at each tail and average the central $90\%$. We additionally report, in Appendix B, the raw mean and symmetric-winsorized means at several caps; the key qualitative comparison (trajectory-time cleanup reduces more than no cleanup or a single final pass) is stable across all of these, so the reductions we report do not come from a few extreme runs. We compute slop deltas over all attempted tasks (the *all-instance* view): cleanup changes the repository on every trajectory, and too few tasks are solved to measure slop on solved tasks alone (Appendix A). We use SonarQube (Community Build 25.9.0.112764, Python analyzer 5.8.0, in its multi-quality-rule mode) with the default *Sonar way* Python quality profile and no rule customization; the analyzer version, scanner configuration, exact metric keys, and missing-analysis handling are detailed in Appendix F. For a small fraction of repository states ($1.3\%$ of all (policy, model, seed, task) pairs) the analyzer does not return any measures; we drop these per metric and do not impute them as zero.

## 5 Results

### 5\.1 Success Metrics Miss Code Slop

Table 1 reports the main comparison. *Fractional test-pass utility is nearly constant across the six policies* (ranging only over $70.7$–$75.5\%$, within the per-seed variation reported in Appendix A), *yet the slop they leave behind differs by more than a factor of five on code volume and by more on control-flow complexity and maintainability debt*. The factor of five is the spread across the six policies, from the least lean (One-shot, $\Delta\mathrm{LOC}=-14.3$) to the leanest (Monitor, $-79.3$); measured instead against the no-cleanup baseline (Base, $-20.3$), Monitor is leaner by close to a factor of four. Strict resolve rate varies more (from $9.3\%$ for One-shot to $16.1\%$ for Periodic-10; Section 5.2), but it does not explain the slop differences either: Monitor, the leanest policy, resolves as many tasks as Base ($13.5\%$). A success-only evaluation would report these policies as roughly equivalent; the static-analysis metrics show they are not.

Table 1: Main results across SWE-EVO, three models, and three seeds. Resolve, fractional utility, and regression are percentages; cost is mean dollars per instance. Slop metrics are model-balanced mid-90% mean deltas (code volume $\Delta\mathrm{LOC}$, control-flow complexity $\Delta\mathrm{Cog}$, maintainability debt $\Delta\mathrm{Rem}$); lower is better, and negative means the repository ends up smaller than before the task. Parenthetical arrows give the change versus **Base**, colored green (improvement) or red (regression). Bold marks the best value per slop metric; the recommended Monitor row is shaded.

| **Setting** | **Resolve** | **Frac. util.** | **Regr.** | **Cost** | $\Delta\mathrm{LOC}$ | $\Delta\mathrm{Cog}$ | $\Delta\mathrm{Rem}$ |
|---|---|---|---|---|---|---|---|
| Base | 13\.5 | 73\.2 | 35\.4 | 0\.60 | $-20.3$ | $-1.0$ | $-0.8$ |
| One-shot | 9\.3 | 75\.3 | 30\.2 | 0\.84 | $-14.3$ ($\uparrow$ 6.0) | $-0.5$ ($\uparrow$ 0.5) | $-0.0$ ($\uparrow$ 0.8) |
| Periodic-10 | 16\.1 | 74\.1 | 32\.0 | 1\.21 | $-55.4$ ($\downarrow$ 35.1) | $-10.4$ ($\downarrow$ 9.4) | $-4.6$ ($\downarrow$ 3.8) |
| Periodic-20 | 13\.0 | 75\.1 | 30\.2 | 1\.25 | $-36.8$ ($\downarrow$ 16.5) | $-5.9$ ($\downarrow$ 4.9) | $-1.8$ ($\downarrow$ 1.0) |
| Periodic-30 | 11\.9 | 75\.5 | 30\.2 | 1\.11 | $-35.7$ ($\downarrow$ 15.4) | $-6.0$ ($\downarrow$ 5.0) | $-2.8$ ($\downarrow$ 2.0) |
| Monitor | 13\.5 | 70\.7 | 36\.0 | 0\.91 | `\mathbf{-79.3}` ($\downarrow$ 59.0) | `\mathbf{-13.4}` ($\downarrow$ 12.4) | `\mathbf{-4.8}` ($\downarrow$ 4.0) |

### 5\.2 When Cleanup Fires Matters More Than How Often

**A single final pass does not meaningfully reduce slop.**

Cleaning up once after the attempt changes the slop metrics little, and in the all-instance view it reduces code volume less than Base ($\Delta\mathrm{LOC}=-14.3$ for One-shot versus $-20.3$). Its main effect is on functional behavior: it has among the highest fractional utility ($75.3\%$) and the lowest regression rate ($30.2\%$, tied with Periodic-20 and Periodic-30), consistent with a conservative final pass that tidies a finished attempt rather than aggressively shrinking it. This motivates intervening earlier, during the trajectory.

**Periodic in-trajectory cleanup reduces slop, but the cadence is arbitrary and costly.**

Cleaning every $N$ steps does reduce slop: Periodic-10 gives the largest code-volume and maintainability-debt reductions among the periodic schedules ($\Delta\mathrm{LOC}=-55.4$, $\Delta\mathrm{Rem}=-4.6$). However, the reductions are not monotone in $N$ (Periodic-30 reduces maintainability debt more than Periodic-20, $-2.8$ versus $-1.8$), so the period is a hyperparameter with no principled default. Periodic cleanup is also the most expensive family: Periodic-10 costs $\$1.21$ per instance, roughly double the cost of Base. This motivates replacing the fixed period with an adaptive trigger.

**Monitor-triggered cleanup reduces slop most, at lower cost than Periodic-10.**

Monitor gives the largest reduction on all three slop metrics while removing Periodic-10’s two drawbacks, its arbitrary cadence and high cost. It exceeds Periodic-10 on code volume ($\Delta\mathrm{LOC}=-79.3$ versus $-55.4$), on control-flow complexity ($\Delta\mathrm{Cog}=-13.4$ versus $-10.4$), and on maintainability debt ($\Delta\mathrm{Rem}=-4.8$ versus $-4.6$). It costs $\$0.91$ per instance, about $25\%$ cheaper than Periodic-10 ($\$1.21$) and only modestly above a single final pass ($\$0.84$), with no cadence to tune. This saving does not come from cleaning less often (Monitor invokes cleanup about as frequently as Periodic-10): because it fires only at natural breakpoints and skips steps where the patch is unchanged or the agent is mid-recovery (Section 4.3), each invocation acts on a settled, non-empty diff rather than running regardless of whether there is anything to clean.

**Functional utility is preserved; strict resolve is noisier and does not follow slop.**

Across all six policies fractional test-pass utility stays within $70.7$–$75.5\%$, a span comparable to the per-seed standard deviations (up to about $7$ points for the weaker models; Appendix A), so we treat it as preserved. Strict resolve rate varies more, from $9.3\%$ (One-shot) to $16.1\%$ (Periodic-10), and per model it can change substantially (Claude falls from $22.2\%$ at Base to $11.9\%$ under One-shot; Appendix A), but the leanest policies do not have the lowest resolve rates (Monitor $13.5\%$, Periodic-10 $16.1\%$). We therefore do not claim cleanup is resolve-neutral; we claim the slop differences are not explained by a loss of functional progress.

### 5\.3 Slop Reduction is Model-Dependent

The pooled reductions in Table 1 are modest in absolute terms, and the per-model all-instance deltas for Base and Monitor (Table 2) explain why: the large changes are concentrated in the weaker models. The strongest coder (Claude Sonnet 4.6) changes the codebase little under either policy: its Base code-volume delta is small and positive ($+22.1$), and under Monitor it rises slightly to $+28.7$ rather than dropping, with the same pattern on complexity and debt. The weaker models change the codebase much more, and the reductions under Monitor are much larger for both DeepSeek V3.2 ($\Delta\mathrm{LOC}:-126.5\to-683.4$) and Qwen3-Coder 480B ($\Delta\mathrm{LOC}:-280.2\to-1211.5$), with the same direction on complexity and debt.

Table 2: All-instance slop deltas (raw per-model mean) for Base and Monitor (code volume $\Delta\mathrm{LOC}$, control-flow complexity $\Delta\mathrm{Cog}$, maintainability debt $\Delta\mathrm{Rem}$). Claude changes little on every metric, while the reductions under Monitor are pronounced in DeepSeek and Qwen3-Coder. Arrows give the change versus **Base**, colored green (leaner) or red (regression). Qwen3-Coder resolve rates are low, so interpret its magnitudes with caution; full per-policy values are in Appendix A.

| **Setting** | **Claude Sonnet 4.6** | **DeepSeek V3.2** | **Qwen3-Coder 480B** |
|---|---|---|---|
| *Code volume ($\Delta\mathrm{LOC}$)* |  |  |  |
| Base | $+22.1$ | $-126.5$ | $-280.2$ |
| Monitor | $+28.7$ ($\uparrow$ 6.6) | $-683.4$ ($\downarrow$ 556.9) | $-1211.5$ ($\downarrow$ 931.3) |
| *Control-flow complexity ($\Delta\mathrm{Cog}$)* |  |  |  |
| Base | $+7.3$ | $-26.4$ | $-52.6$ |
| Monitor | $+8.5$ ($\uparrow$ 1.2) | $-64.5$ ($\downarrow$ 38.1) | $-208.3$ ($\downarrow$ 155.7) |
| *Maintainability debt ($\Delta\mathrm{Rem}$)* |  |  |  |
| Base | $+4.3$ | $-0.2$ | $-21.7$ |
| Monitor | $+4.9$ ($\uparrow$ 0.6) | $-61.5$ ($\downarrow$ 61.3) | $-132.6$ ($\downarrow$ 110.9) |

We caution that the strict resolve rate for Qwen3-Coder is low (Appendix A), so per-model slop magnitudes are highly uncertain; we claim only that the strongest model changes little while the largest changes occur in the weaker models.

### 5\.4 Robustness of the Estimates

**Robustness to outliers.**

Because a few unsuccessful runs make very large edits, the raw mean of the slop deltas is much larger in magnitude than the mid-90% mean (for example, the raw all-instance code-volume mean for Monitor is $-624.6$ versus a mid-90% mean of $-79.3$). The key qualitative ordering survives this trimming: under both the mid-90% mean and symmetric winsorizing at every cap we tried (Appendix B), Base and One-shot show less code-volume reduction than Monitor and Periodic-10 (for instance, at a cap of $\pm 200$ lines Base is $+5.2$ and One-shot $-5.6$, while Monitor and Periodic-10 are $-12.1$ and $-6.4$). (Periodic-20 and Periodic-30 are closer to Base and cross it at intermediate caps, so we do not claim a single clean ordering of all six policies; the main comparison, trajectory-time cleanup versus no cleanup or a single final pass, is stable.) The reductions therefore hold for the bulk of runs.

**Reductions are not mass deletion.**

A negative slop delta on an unsolved run need not indicate a good patch: it may reflect useful simplification and removal of stale code, or destructive edits by an agent that failed the task. We can bound the second possibility directly. Among unsolved runs, $0.2\%$ removed more than $20\%$ of the repository and the median repository-size change is $0\%$, so destructive mass-deletion is rare and the all-instance reductions reflect broadly leaner end states. This is also why we report slop jointly with strict resolve, fractional utility, and regression rather than in isolation.

## 6 Discussion

**Artifact quality is a distinct evaluation axis.**

The policy comparison shows why success-only evaluation is incomplete: similar functional outcomes can coexist with substantially different repository states. Here we use cleanup as an intervention; changing when it occurs exposes behavioral variation that resolve rate and test utility do not show. The same intervention had little effect on Claude’s already compact trajectories and a much larger effect on the weaker models, so we caution against treating maintainability as a fixed property of an agent scaffold. Artifact-quality metrics therefore add diagnostic information to functional evaluation without replacing it.

**Cleanup timing is a control parameter.**

In the periodic schedules, both footprint and cost vary non-monotonically with $N$, so the cadence is a design choice that changes the results. The monitor replaces that hyperparameter with a data-dependent decision about whether the patch is settled. Its performance suggests that this decision may require only a coarse trajectory signal rather than a learned reward model, while leaving open how a more capable controller should trade artifact quality against task progress.

**How to read a slop reduction.**

Our results support evaluating coding agents by the maintainability of the code they leave behind, and reporting that alongside task success. They do not establish that a leaner end state is a better one: a negative delta can reflect useful simplification or destructive edits, which is why we report slop alongside functional metrics and prefer robust estimators over raw means. The stronger claim, that a leaner intermediate state makes the *next* turn of human-agent collaboration easier, is a hypothesis we cannot test with this design, because we measure a single end-of-run delta and never run a second turn. Testing it requires a multi-turn setup in which a second agent or a human continues from the state the first one left, with downstream effort as the outcome (Section 8).

## 7 Conclusion

Measuring code slop lets evaluators score the code a long-horizon coding agent leaves behind alongside task completion. Across SWE-EVO, cleanup policies with similar functional utility produced different maintainability footprints, and interventions during the trajectory were more effective than a single final pass; with adaptive timing, no fixed cadence had to be chosen. Coding-agent benchmarks should therefore report artifact-quality measures with functional outcomes, and multi-turn studies should test whether leaner inherited states reduce downstream effort.

## 8 Limitations

Most importantly, we motivate the work with a long-horizon payoff that we do not measure directly. We take a single end-of-run code-state delta per task as a proxy for how maintainable the inherited state is, but we do not run a second human or agent turn, so the claim that a leaner intermediate state helps the next collaborator remains untested. Testing it is the clearest extension of this work, and the measurement it needs is concrete: continue each trajectory with a second agent (or a human) starting from the state the first one left, and compare downstream effort, such as steps, cost, or resolve rate on the remaining work, across the states produced by different cleanup policies. Our slop metrics are also proxies and do not capture every dimension of code quality, such as naming, architecture, or test coverage. The benchmark is narrow as well: SWE-EVO is Python-only, and we use a single agent harness, so broader and more diverse software-evolution benchmarks are needed. Finally, strict resolve rates are low across all models, so most of our interpretation rests on fractional utility and per-instance diagnostics, and per-model slop-on-solved estimates are noisy.

## 9 Reproducibility Statement

All reported numbers are computed from per-instance correctness and SonarQube measurements, and the model-balanced mid-90% and winsorized estimators used to aggregate them are defined in Section 4.4 and Appendix B. To allow the protocol to be reproduced, we report the exact SWE-EVO task list (Appendix C), the content of the cleanup and monitor prompts together with the monitor trigger signal (Appendix E), and the full SonarQube version, configuration, metric keys, and missing-analysis handling (Appendix F). Our code, the verbatim prompt text for every condition, and the per-instance measurements needed to regenerate all tables are available at [https://github.com/shubhamrgandhi/codeslop-colm-wab-2026](https://github.com/shubhamrgandhi/codeslop-colm-wab-2026).

## 10 Ethics Statement

This work studies the quality of AI-generated code, with the aim of improving the reliability and maintainability of software systems that incorporate AI-generated contributions. All experiments use publicly available open-source repositories, and we do not foresee direct negative societal impacts. Better artifact-quality evaluation may reduce downstream maintenance burden for human developers who collaborate with coding agents.

## References

- Agarwal et al. (2026) S. Agarwal, H. He, and B. Vasilescu AI IDEs or autonomous agents? measuring the impact of coding agents on software development. In Proceedings of the 23rd International Conference on Mining Software Repositories (MSR), [Document](https://dx.doi.org/10.1145/3793302.3793589)
- Campbell (2018) G. A. Campbell Cognitive complexity: an overview and evaluation. In Proceedings of the 2018 International Conference on Technical Debt (TechDebt), pp. 57–58.
- Cunningham (1992) W. Cunningham The WyCash portfolio management system. In Addendum to the Proceedings on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA),
- Fowler (1999) M. Fowler Refactoring: improving the design of existing code. Addison-Wesley.
- Gandhi et al. (2025) S. Gandhi, J. Tsay, J. Ganhotra, K. Kate, and Y. Rizk When agents go astray: course-correcting SWE agents with PRMs. arXiv preprint arXiv:2509.02360.
- Gandhi et al. (2026) S. Gandhi, Y. Xie, A. Naik, R. Zhu, and C. Rose Steer, don’t solve: training small critic models for large code agents. arXiv preprint arXiv:2606.21811.
- He et al. (2026) H. He, C. Miller, S. Agarwal, C. Kästner, and B. Vasilescu Speed at the cost of quality: how Cursor AI increases short-term velocity and long-term complexity in open-source projects. In Proceedings of the 23rd International Conference on Mining Software Repositories (MSR), [Document](https://dx.doi.org/10.1145/3793302.3793349)
- Jimenez et al. (2024) C. E. Jimenez, J. Yang, A. Wettig, S. Yao, K. Pei, O. Press, and K. Narasimhan SWE-bench: can language models resolve real-world GitHub issues?. In International Conference on Learning Representations (ICLR),
- Kruchten et al. (2012) P. Kruchten, R. L. Nord, and I. Ozkaya Technical debt: from metaphor to theory and practice. IEEE Software 29 (6), pp. 18–21.
- Le et al. (2025) T. Le, M. V. T. Thai, D. N. Manh, H. P. Nhat, and N. D. Q. Bui SWE-EVO: benchmarking coding agents in long-horizon software evolution scenarios. arXiv preprint arXiv:2512.18470.
- Lenarduzzi et al. (2023) V. Lenarduzzi, F. Pecorelli, N. Saarimaki, S. Lujan, and F. Palomba A critical comparison on six static analysis tools: detection, agreement, and precision. Journal of Systems and Software 198, pp. 111575. [Document](https://dx.doi.org/10.1016/j.jss.2022.111575)
- Letouzey (2012) J. Letouzey The SQALE method for evaluating technical debt. In Proceedings of the Third International Workshop on Managing Technical Debt (MTD),
- Lightman et al. (2023) H. Lightman, V. Kosaraju, Y. Burda, H. Edwards, B. Baker, T. Lee, J. Leike, J. Schulman, I. Sutskever, and K. Cobbe Let’s verify step by step. arXiv preprint arXiv:2305.20050.
- Pearce et al. (2022) H. Pearce, B. Ahmad, B. Tan, B. Dolan-Gavitt, and R. Karri Asleep at the keyboard? assessing the security of GitHub copilot’s code contributions. In 2022 IEEE Symposium on Security and Privacy (SP), pp. 754–768.
- Perry et al. (2023) N. Perry, M. Srivastava, D. Kumar, and D. Boneh Do users write more insecure code with AI assistants?. In Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security (CCS),
- Pomian et al. (2024) D. Pomian, A. Bellur, M. Dilhara, Z. Kurbatova, E. Bogomolov, T. Bryksin, and D. Dig Together we go further: LLMs and IDE static analysis for extract method refactoring. In Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering (ASE),
- SonarSource (2025) SonarSource Metric definitions, sonarqube server documentation. Note: [https://docs.sonarsource.com/sonarqube-server/user-guide/code-metrics/metrics-definition/](https://docs.sonarsource.com/sonarqube-server/user-guide/code-metrics/metrics-definition/) (accessed 2026)
- Tsantalis et al. (2018) N. Tsantalis, M. Mansouri, L. M. Eshkevari, D. Mazinanian, and D. Dig Accurate and efficient refactoring detection in commit history. In Proceedings of the 40th International Conference on Software Engineering (ICSE), pp. 483–494.
- Yang et al. (2024) J. Yang, C. E. Jimenez, A. Wettig, K. Lieret, S. Yao, K. Narasimhan, and O. Press SWE-agent: agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems,
- Ziegler et al. (2024) A. Ziegler, E. Kalliamvakou, X. A. Li, A. Rice, D. Rifkin, S. Simister, G. Sittampalam, and E. Aftandilian Measuring GitHub copilot’s impact on productivity. Communications of the ACM 67 (3), pp. 54–63.

## Appendix A Full Results Tables

This appendix gives the per-model breakdown behind the pooled numbers in Section 5, for all six policies. Tables 3 and 4 report the two functional metrics, strict resolve rate and fractional utility; the low Qwen3-Coder resolve rates visible in Table 3 are the reason the main slop analysis uses the all-instance rather than the solved-only view. Tables 5, 6, and 7 give the all-instance slop deltas for code volume, control-flow complexity, and maintainability debt respectively; Table 2 in the main text is the Base and Monitor subset of these three. The per-model pattern is the same on all three slop metrics: Claude Sonnet 4.6 is small and positive throughout, while the large reductions are concentrated in DeepSeek V3.2 and Qwen3-Coder 480B.

Table 3: Per-model strict resolve rate (%), mean over three seeds. Parenthetical arrows give the change relative to **Base** (higher is better), colored green for an improvement and red for a regression. Resolve is low for Qwen3-Coder 480B, which is why per-model slop-on-solved estimates are noisy and the main slop analysis uses the all-instance view.

| **Setting** | **Claude Sonnet 4.6** | **DeepSeek V3.2** | **Qwen3-Coder 480B** |
|---|---|---|---|
| Base | 22\.2 | 12\.7 | 5\.6 |
| One-shot | 11\.9 ($\downarrow$ 10.3) | 13\.5 ($\uparrow$ 0.8) | 2\.4 ($\downarrow$ 3.2) |
| Periodic-10 | 23\.0 ($\uparrow$ 0.8) | 19\.8 ($\uparrow$ 7.1) | 5\.6 (0.0) |
| Periodic-20 | 20\.6 ($\downarrow$ 1.6) | 14\.3 ($\uparrow$ 1.6) | 4\.0 ($\downarrow$ 1.6) |
| Periodic-30 | 17\.5 ($\downarrow$ 4.7) | 16\.7 ($\uparrow$ 4.0) | 1\.6 ($\downarrow$ 4.0) |
| Monitor | 16\.7 ($\downarrow$ 5.5) | 16\.7 ($\uparrow$ 4.0) | 7\.1 ($\uparrow$ 1.5) |

Table 4: Per-model fractional utility (%), mean over three seeds. Parenthetical arrows give the change relative to **Base** (higher is better), colored green for an improvement and red for a regression. Functional utility is preserved across policies for every model.

| **Setting** | **Claude Sonnet 4.6** | **DeepSeek V3.2** | **Qwen3-Coder 480B** |
|---|---|---|---|
| Base | 85\.4 | 70\.2 | 64\.0 |
| One-shot | 81\.7 ($\downarrow$ 3.7) | 76\.5 ($\uparrow$ 6.3) | 67\.7 ($\uparrow$ 3.7) |
| Periodic-10 | 88\.6 ($\uparrow$ 3.2) | 76\.0 ($\uparrow$ 5.8) | 57\.8 ($\downarrow$ 6.2) |
| Periodic-20 | 86\.3 ($\uparrow$ 0.9) | 76\.3 ($\uparrow$ 6.1) | 62\.8 ($\downarrow$ 1.2) |
| Periodic-30 | 86\.0 ($\uparrow$ 0.6) | 80\.6 ($\uparrow$ 10.4) | 59\.9 ($\downarrow$ 4.1) |
| Monitor | 84\.2 ($\downarrow$ 1.2) | 69\.6 ($\downarrow$ 0.6) | 58\.1 ($\downarrow$ 5.9) |

Table 5: Per-model all-instance code-volume delta ($\Delta\mathrm{LOC}$, raw mean), for all six policies. Negative values indicate net code-volume reduction. Parenthetical arrows give the change relative to **Base**, colored green for an improvement (leaner) and red for a regression. The reduction is concentrated in DeepSeek and Qwen3-Coder; Claude Sonnet 4.6 is small and positive throughout.

| **Setting** | **Claude Sonnet 4.6** | **DeepSeek V3.2** | **Qwen3-Coder 480B** |
|---|---|---|---|
| Base | $+22.1$ | $-126.5$ | $-280.2$ |
| One-shot | $+9.5$ ($\downarrow$ 12.6) | $-7.2$ ($\uparrow$ 119.3) | $-268.5$ ($\uparrow$ 11.7) |
| Periodic-10 | $+22.7$ ($\uparrow$ 0.6) | $-61.5$ ($\uparrow$ 65.0) | $-463.7$ ($\downarrow$ 183.5) |
| Periodic-20 | $+27.5$ ($\uparrow$ 5.4) | $-696.1$ ($\downarrow$ 569.6) | $-425.0$ ($\downarrow$ 144.8) |
| Periodic-30 | $+21.9$ ($\downarrow$ 0.2) | $-38.4$ ($\uparrow$ 88.1) | $-400.0$ ($\downarrow$ 119.8) |
| Monitor | $+28.7$ ($\uparrow$ 6.6) | $-683.4$ ($\downarrow$ 556.9) | $-1211.5$ ($\downarrow$ 931.3) |

Table 6: Per-model all-instance control-flow-complexity delta ($\Delta\mathrm{Cog}$, raw mean), for all six policies. Parenthetical arrows give the change relative to **Base**, colored green for an improvement (leaner) and red for a regression. The pattern mirrors code volume: Claude is small and positive; the large reductions are in DeepSeek and Qwen3-Coder.

| **Setting** | **Claude Sonnet 4.6** | **DeepSeek V3.2** | **Qwen3-Coder 480B** |
|---|---|---|---|
| Base | $+7.3$ | $-26.4$ | $-52.6$ |
| One-shot | $+3.9$ ($\downarrow$ 3.4) | $+0.1$ ($\uparrow$ 26.5) | $-53.1$ ($\downarrow$ 0.5) |
| Periodic-10 | $+7.8$ ($\uparrow$ 0.5) | $-10.7$ ($\uparrow$ 15.7) | $-99.8$ ($\downarrow$ 47.2) |
| Periodic-20 | $+8.5$ ($\uparrow$ 1.2) | $-29.1$ ($\downarrow$ 2.7) | $-89.3$ ($\downarrow$ 36.7) |
| Periodic-30 | $+6.1$ ($\downarrow$ 1.2) | $-1.0$ ($\uparrow$ 25.4) | $-84.1$ ($\downarrow$ 31.5) |
| Monitor | $+8.5$ ($\uparrow$ 1.2) | $-64.5$ ($\downarrow$ 38.1) | $-208.3$ ($\downarrow$ 155.7) |

Table 7: Per-model all-instance maintainability-debt delta ($\Delta\mathrm{Rem}$, raw mean), for all six policies. Parenthetical arrows give the change relative to **Base**, colored green for an improvement (leaner) and red for a regression. Debt changes least of the three metrics; reductions are concentrated in the weaker models, and Claude is small and positive throughout.

| **Setting** | **Claude Sonnet 4.6** | **DeepSeek V3.2** | **Qwen3-Coder 480B** |
|---|---|---|---|
| Base | $+4.3$ | $-0.2$ | $-21.7$ |
| One-shot | $+3.5$ ($\downarrow$ 0.8) | $+0.2$ ($\uparrow$ 0.4) | $-21.7$ (0.0) |
| Periodic-10 | $+5.0$ ($\uparrow$ 0.7) | $-2.4$ ($\downarrow$ 2.2) | $-41.3$ ($\downarrow$ 19.6) |
| Periodic-20 | $+4.9$ ($\uparrow$ 0.6) | $-58.4$ ($\downarrow$ 58.2) | $-33.3$ ($\downarrow$ 11.6) |
| Periodic-30 | $+3.7$ ($\downarrow$ 0.6) | $-3.1$ ($\downarrow$ 2.9) | $-30.3$ ($\downarrow$ 8.6) |
| Monitor | $+4.9$ ($\uparrow$ 0.6) | $-61.5$ ($\downarrow$ 61.3) | $-132.6$ ($\downarrow$ 110.9) |

## Appendix B Estimator Robustness

Table 8 reports the model-balanced all-instance code-volume delta under the raw mean and under symmetric winsorizing at several caps; Tables 9 and 10 repeat the exercise for control-flow complexity and maintainability debt. At every cap and on all three metrics, Base and One-shot show less reduction than Monitor and Periodic-10. (Periodic-20 and Periodic-30 are closer to Base and cross it at intermediate caps, so the full six-way ordering changes with the cap; the contrast between trajectory-time cleanup and no cleanup does not.) Debt is the smallest-magnitude metric and its margins are correspondingly narrow, but its direction agrees.

Table 8: All-instance code-volume delta ($\Delta\mathrm{LOC}$), model-balanced, under symmetric winsorizing at cap $c$ (each run’s delta clipped to $[-c,c]$ before averaging). “$\infty$” is the raw mean. Parenthetical arrows give the change relative to **Base** at the same cap, colored green for an improvement (leaner) and red for a regression. Base and One-shot show less reduction than Monitor and Periodic-10 at every cap.

| **Setting** | $c=\infty$ | $c=2000$ | $c=1000$ | $c=500$ | $c=200$ |
|---|---|---|---|---|---|
| Base | $-128.2$ | $-67.4$ | $-37.2$ | $-16.2$ | $+5.2$ |
| One-shot | $-88.8$ ($\uparrow$ 39.4) | $-46.2$ ($\uparrow$ 21.2) | $-30.7$ ($\uparrow$ 6.5) | $-18.0$ ($\downarrow$ 1.8) | $-5.6$ ($\downarrow$ 10.8) |
| Periodic-10 | $-167.7$ ($\downarrow$ 39.5) | $-83.0$ ($\downarrow$ 15.6) | $-49.6$ ($\downarrow$ 12.4) | $-26.7$ ($\downarrow$ 10.5) | $-6.4$ ($\downarrow$ 11.6) |
| Periodic-20 | $-360.4$ ($\downarrow$ 232.2) | $-62.8$ ($\uparrow$ 4.6) | $-37.4$ ($\downarrow$ 0.2) | $-18.8$ ($\downarrow$ 2.6) | $-3.5$ ($\downarrow$ 8.7) |
| Periodic-30 | $-138.8$ ($\downarrow$ 10.6) | $-69.5$ ($\downarrow$ 2.1) | $-38.5$ ($\downarrow$ 1.3) | $-18.4$ ($\downarrow$ 2.2) | $-2.7$ ($\downarrow$ 7.9) |
| Monitor | $-624.6$ ($\downarrow$ 496.4) | $-118.7$ ($\downarrow$ 51.3) | $-72.3$ ($\downarrow$ 35.1) | $-39.5$ ($\downarrow$ 23.3) | $-12.1$ ($\downarrow$ 17.3) |

Table 9: All-instance control-flow-complexity delta ($\Delta\mathrm{Cog}$), model-balanced, under symmetric winsorizing. Parenthetical arrows give the change relative to **Base** at the same cap, colored green for an improvement (leaner) and red for a regression. The same comparison holds: Base and One-shot reduce less than Monitor and Periodic-10 at every cap.

| **Setting** | $c=\infty$ | $c=2000$ | $c=1000$ | $c=500$ | $c=200$ |
|---|---|---|---|---|---|
| Base | $-23.9$ | $-23.9$ | $-19.2$ | $-12.2$ | $-4.1$ |
| One-shot | $-16.3$ ($\uparrow$ 7.6) | $-16.3$ ($\uparrow$ 7.6) | $-12.5$ ($\uparrow$ 6.7) | $-7.9$ ($\uparrow$ 4.3) | $-3.6$ ($\uparrow$ 0.5) |
| Periodic-10 | $-34.3$ ($\downarrow$ 10.4) | $-34.3$ ($\downarrow$ 10.4) | $-28.4$ ($\downarrow$ 9.2) | $-17.8$ ($\downarrow$ 5.6) | $-7.5$ ($\downarrow$ 3.4) |
| Periodic-20 | $-36.5$ ($\downarrow$ 12.6) | $-36.5$ ($\downarrow$ 12.6) | $-25.4$ ($\downarrow$ 6.2) | $-13.2$ ($\downarrow$ 1.0) | $-4.7$ ($\downarrow$ 0.6) |
| Periodic-30 | $-26.3$ ($\downarrow$ 2.4) | $-26.3$ ($\downarrow$ 2.4) | $-21.9$ ($\downarrow$ 2.7) | $-14.0$ ($\downarrow$ 1.8) | $-5.9$ ($\downarrow$ 1.8) |
| Monitor | $-88.8$ ($\downarrow$ 64.9) | $-53.7$ ($\downarrow$ 29.8) | $-40.7$ ($\downarrow$ 21.5) | $-24.0$ ($\downarrow$ 11.8) | $-10.8$ ($\downarrow$ 6.7) |

Table 10: All-instance maintainability-debt delta ($\Delta\mathrm{Rem}$), model-balanced, under symmetric winsorizing. Parenthetical arrows give the change relative to **Base** at the same cap, colored green for an improvement (leaner) and red for a regression. Debt is the smallest-magnitude metric; the periodic schedules and Monitor reduce more than Base and One-shot at most caps, though the margins are narrow.

| **Setting** | $c=\infty$ | $c=2000$ | $c=1000$ | $c=500$ | $c=200$ |
|---|---|---|---|---|---|
| Base | $-5.9$ | $-5.9$ | $-8.4$ | $-8.6$ | $-4.4$ |
| One-shot | $-6.0$ ($\downarrow$ 0.1) | $-6.0$ ($\downarrow$ 0.1) | $-6.0$ ($\uparrow$ 2.4) | $-4.9$ ($\uparrow$ 3.7) | $-2.0$ ($\uparrow$ 2.4) |
| Periodic-10 | $-12.9$ ($\downarrow$ 7.0) | $-12.9$ ($\downarrow$ 7.0) | $-12.9$ ($\downarrow$ 4.5) | $-11.7$ ($\downarrow$ 3.1) | $-5.2$ ($\downarrow$ 0.8) |
| Periodic-20 | $-28.5$ ($\downarrow$ 22.6) | $-19.8$ ($\downarrow$ 13.9) | $-14.3$ ($\downarrow$ 5.9) | $-9.7$ ($\downarrow$ 1.1) | $-3.2$ ($\uparrow$ 1.2) |
| Periodic-30 | $-9.9$ ($\downarrow$ 4.0) | $-9.9$ ($\downarrow$ 4.0) | $-9.9$ ($\downarrow$ 1.5) | $-9.3$ ($\downarrow$ 0.7) | $-4.4$ (0.0) |
| Monitor | $-63.4$ ($\downarrow$ 57.5) | $-26.9$ ($\downarrow$ 21.0) | $-21.4$ ($\downarrow$ 13.0) | $-17.4$ ($\downarrow$ 8.8) | $-8.1$ ($\downarrow$ 3.7) |

## Appendix C SWE-EVO Task List

Table 11 lists the exact SWE-EVO instances used in all of our experiments. Each identifier encodes the repository together with the source and target release versions of the transition the agent must implement.

Table 11: The SWE-EVO instances evaluated.

| \# | Instance ID | \# | Instance ID |
|---|---|---|---|
| 1 | `conan-io__conan_2.0.14_2.0.15` | 22 | `iterative__dvc_1.1.7_1.1.8` |
| 2 | `conan-io__conan_2.0.2_2.0.3` | 23 | `iterative__dvc_1.10.2_1.11.0` |
| 3 | `dask__dask_2022.9.2_2022.10.0` | 24 | `iterative__dvc_1.11.12_1.11.13` |
| 4 | `dask__dask_2023.3.2_2023.4.0` | 25 | `iterative__dvc_1.6.3_1.6.4` |
| 5 | `dask__dask_2023.6.0_2023.6.1` | 26 | `iterative__dvc_2.19.0_2.20.0` |
| 6 | `dask__dask_2023.6.1_2023.7.0` | 27 | `iterative__dvc_2.21.1_2.21.2` |
| 7 | `dask__dask_2023.8.0_2023.8.1` | 28 | `iterative__dvc_2.5.0_2.5.1` |
| 8 | `dask__dask_2023.9.2_2023.9.3` | 29 | `iterative__dvc_2.58.1_2.58.2` |
| 9 | `dask__dask_2024.1.0_2024.1.1` | 30 | `iterative__dvc_2.7.2_2.7.3` |
| 10 | `dask__dask_2024.3.1_2024.4.0` | 31 | `iterative__dvc_2.8.1_2.8.2` |
| 11 | `iterative__dvc_0.30.0_0.30.1` | 32 | `iterative__dvc_3.12.0_3.13.0` |
| 12 | `iterative__dvc_0.33.1_0.34.0` | 33 | `iterative__dvc_3.13.3_3.14.0` |
| 13 | `iterative__dvc_0.35.3_0.35.4` | 34 | `iterative__dvc_3.15.0_3.15.1` |
| 14 | `iterative__dvc_0.52.1_0.53.1` | 35 | `iterative__dvc_3.4.0_3.5.0` |
| 15 | `iterative__dvc_0.89.0_0.90.0` | 36 | `iterative__dvc_3.43.1_3.44.0` |
| 16 | `iterative__dvc_0.91.2_0.91.3` | 37 | `modin-project__modin_0.24.0_0.24.1` |
| 17 | `iterative__dvc_0.92.0_0.92.1` | 38 | `modin-project__modin_0.25.0_0.25.1` |
| 18 | `iterative__dvc_1.0.0a1_1.0.0a2` | 39 | `modin-project__modin_0.27.0_0.27.1` |
| 19 | `iterative__dvc_1.0.0b6_1.0.0` | 40 | `pydantic__pydantic_v2.6.0b1_v2.6.0` |
| 20 | `iterative__dvc_1.0.1_1.0.2` | 41 | `pydantic__pydantic_v2.7.0_v2.7.1` |
| 21 | `iterative__dvc_1.1.0_1.1.1` | 42 | `pydantic__pydantic_v2.7.1_v2.7.2` |

## Appendix D Harness Details

This appendix records the operational details of the agent harness omitted from Section 4.

**Action loop.**

At each step the agent emits a free-form thought followed by exactly one `bash` command in a single code block; the harness runs that command in a fresh subshell inside the task container and returns the combined stdout/stderr and return code as the next observation. The agent interacts entirely through shell commands (e.g. `sed`, `cat`, `nl`, here-documents); there are no bespoke editing or navigation tools. The working directory is the task repository at `/testbed`, and the system prompt instructs the agent to modify only non-test source files, leaving tests and build configuration untouched.

**Budget and stopping criteria.**

Each run is capped at a $100$-step budget (one model call and one command execution per step), and a step-budget warning is injected at step $80$ urging the agent to submit whatever partial fix it has. A trajectory terminates in one of two ways: the agent submits, issuing a sentinel command (`echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT && git add -A && git diff --cached`) whose first output line signals completion, or it exhausts the step budget, in which case the current working-tree diff is taken as the final patch. The submitted (or final) `git` diff against the initial commit is the artifact we evaluate.

**Decoding.**

We use each model through the same harness with greedy decoding (temperature $0$, max $2048$ output tokens per step).

**Monitor trigger guards.**

When the Monitor condition (Section 4.3) answers `YES`, cleanup is invoked subject to two guards that suppress wasted passes: we skip if any of the last three steps ended in an execution or format error (the agent is mid-recovery, hence mid-subtask), and we skip if the diff is unchanged since the previous cleanup (there is nothing new to clean).

**Agent prompts.**

All three models use the same base-agent prompts. The system prompt specifies the response format (a thought section followed by exactly one `bash` code block containing a single command, with multi-command actions joined by `&&` or `||`) and states the submission discipline: the agent operates under a strict step budget, a partial fix submitted is better than none, and a step-budget warning should be treated as an instruction to submit immediately. The instance prompt supplies the SWE-EVO task description, sets the working directory to `/testbed`, restricts edits to non-test source files (tests and build configuration are off limits), sketches a reproduce–edit–verify workflow, restates the one-command-per-response contract with worked positive and negative examples, notes that each command runs in a fresh subshell so directory and environment changes do not persist, and gives the sentinel submission command. Full prompt text, including the exact wording and the template variables substituted at run time, is in the code release ([https://github.com/shubhamrgandhi/codeslop-colm-wab-2026](https://github.com/shubhamrgandhi/codeslop-colm-wab-2026)).

## Appendix E Cleanup and Monitor Prompts

All cleanup conditions (One-shot, Periodic-$N$, and Monitor) invoke the *same* cleanup operation: a fresh sub-agent run with a $50$-step budget and a \$$7.5$ cost cap. The conditions differ only in *when* this operation fires: once after the trajectory completes (One-shot), every $N$ steps and at the end (Periodic-$N$), or when the trajectory monitor signals a natural breakpoint (Monitor). Verbatim prompt text for both the cleanup sub-agent and the monitor trigger is in the code release ([https://github.com/shubhamrgandhi/codeslop-colm-wab-2026](https://github.com/shubhamrgandhi/codeslop-colm-wab-2026)); we summarize the prompts here.

**Cleanup sub-agent.**

The system prompt casts the sub-agent as a code-simplification specialist whose edits must preserve behavior exactly, and directs it to reduce unnecessary complexity and nesting, remove redundant code and abstractions, improve naming, and drop comments that merely restate the code, while warning against over-simplification that harms clarity (dense one-liners, nested ternaries, collapsing unrelated concerns, removing useful abstractions). It also requires the same one-command-per-response format as the base agent.

The instance prompt supplies the problem statement, the patch produced by the base agent, and the base agent’s trajectory (so the sub-agent can tell intentional fix code from incidental exploration artifacts), along with whether the patch applied cleanly to `/testbed`. It directs the sub-agent to remove five categories of bloat: reproduction and debug scripts the agent created, formatting-only changes unrelated to the fix, patch-tool artifacts such as `.rej` files, clearly temporary debug prints or logging, and duplicate or near-duplicate files. Small clarity improvements to the fix code itself are permitted; the stated goal is a cleaner patch, not necessarily a smaller one.

Four constraints keep the operation a cleanup and stop it from becoming a second attempt at the task: do not rewrite the patch or add fix logic the original agent did not produce, do not alter fix logic (keep anything whose role is unclear), do not touch files the original patch did not touch (except to delete bloat files the agent itself created), and do not delete code en masse. If the patch is already clean, the sub-agent submits it unchanged.

**Monitor trigger.**

The monitor is queried at each agent step with the problem statement, the recent trajectory, and the current diff, and is asked whether the agent has just completed a meaningful subtask and is at a natural breakpoint, such that a cleanup pass would not interrupt mid-subtask work. It is constrained to answer exactly `YES` or `NO`, and cleanup fires on `YES` subject to the two guards in Appendix D.

## Appendix F SonarQube Configuration

**Analyzer and profile.**

All slop metrics are computed with **SonarQube Community Build 25.9.0.112764**, using the bundled Python analyzer (`sonar-python` 5.8.0.24785) driven by **SonarScanner CLI 6.2.1.4610**. Analysis runs in SonarQube’s multi-quality-rule (MQR, “clean code”) mode, the default in the 2025 releases. We use the analyzer’s default *Sonar way* quality profile for Python with no rule customization: the scanner is invoked with only `sonar.sources=.`, `sonar.scm.disabled=true`, and a fixed project version, so the enabled-rule set is exactly the stock Python profile shipped with this build and language detection is automatic. To process the full matrix (six policies $\times$ three models $\times$ three seeds $\times$ 42 tasks, each scanned twice) we run identical SonarQube instances in parallel and round-robin the (policy, model) groups across them; the instances are interchangeable and do not affect the measurements.

**Before/after measurement.**

For each (policy, model, task) we run two analyses, each over the *whole repository* rather than only the diff. We check out the task’s base commit and analyze the entire repository tree (the *before* state), then apply the agent’s submitted patch (`model_patch`) on top of that tree and analyze the entire repository again (the *after* state). The reported value for each metric is the signed change $\Delta m=m_{\text{after}}-m_{\text{before}}$. Because every condition starts from the same base commit, the *before* measurement is identical across policies, models, and seeds for a given (repository, base commit), so the differences we report come entirely from the *after* state.

**Metric keys.**

The three slop metrics are the following SonarQube measures, queried through the `api/measures/component` endpoint: code volume $\Delta\mathrm{LOC}$ is `ncloc` (non-comment lines of code); control-flow complexity $\Delta\mathrm{Cog}$ is `cognitive_complexity`; and maintainability debt $\Delta\mathrm{Rem}$ is `software_quality_maintainability_remediation_effort`, the MQR-mode maintainability remediation effort in minutes (the estimated time to fix all detected maintainability/code-smell issues, i.e. the clean-code-mode analog of the legacy `sqale_index` technical-debt metric). The official definitions of all three measures are given in SonarQube’s metric documentation (SonarSource, 2025).

**Patch application and missing analyses.**

Patches are applied with `git apply`, falling back to `git apply --reject` and then `patch -p1`; if all three fail, the *after* scan still runs on the partially applied tree. A metric’s delta is recorded only when both the before and after analyses return a numeric value for that metric; otherwise the entry is left missing and is dropped per metric from all downstream averages, never imputed as zero. Across the $2268$ (policy, model, seed, task) repository pairs in the six policies, $29$ ($1.3\%$) lack slop metrics: for $3$ the analyzer did not produce an analysis row, and for $26$ it did not return any measures for the repository state (when a pair is missing, it is missing all three metrics together rather than an individual one). All slop statistics in Section 5 are computed over the remaining pairs.

[^1]: Model documentation: [https://www.anthropic.com/claude/sonnet](https://www.anthropic.com/claude/sonnet); [https://huggingface.co/deepseek-ai/DeepSeek-V3.2](https://huggingface.co/deepseek-ai/DeepSeek-V3.2); [https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct](https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct).
