Harness Hub
All papers

How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches

Aakash Goel, Benjamin Steenhoek, Yu Hu

Verdict: Incremental

The test-vs-code split and the debug-step negative result are worth knowing, but the abstract's two action lines—agents match developers on code necessity, and harness pruning should remove over-edits—do not survive Appendix C.1 or Table 1, and both rest on one closed harness and a weak oracle.

  • Novelty

    3 out of 5
  • Rigor

    2 out of 5
  • Reproducibility

    2 out of 5
  • Relevance to harnesses

    4 out of 5

TL;DR

DRA traces blocks in 7,660 resolved Copilot CLI patches. On SWE-bench Verified the extra lines are mostly tests, but the abstract's agent-vs-developer necessity claim flips under the paper's own stronger oracle, and the recommended prune has 46.3% precision on a selected subset.

Adversarial review by Harness Hub · Nov 28, 2026 · read full text (truncated) · Suggest a correction

Original abstract (authors’ text, select to expand)

Agent patches are larger than developers', which is widely read as over-editing. But patch size does not say whether the extra edits are needed, what they are, or where they come from. We introduce Delta Residue Attribution (DRA), which replays agent trajectories, traces every block (unit) of the final patch to the step that wrote it, reverts each unit, and reruns the task tests to decide whether the unit is needed. We apply DRA to 7,660 resolved GitHub Copilot CLI trajectories from 18 frontier models on SWE-bench Verified (6,728) and DeepSWE (932), and grade developer patches using the same method. Agent patches do change more lines than developers'; on SWE-bench Verified the majority of extra edits add tests (61%) and documentation (13%) while on DeepSWE, most extra edits are code (58%). On both benchmarks, agents' code is on average at least as necessary as developers' (mean $NP_{code}$ 0.887 vs. 0.864 on SWE-bench Verified, where 11 of 18 models leave less unneeded code than developers, and 0.797 vs. 0.785 on DeepSWE). On average, 11% of an agent patch's code units on SWE-bench Verified are still unneeded, and 89% of those change behavior. Debug steps write almost none of the unneeded code. Code necessity differs substantially by model; it is unrelated to resolve rate on SWE-bench Verified and negatively correlated with it on DeepSWE (Spearman -0.59, p = 0.01). On SWE-bench Verified, pruning with DRA using only the tests the agent can see (its own tests and the repository's) removes the majority of unneeded code but also some needed code (67% recall, 46% precision), and 89% of pruned patches still resolve the task; asking the agent to audit its own diff is more precise but less effective (36% recall, 66% precision). We recommend that benchmarks report code necessity next to resolve rate and that over-editing be addressed through model training and harness-level pruning.

Filed underharnessevaluationcoding-agentsagents

Summary

Delta Residue Attribution replays a resolved trajectory, splits the final patch into revertible line blocks, blames each block on the last step that wrote it, and marks a unit needed if reverting it fails the task tests. On 6,728 SWE-bench Verified and 932 DeepSWE resolved GitHub Copilot CLI patches, agents change more lines than developers, but on SWE-bench Verified extra edits are 61% tests and 13% documentation. Under task tests, mean NP_code is 0.887 vs 0.864 for developers, with 11% of agent code units still unneeded. That comparison reverses under the strengthened oracle. Debug steps write almost none of the code residue. Table 1 pruning with tests the agent can see is only run on 2,495 patches and drops units at 46.3% precision.

Key findings

  • Abstract and Section 5.1: mean NP_code 0.887 vs 0.864 on SWE-bench Verified (11 of 18 models less unneeded code than developers under the task-test oracle) and 0.797 vs 0.785 on DeepSWE; the paired DeepSWE mean gap in Section 5.1 is -0.005, with no model significantly above developers.
  • Section 5.2 and Figure 3: SWE-bench Verified extra edits are 61% tests, 21% code, 13% documentation; DeepSWE extra edits are 58% code. Of 3,987 unneeded code units, probes on 3,559 find 89% change behavior (Appendix C.1: 3,151 of 3,559, 88.5%).
  • Section 5.3: debug steps write 154 of 3,987 unneeded code units (ρ_code=0.039); fix steps write 83%. Pooled residue debug share is ρ=0.257, mostly test hunks.
  • Section 5.4: NP_code vs resolve rate Spearman -0.10 on SWE-bench Verified (p=0.69; 95% CI [-0.28, +0.05]) and -0.59 on DeepSWE (p=0.01).
  • Table 1, Section 5.5: on 2,495 of 6,724 patches, DRA with the agent's tests plus PASS_TO_PASS has 67.3% recall and 46.3% precision; 89.1% of those pruned patches still resolve. Self-audit is 35.5% recall and 65.7% precision. Early stop moves NP_code only from 0.700 to 0.710.
  • Appendix C.1: under O+, developer NP_code rises from 0.864 to 0.970 and agent mean from 0.887 to 0.925, flipping the gap from +2.3 to -4.5 percentage points; O+ puts 12 models below developers and none above.

