Revisiting the Survival of Agent-Attributed Code: How Measurement Choices Decide the Verdict

Musfiqur Rahman, Mahi Begoug, Emad Shihab

TL;DR

Does code written by AI agents survive longer in a codebase than human-written code, or is it quickly replaced as technical debt? This paper reveals that the answer depends almost entirely on your measurement choices. By re-analyzing 854,139 lines of code across 88 different experimental "specifications," the authors show that for autonomous agents like Devin, the "verdict" on code survival can be flipped simply by changing how you calculate statistical uncertainty.

What Problem Does This Paper Address?

As AI coding agents like GitHub Copilot and Devin become mainstream, researchers have started asking a critical question: what happens to this code after it is merged? This is known as "post-merge behavior" or "code survival." If agent-generated code is correct but hard to maintain, it might be modified or removed much sooner than human code, signaling long-term technical debt.

However, existing studies have reached conflicting conclusions. Some say agent code lasts longer; others say it's replaced faster. The authors of this paper argue that these disagreements aren't necessarily about the agents themselves, but about the "measurement ladder"—the series of defensible but impactful choices researchers make, such as how to track a line of code as it moves, what counts as a "modification," and how to handle statistical dependencies within a repository.

Methods

The authors performed a multiverse analysis (specifically a specification curve) to see how different combinations of measurement choices affect the final result. They varied nine key choices, including:

  • Line Tracking: Following a line by its position (line number) vs. its identity (using git blame with rename detection).
  • Unit of Analysis: Counting by individual lines, "hunks" (blocks of code), or entire Pull Requests (PRs).
  • Modification Definition: Syntactic (any change) vs. AST-structural (only changes that alter the code's logic, ignoring whitespace/renames).
  • Intent Classification: Using traditional keyword-based rules vs. Large Language Models (LLMs) to decide if a change was a bug fix or a feature addition.
  • Statistical Uncertainty: Comparing "model-based" standard errors (treating every line as independent) against "clustered" standard errors (accounting for the fact that lines in the same repo are often modified together).

They used Kaplan-Meier survival curves and Cox proportional hazards regression to estimate the "hazard ratio" (HR)—a measure of how much more (or less) likely agent code is to be modified compared to human code at any given time.

Datasets

The study uses the AIDev dataset, which contains nearly a million PRs from five different agents: GitHub Copilot, Cursor, Claude Code, OpenAI Codex, and Devin. The authors focused on a filtered cohort of 2,802 merged PRs across 215 open-source repositories, totaling 854,139 lines of code.

Key Insights and Ideas

  • The "Clustering" Trap: This is perhaps the most critical finding. Many previous studies treated every line of code as an independent data point. However, lines in the same repository are highly dependent. When the authors clustered standard errors by repository, many "significant" findings—especially for the autonomous agent Devin—vanished.
  • LLMs are the New Gold Standard for Intent: Traditional keyword-based rules for classifying why code changed (e.g., looking for "fix" in a commit message) are surprisingly inaccurate ($\kappa = 0.38$). LLMs, however, agree with human labels as well as two humans agree with each other ($\kappa \approx 0.70$).
  • Supervised vs. Autonomous Agents: For human-supervised agents like Copilot, the results were stable: their code generally survives longer than human code across most measurements. For the fully autonomous agent Devin, the results were volatile, with the verdict shifting between "modified sooner" and "no difference" based on the measurement pipeline.
  • The Human Maintenance Burden: Despite the rise of agents, humans still do the heavy lifting. Human developers make about 88% of the modifications to agent-generated code.

Key Results

The authors summarized the diversity of measurement choices in previous literature in Figure 1:

Table 1. Measurement choices of published post-merge studies of code from coding agents, as reported in each paper. “Not stated” means we could not find the choice in the paper.
  • Copilot/Supervised Agents: In 13 out of 22 specifications across repositories, Copilot code was found to be retained longer than human code. It was almost never found to be modified sooner.
  • Devin/Autonomous Agents: The verdict was highly sensitive. Using "model-based" errors, 15 of 22 specifications reported it was modified sooner. But with proper repository clustering, only 3 specifications showed a difference—no more than what you'd expect from random chance (permuted labels).
  • Sensitivity to Single Choices: The authors re-ran five published study designs on their data and found that each one could have its headline result flipped by changing just one measurement choice.

Limitations and Future Work

  • Dataset Specificity: The results are based on the AIDev dataset. While it's a standard benchmark, the behavior of agents might differ in closed-source corporate environments.
  • Agent Evolution: Coding agents are moving targets. The "Devin" studied here is a specific version from a specific period; newer autonomous agents might behave differently.
  • Future Directions: The authors suggest that future studies must use their provided "operationalization checklist," which includes recommendations like following line identity rather than location and always reporting results under multiple variance estimators. They also plan to investigate how the level of human supervision (e.g., "Copilot" vs "Devin") fundamentally changes the maintenance lifecycle.

Summary updated

Abstract

Studies of how long code from AI coding agents survives after it is merged reach conflicting verdicts: agent code is reported to be retained longer than human code, about as long, or modified sooner. Each study makes defensible measurement choices, but how much these choices decide the verdict is unknown. We revisit the survival of agent-attributed code in our earlier study: 854,139 lines that 2,802 merged pull requests (PRs) added to 215 repositories of the AIDev dataset. We vary nine measurement choices in five research questions and build a specification curve of 88 survival analyses, tested under three variance estimators, several observation windows, and permuted labels. For code from human-supervised agents, mostly GitHub Copilot, the choices change the size of the effect but not its direction. For code from the fully-autonomous agent Devin, they decide the verdict. Across repositories, 15 of 22 specifications report it modified sooner when lines are treated as independent, but only 3 when standard errors are clustered by repository, no more than permuted labels produce. Within repositories, no specification detects a difference. LLM intent classifiers agree with human labels about as well as two humans agree with each other, whereas keyword rules do not (kappa = 0.69 to 0.72 against 0.38), and the two reach different verdicts on why agent code is modified. Humans make most modifications to agent code under every unit and window. Re-run on our data, five published designs each change their result with a single choice. Whether agent code survives longer than human code is therefore decided as much by the measurement as by the code. We derive an operationalization checklist for post-merge studies.
BibTeX
@misc{rahman2026revisiting,
  author = {Musfiqur Rahman and Mahi Begoug and Emad Shihab},
  title = {{Revisiting the Survival of Agent-Attributed Code: How Measurement Choices Decide the Verdict}},
  year = {2026},
  eprint = {2611.21784},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21784},
}
Figure