AI
AI Code Survives Longer Than Expected in Open-Source Projects, Study Finds
Researchers challenged the notion that AI-generated code is "disposable," finding that agent-authored contributions persist at similar or better rates than human-written code after merging.
A new study examining nearly 650,000 lines of code added through pull requests in open-source projects has challenged the widespread assumption that AI-written software is inherently fragile or short-lived.
AI Code Isn't Disposable#
Contrary to industry anecdotes suggesting that AI-generated code is quickly revised or removed, researchers analyzed merged contributions from GitHub Copilot, OpenAI Codex, and Devin across 215 repositories. The findings reveal that agent-authored code persists at comparable rates to human-written code after integration. In fact, when accounting for equal weighting across pull requests, AI-generated lines were modified later than human code—suggesting greater stability.
Which AI Tools Perform Best#
The results varied significantly by agent. Copilot and Codex showed the strongest longevity, with modifications occurring later than human contributions (hazard ratio 0.76). Devin, a newer autonomous coding agent, showed no statistically meaningful difference from human code over the full study period, though it demonstrated improved performance when examining only code merged after mid-May 2025.
Predicting Code Survival#
The research identified practical patterns for maintainers. File size and recent modification history proved more effective predictors of whether agent-authored code would later be changed (area under the receiver operating characteristic curve: 0.78) compared to code complexity metrics (0.70). However, the ability to forecast when modifications would occur remained weak, suggesting that code survival depends on factors beyond the code itself.
What Happens When Changes Occur#
When agent-attributed code is modified, the nature of those changes closely mirrors revisions to human code, indicating no systematic difference in maintenance patterns or problem identification.
Implications for Code Review#
The findings suggest that maintainers need not apply disproportionate scrutiny to AI-generated contributions based solely on their origin. Instead, the agent tool used, timing of the contribution, and analytical method employed all influence whether code survives longer than human-authored alternatives.