The paper at a glance

01Replay edit andcreate calls withline-level blameafter every step02Split the submittedpatch intorevertible unitsand attribute eachto the latest…03Label that stepdebug, fix, orcleanup with rulesplus an LLM judge04Revert each unitalone and reruntask tests to markit needed orunneeded
  1. Replay edit and create calls with line-level blame after every step
  2. Split the submitted patch into revertible units and attribute each to the latest writing step
  3. Label that step debug, fix, or cleanup with rules plus an LLM judge
  4. Revert each unit alone and rerun task tests to mark it needed or unneeded
Fig. 1 — How the paper works, step by step (arXiv:2611.34875).
Self-audit65.7%DRA + agent tests (this paper)39.6%DRA + agent tests + P2P (this paper)46.3%
Fig. 2 — Precision of dropped code units, higher is better. Source: Table 1 (SWE-bench Verified, oracle O+), arXiv:2611.34875.
Data table
Precision of dropped code units
Method%
Self-audit65.7%
DRA + agent tests (this paper)39.6%
DRA + agent tests + P2P (this paper)46.3%

Why it matters

This paper is relevant to harness builders who edit repositories and clean diffs after a coding loop, but it is not a recipe they should ship. On Copilot CLI, SWE-bench Verified extra edits are mostly tests (61%) and documentation (13%), and debug steps account for only 154 of 3,987 unneeded code units, so stripping debug prints will not debloat the patch. The abstract then asks builders to report code necessity beside resolve rate and to prune in the harness. Those recommendations are not supported as stated: agent code looks as necessary as developer code only under hidden task tests, that gap reverses under the paper's strengthened oracle, and Table 1 pruning keeps 89.1% of eligible patches resolving at 46.3% precision on 2,495 of 6,724 patches from one harness.

Issues (5)

  • High severity

    The abstract says agent code is on average at least as necessary as developers' (NP_code 0.887 vs 0.864 on SWE-bench Verified; 0.797 vs 0.785 on DeepSWE) and that 11 of 18 models leave less unneeded code than developers. Appendix C.1 shows that under O+, which treats developer-equivalent untested edits as needed, the SWE-bench Verified gap flips from +2.3 to -4.5 percentage points (developer NP_code 0.970 vs agent 0.925), with 12 of 18 models below developers and none above. The 11-of-18 count includes GPT-6 Astra, whose CI lower bound is 0.002. On DeepSWE the paired mean gap is -0.005 and no model is significantly above developers, so 0.797 vs 0.785 is not a demonstrated agent advantage. The task-test oracle calls 33% of developer code units unneeded (434 of 1,317); O+ reclassifies 84% of probed test-unneeded developer code units (363 of 432) vs 35% of agent units (1,263 of 3,559). The headline comparison is an artifact of the weak oracle.

  • High severity

    The abstract says 11% of agent code units are still unneeded and 89% of those change behavior, which Section 6 uses to say reviewers cannot skip the residue. That 11% is the task-test upper bound the authors themselves describe in Section 3.1, not excess under O+. Of 3,559 probed test-unneeded agent units, 1,263 (35.5%) behave like the developer patch and are needed under O+, 1,586 (44.6%) are unrequested changes, and 408 (11.5%) are inert. The 89% behavior-change rate is also judge-sensitive: on 388 units, Opus 5.5 finds 81% changing behavior and GPT-6.1 Sol 89% (κ=0.53). Both the role judge and the probe judge are GPT-6.1 Sol, an evaluated model; Appendix B.5 notes both human-protocol judge models are in the evaluated pool. There is no human audit of roles (Appendix B.4: 84.4% agreement, κ=0.69; debug vs non-debug 89.1%, κ=0.55).

  • High severity

    The abstract says DRA pruning using only tests the agent can see removes the majority of unneeded code but also some needed code (67% recall, 46% precision) and that 89% of pruned patches still resolve. Table 1's figures, which the abstract rounds, are 67.3% recall and 46.3% precision under O+, so most dropped units are not unneeded; 'some needed code' understates that. The result covers 2,495 of 6,724 patches, not all 6,728, and that subset already has NP_code 0.936 before pruning. Self-audit in the same table is 35.5% recall and 65.7% precision. Early stopping, omitted from the abstract, barely moves NP_code (0.700 to 0.710) on a different population (3,031 patches) whose before-score is not the 0.887 mean. Registered harness and prompt interventions H4 and H5 were not run.

  • High severity

    The abstract speaks of coding agents, benchmarks, and harness-level pruning, but the main results are one harness (GitHub Copilot CLI) and resolved patches only. Section 6 says SWE-bench Verified may be contaminated; contamination would push agents toward developer-like patches and inflate the necessity comparison. 3.3% of SWE-bench Verified replays are not exact, and 33.4% of DeepSWE patches (311 of 932) lack provenance for at least one unit. Necessity is single-unit 1-minimality (Section 3.1, Section 6). Pre-registered human should-remove labels were not collected (Appendix A.1 H3; Appendix B.5). Section 6: the unneeded flag predicts outside-patch units at precision 0.43 (AUROC 0.718 vs 0.478 for unit size). Appendix B.3 counts non-applying or hung reversions as needed (742 base-state, 39 non-parsing, 22 hung), which inflates NP.

  • Medium severity

    The abstract states that debug steps write almost none of the unneeded code. That uses ρ_code=0.039 (154 of 3,987), not the pre-registered all-unit ρ. Appendix A.1 Table 3 says pooled ρ=0.257 sits between the kill threshold 0.15 and the support threshold 0.40, and that the code conclusion rests on switching to ρ_code. The registered plan also specified statement-level AST units; the study used contiguous line blocks (Appendix A.2).

