AI
AI coding agents leave documentation behind in nearly two-thirds of code changes
A large-scale analysis reveals that AI-generated pull requests frequently update code without updating accompanying documentation, a problem that compounds over time.
An analysis of nearly 30,000 AI-generated pull requests has uncovered a systematic gap in how coding agents handle documentation, suggesting that AI contributors to open-source and corporate repositories are prioritizing code changes while neglecting the written guidance that developers rely on.
The Scale of the Problem#
Researchers examining the AIDev dataset found that roughly 63% of AI-generated pull requests modify code files without updating documentation. The extent of this "documentation drift" depends on the type of work: feature additions see documentation omitted about 55% of the time, while refactoring tasks skip documentation in roughly 78% of cases.
Hidden Consequences#
The long-term impact of undocumented code changes becomes clearer when tracking repositories over time. Files modified without documentation attract follow-up fixes at a notably higher rate—between 8.6% and 11.7% more frequently than documented files—when examining 30- to 90-day windows after the initial change. This pattern suggests that incomplete documentation leaves code in a state that generates additional maintenance work.
Paradoxically, when comparing pull requests directly, documented changes appear more prone to follow-up fixes. However, this reverses when accounting for size: documented PRs tend to be substantially larger (3.9 times on average), meaning they naturally cover more code surface and thus invite more corrections.
Speed Versus Scale#
Despite being significantly larger, documented changes merge faster: a median of 40 seconds versus 184 seconds for undocumented ones. This advantage exists even though much of the merging in this dataset appears to be automated, suggesting that better-documented code passes review more smoothly.
A Compounding Problem#
The research points to a self-reinforcing cycle. When a file receives a code change without documentation, it is later re-documented at roughly half the rate of a properly documented change over the next 90 days (24% versus 48%). This pattern indicates that documentation debt accumulates rather than being systematically addressed, leaving developers to maintain an increasingly under-documented codebase.

