NeuralOS
Engineering

AI code rots faster: duplication up 81% and refactoring almost gone

GitClear and GitKraken analyzed 623 million real code changes between 2023 and 2026. The verdict is uncomfortable: AI writes fast but maintains terribly. Duplication soaring, refactoring evaporated, technical debt piling up in silence. The cure isn't a better model: it's architecture.

EN
Equipo NeuralOS
Ingeniería
Jul 19, 20267 min read
In short

AI optimizes for writing, not maintaining: 623M changes show duplication +81% and refactoring -70%. Debt accumulates invisibly. The cure isn't a better model but architecture: a single source of truth, enforced DRY, and a project graph.

Picture a bricklayer who only knows how to lay bricks, never to remove them. Every time you ask for a new wall, they raise it flawlessly and at breakneck speed — but they never tear down the one that's outlived its purpose, never reuse an existing wall, never reorganize the house. Six months in, you don't have a house: you have a maze of beautiful walls nobody can live in. That bricklayer is AI writing code, and we don't say it as a provocative metaphor: it's what the largest empirical study on the subject says. GitClear and GitKraken analyzed 623 million real code changes between 2023 and 2026, and found that AI optimizes brutally for one thing — writing — while the other half of the craft, maintaining, quietly falls apart.

The number that should keep you up at night

The figures are specific and they're ugly. Code duplication rose 81%. Moved or refactored code — the cleanest signal that someone is consolidating instead of piling on — dropped 70%. Refactoring of legacy code, that thankless task of fixing the old stuff, plummeted 74% since 2023. And error masking, the habit of swallowing errors so they don't surface as defects, rose 47% in 2026. This isn't the anecdote of one unlucky team: it's a pattern measured across hundreds of millions of commits, with AI already present in roughly one out of every four.

AI doesn't have a talent problem, it has an incentive problem

Here's the mental trap you have to break. We tend to think that if the code turns out badly, it's because the model isn't smart enough. False. The model is brilliant — at what we trained it for. And we trained it to produce the answer that satisfies your request right now, not to look after the health of the system a year from now. Bill Harding, CEO of GitClear, sums it up with a line you should tattoo on yourself before your next prompt: 'every time you want something, AI creates a new package'. It doesn't look for the function that already exists. It doesn't ask whether there's a pattern to reuse. It raises another wall. And as he himself warns, 'in the long run it starts to hurt when you realize you have five different implementations' of the same thing — each one slightly different, each one a place where the next bug can hide.

Writing is free, maintaining is brutally expensive — and AI only made the cheap part cheaper

The great misunderstanding of this era is believing that software's bottleneck was typing. It never was. In any serious project, writing the first version of something is the easy, short part; what eats years and budgets is understanding it, modifying it without breaking it, and deleting what's no longer needed. AI made trivial the part that was already cheap — generating lines — and didn't touch (or made worse) the expensive part. It's as if we invented a printer that spits out pages for free and celebrated that writing novels is now easier, ignoring that the hard part was always editing. Error masking at 47% is the perverse cherry on top: as Harding puts it, AI 'clearly prefers writing code that won't be flagged as a defect'. It's not just that debt piles up: the code is designed not to scream when something goes wrong, so the debt turns invisible until it blows up in production.

Duplication isn't clutter, it's compound interest in reverse

A stray duplicate kills no one. The problem is that duplication compounds. When the same logic lives in five places, every change in business rules forces you to find and edit all five copies — and forgetting just one leaves you with a subtle bug that only shows up in the rare case. The functional connectivity of the code, according to the same study, fell 35%: modules talk to each other less because each one brings its own version of everything. That's exactly the opposite of a healthy system, where a decision is made in a single place and everything else inherits it. A codebase with 81% more duplication isn't a bigger codebase: it's a codebase that ages at double speed, where every week of accelerated generation buys you two weeks of future maintenance.

The cure isn't a better model: it's a single source of truth

Here's the reusable lesson, the one you can share and apply tomorrow no matter what tool you use. AI won't cure itself of its bias toward writing, because that bias lives in its objective function. The countermeasure doesn't live in the model: it lives in the architecture surrounding it. DRY stopped being an aesthetic preference and became an active defense: if your system makes it easy to find and reuse what already exists, AI duplicates less because it has less excuse. A single source of truth — a canonical place for every contract, every type, every rule — is what turns the bricklayer who only stacks into one who reuses. And a navigable map of the project, a graph that says 'this already exists, connect to it', is the difference between an assistant that consolidates and one that piles up. AI's speed is only an advantage if you channel it through a structure that forces it not to rot what it touches.

How we see it

Our bet starts from an uncomfortable conviction: the hard part isn't generating, it's not rotting. That's why at NeuralOS the frontend is the single source of truth — the contract exists first and what comes behind it fills it in, instead of every generation inventing its own version of the same screen. That's why we maintain a knowledge graph of the project: 623 million changes made by others remind us that without a map, AI rewrites what you already had instead of reusing it. And that's why the Construct-Audit-Reflect protocol separates the moment of creating from the moment of auditing — because building with energy and reviewing with paranoia are incompatible mental states, and mixing them is exactly how you accumulate the invisible debt the study measures. We don't believe the answer to AI that rots is to write less with AI. We believe it's to surround it with the discipline it doesn't ship with by default: enforced DRY, a clear contract, a graph that remembers. Speed without architecture isn't productivity; it's debt with better typography.

Share
Ready to build?

Start building in
under 3 minutes

Join 4,200+ builders. No credit card. Build your first app with AI in minutes.