note · 2026-09-15

AI written code duplicates more and refactors less, what 623 million code changes show

Four years of code changes, 2023 to 2026, and every maintainability signal moved the same direction as AI authorship climbed. Duplicated blocks up 81%, refactoring down to 3.8% of changed lines, changes to code older than a year down 74%. The fix that changed behavior in a client team was a tripwire.

For founders and CTOs who let coding agents write code that shipsRoc Rizzardini, CEO of yaab1 min read
AI written code duplicates more and refactors less, what 623 million code changes show

The bill for AI written code does not arrive at merge. It arrives in year three, and the data on how it is accumulating is now four years long.

GitClear analyzed 623 million code changes from 2023 to 2026 (report published in 2026). Duplicated blocks, five or more repeated lines, are up 81% since 2023, the highest level on record. Moved code, the signature of refactoring, fell from 21% of changed lines in 2022 to 3.8% in 2026, while copy and paste rose from 9.4% to 15.7%. New code calls existing functions 35% less often. Changes to code older than a year are down 74%. Error masking constructs are up 47%. GitClear's own headline is not that AI writes bad code. It is that the default workflow rewards a closed ticket and quietly taxes reuse, consolidation and the code nobody revisits.

Inside client teams I have watched the agent add a new function next to one that already did the job, because finding the old one was not in its instructions. Twice is a pattern. The fix was a tripwire on duplicate blocks and a rule in the context file: search before you write.

Peter Steinberger, founder of PSPDFKit, on X: duplicating logic is no longer painful; abstractions still are. That asymmetry is the whole report.

Sources