Questions for the authors

  • If O+ is the primary metric, does any of the 18 models still beat the developer NP_code baseline?
  • What share of the Table 1 false drops would a reviewer keep, given that human should-remove labels were never collected?
  • Does the 83% fix-step share of unneeded code replicate on OpenHands or mini-SWE-agent, or is it specific to Copilot CLI edit tools?
  • How many of the 742 base-state reversions counted as needed are code units, and does excluding them change the 0.887 vs 0.864 gap?

Related in the directory

Open-source projects

Sole harness for the 7,660 main trajectories; other harnesses are final-patch NP only.
Primary benchmark; FAIL_TO_PASS and PASS_TO_PASS are the necessity oracle for 6,728 patches.
Cited trajectory work that Section 2 says does not attribute patch blocks to steps.
Named as a rerun target; Section 6 says those public trajectories were not used for role attribution.
Appendix A.2 records final-patch NP on other harnesses and defers role analysis here.

Commercial products

Commercial coding agent whose CLI produced every primary resolved patch in the study.

People

OpenHands (Wang et al., 2025) is the harness paper DRA cites and leaves for future replication.

More tools on the same problem

Products and open-source projects in the directory closest in meaning to this paper.

The deterministic engine for agents to make estate-wide code changes.
A Git forge for agent-human collaboration that versions the reasoning behind code.
Alibaba's hybrid deterministic-plus-agent code review CLI.
LangChain's open-source asynchronous coding agent, from issue to pull request.
Open-source meta-harness that enforces review gates and repair loops for coding agents.
MCP of evidence-graded fix lessons for coding agents

During iterative code modification, coding agents may continue to rely in subsequent reasoning on outdated dependency judgments whose text remains fixed in the context, leading to errors in subsequent reasoning and leaving consumer defects undetected by the original task evaluations, thereby exposing blind spots in the tested benchmarks. We study actual agent execution trajectories collected on benchmark tasks: deepseek-v4-flash runs on DeepSWE and SWE-bench Verified, supplemented by Qwen3.8-Flash cases on FeatureBench. Focusing on edit-induced consumer obligations, a full-corpus blinded human audit of the DeepSWE runs identifies terminal mismatches, including diagnoses whose task scope remains disputed. Following supplementary execution checks, all retained DeepSWE terminal events have execution support. The audit also shows that recovery within a trajectory can coexist with terminal omissions in the same run. The process analysis links the presentation of relevant consumer code to explicit dependency judgments and subsequent synchronization actions recorded in the trajectories. An explicit dependency-review prompt reduces terminal omissions under the tested conditions, supporting re-derivation of consumer obligations after edits. Local replays of selected DeepSWE cases show that synchronizing the diagnosed consumers restores the target behavior while the listed controls continue to pass. Cross-benchmark execution counterexamples show that the original task evaluations do not fully detect edit-induced dependency mismatches: patches pass those evaluations, yet additional execution checks confirm unintended defects along existing consumer paths. These findings support measuring task scores, terminal propagation states, and recovery separately.

Fei Ding

Repository-level coding benchmarks largely assume that tasks and environments remain unchanged throughout execution. In software development, code, dependencies, runtime state, and requirements can change while an agent is still working. We introduce SWE-Shift, a benchmark for evaluating coding agents under such mid-execution changes. From the same saved history and workspace, a Clean continuation proceeds without intervention, while a matched Shifted continuation receives a task-relevant update. Success requires completing the current task, preserving still-valid work, and satisfying the applicable state and evidence checks. The benchmark contains 120 scenarios across 12 change families, each evaluated at nine scheduled intervention positions. We evaluate 17 coding-agent systems, all of which have lower Shifted than Clean success. GPT-6 Astra drops from 67.35% to 24.79%, with 20.34% paired success. Tool/session changes and stale evidence yield zero paired success across all systems. Late-position paired success is lower for some systems and higher for others. These results show that success on the unchanged task can coexist with failures to preserve work, recover state, or refresh evidence after an update.

Victor Shea-Jay Huang, Rongqing Li +8

Coding agents often continue working after their own tests pass. Does this additional work improve the patch, and how much could be saved by stopping earlier? We study these questions through anytime evaluation: replaying recorded runs, scoring intermediate patches with hidden tests, and measuring the cost incurred at each step. For policies that only stop a run or select an earlier patch, this allows paired comparisons without generating new trajectories, provided replay preserves the relevant states. Across about 6,000 runs of eight open models in two scaffolds on SWE-bench Verified, we find substantial differences in the value of continued work. The hindsight saving available at passing self-tests ranges from under 1% to 57%, depending on the model and scaffold. A rule that stops after the same patch passes twice saves 23% in a preregistered replication, but the preregistered quality test does not establish non-inferiority. We explain these differences by measuring how often a rule fires, how often the patch changes afterwards, and whether those changes repair or break it. Fine-tuning agents to imitate the rule saves 30% over six seeds, while quality preservation remains uncertain. Our results help identify both the opportunities and the risks of early stopping.

Zerui Yang, Quan Xue +10

Pull requests written by coding agents can pass a project's test suite while omitting a guard or a validation step. To find the missing condition, a reviewer currently relies on static analysis of the final code. An agent-generated change, however, is accompanied by a development history that a human commit does not provide. The agent's trajectory records each edit together with the agent's stated assumptions, and structural differencing shows how each changed function evolved. We present TRACER, a workflow that uses this development history as evidence for security review. TRACER tracks changes at the symbol level, treats the agent's recorded rationale as claims to be verified against the current code, accepts a repair only after assessment and functional validation, and attaches to each accepted repair an executable check that later changes must satisfy. On the SusVibes benchmark, symbol-level tracking places the vulnerable symbol in the review scope for 94.6% of agent patches, compared with 13.4% for the primary scanner warning. With two investigator models, the configuration that includes the agent's rationale yields the largest number of verified security repairs while preserving functionality, and adding AST history to it does not increase that number. A funnel analysis identifies where the remaining candidates are lost. In a study of structural-biology software, the combination of repair memory and a boundary check allows a subsequent feature request to succeed in nine of ten tasks without reintroducing the repaired vulnerability, whereas functional feedback alone succeeds in four and reintroduces the vulnerability in three.

Prateek Kumar Rajput, Shahzeb Khan +4

When a coding-agent harness promises guidance before the first source edit, what event does it actually intercept? We audit five separate events: policy assignment, request eligibility, trigger, plan delivery, and observed source-content change. A prescribed-action comparison exposes the coverage of three gate rules but cannot tell us how an agent would continue after receiving a plan. We therefore run local agents on public software issues and hash Python files before and after each executed action. In a pilot-guided, 76-arm study using Qwen2.5-Coder 14B, 15 arms change Python source across seven tasks and three repositories. Guidance precedes every observed first change, but every change uses a structured editor and the study misses its prespecified 20-arm coverage target. Post hoc local tests find seven changed arms that pass the tested target and regression selectors; four of those seven use incomplete regression lists. Public PAUSE and SI2CA trajectories add source-text changes bracketed by adjacent reads, but lack synchronized filesystem states and cannot identify exact first mutations. The audit makes the timing claim testable within a stated source scope. These data do not show that planning improves repair correctness or covers shell-first writes in live agent runs.

Thupakula Sai Varun

Can LLM agents make contributions to frontier computer science R&D? We introduce FrontierCS 2, a benchmark of 48 open-ended tasks. We take a paper and the code its authors released and delete the paper's contribution. The deleted code becomes the human reference that sets the bar. Earlier open-ended benchmarks give each agent a problem statement and grade one program after the run. FrontierCS 2 places the agent inside a research environment. The agent inherits a working repository and may submit a patch at any point. For each patch, a judge returns a development-suite score but keeps the evaluator, the held-out final suite and the reference private, and grades the final submission on that suite against the reference. The tasks span 13 domains, from machine-learning systems and high-performance computing to databases, security and robotics. Beyond these 48 tasks, FrontierCS 2 keeps a private set of more than 100 tasks, to be announced in the future. We evaluate 12 agents. The best one is Claude Opus 5.5, passing 58% of its runs. No run passes on 16 tasks. A higher score is not the same as a pass: most runs that beat the reference on the combined final score still fall short on some metric or workload. On a shared capability scale for agents and tasks, the median task is roughly as difficult as what the strongest agent can handle.

Qiuyang Mang, Wenhao Chai +11

The Harness Hub newsletter

New harness companies, projects, releases and the monthly State of Harness report, in your inbox.