Technical Debt and Code Quality Drift
When code is cheap to produce, a codebase can grow faster than anyone understands it. Studies point to more duplication, more complexity and less refactoring after assistants arrive, though the evidence is partial. A manager who tracks five signals monthly and protects a refactoring budget sees the drift while it is still cheap to fix.
After this chapter you can
- Baseline five drift signals: duplicated blocks, refactor share, churn, warnings per 1,000 lines and an owner-explains sample.
- Agree alert levels in advance and read each signal's direction over several months, never a single month.
- Pair every throughput gain with a quality measure so speed and cost appear together.
- Define a refactoring budget with a trigger, named targets and an exit condition.
- Keep drift signals at team level, since individual targets invite optimizing the number.
Picture a team lead who tells you, with justified pride, that merged changes have doubled since the assistants arrived. Your director has noticed. Three months later, in this imagined case, a routine feature takes twice as long as the estimate, because nobody is sure which of three similar functions is the real one. Nothing broke. No incident report will ever mention it. This is the pattern managers fear most and measure least, and the question it raises is the one for this chapter: how will I know our codebase is getting worse before it hurts delivery?
Level 1 made the money point in a line: the cost of software is not only the build but the operating and changing of it afterward. Assistants lower the build cost sharply. They leave the cost of reading, changing and trusting the code where it was, or push it up if the code is bulkier and less consistent. Your job is to watch that second bill.
What the evidence shows, and what it does not
Start with what is documented. Two studies and one survey point the same way, and each has a limit you should carry with it.
He and colleagues compared 806 GitHub repositories that adopted Cursor with 1,380 matched repositories that did not, over January 2024 to August 2025. After adoption, lines added jumped by 281 percent in the first month, fell to 48 percent in the second and then largely returned to normal. Static analysis warnings rose by 30.3 percent and code complexity by 41.6 percent, and those rises persisted. In the authors’ dynamic model, a 100 percent increase in complexity was linked with a 64.5 percent fall in velocity, where velocity is measured as lines added1. The scope is open-source projects. The authors caution that enterprise settings, with mandates and managerial oversight, might show different patterns over time, so this study shows what can happen, not what will happen to your team.
GitClear, a company that sells code analytics, analyzed 211 million changed lines. As reported by DevClass, blocks of five or more duplicated lines rose eightfold in 2024, lines moved (a sign of refactoring) fell 39.9 percent from 2021 to 2024, and 2024 was the first year copy-pasted lines outnumbered moved lines2. GitClear attributes this to assistants making it easy to insert new code and unable to see the whole codebase. That reading is the company’s own, and the data show trends over years in which many other things changed.
The 2024 DORA survey is a third angle. For each 25 percent increase in AI adoption, respondents reported 7.5 percent better documentation quality, 3.4 percent better code quality and 3.1 percent faster code review. They also reported an estimated 1.5 percent drop in delivery throughput and 7.2 percent drop in delivery stability. The report’s reading is that improved development does not improve delivery without the basics, such as small batches and robust testing3. These are associations from survey data, not causal estimates, and they include positive findings that cut against a simple story of decline.
Read together, none of the three proves your codebase is decaying. They justify a cheap, regular check, which is a different and much smaller claim.
Why drift is hard to see
Drift has no author. Each pull request passes review because each is fine, and the codebase worsens in the gaps between them. Three features of assistant-assisted work plausibly widen the gaps; these are mechanisms I am reasoning from, not effects the studies above measured.
First, the assistant works from the context it is given. If the helper function you already own is outside that context, it writes another one. Second, the cost of an extra block is felt later and by someone else, while the benefit of finishing the task is felt now. Third, reviewers read what is in the diff. A reviewer cannot see the near-duplicate three directories away, and an earlier chapter on small batches covered how reviewers cope with volume, but not with absence.
Drift also hides behind good news. Throughput climbs, so every dashboard your director sees looks fine. The signals below exist to put the cost on the same page as the gain.
Five signals worth a monthly look
Choose few signals, make them cheap and compare them with your own baseline, because absolute numbers differ by language and domain and there is no universal good value. Each signal below can come from tools most teams already run.
The first four are counts a tool can produce. The fifth is a person. It is the one most likely to be skipped, and the one most likely to tell you something the others cannot. A change can pass every automated check and still be code that nobody on the team could explain at three in the morning during an incident. The sample is small on purpose: ten changes, picked at random by a script, and a five-minute explanation each. If an owner cannot explain it, the finding is about the process that let it merge, not the person.
Be careful with three traps. Do not put these signals in anyone’s individual review. They are team measures, and the moment they become targets people will optimize them: a team can reduce duplicated blocks by merging unrelated functions. Do not compare teams with one another, because baselines differ. And do not read a single month; read the direction over three, because one release can move a signal without meaning anything.
Cadence: who looks, when, and what happens
A signal nobody reviews is a dashboard. Fix the rhythm and the action in advance.
At the pull request, the cheapest question is a reuse question. Ask reviewers to search for an existing function before approving a new one with a familiar-sounding name. Ask authors to give the assistant the relevant existing module as context, which is a habit, not a tool.
Each month, one person reads the five signals and writes three lines: what moved, what breached, what to do. The manager reads those lines. When two or more signals breach their alert level, the budget opens. A refactoring budget is a fixed share of capacity for a fixed period, for example 20 percent for two sprints as an illustrative start, named in advance so it is not a negotiation each time. Each quarter, take the debt list to your product partner in the same meeting where features are prioritized, with the signals attached, so the trade is visible and not smuggled.
What the budget buys matters as much as its size. Spend it on the places the signals point to, not on whatever the team finds interesting. Good targets are merging duplicates into one tested function, deleting code nobody calls, adding tests around the modules that failed the explainer sample, and writing a short note on why a hard module is built the way it is. Poor targets are a rewrite of a working service and a style cleanup with no signal behind it. Agree the exit condition too: the budget closes when the signals that opened it are back inside their alert levels for two consecutive monthly readings, or when the period ends, whichever comes first, and the next review decides whether to extend it. A budget with no end date turns into a standing tax, and a director will rightly resist that.
Case: reading a drift report
The two studies above are best treated as practice in reading, not as verdicts. Consider the three habits they model.
The Cursor study reports more than one measure and says which direction each moved: a speed gain that faded and a quality cost that stayed. When your own monthly review shows a throughput gain, ask for its pair. If the pair is missing, the number is half a result.
The GitClear report is a company’s reading of its own data, and it says so by what it attributes to tool design. When a vendor or a consultancy gives you a quality claim, ask what the sample was, what changed over the same years, and who gains from the conclusion. That does not make the numbers false. It tells you how far to trust the explanation.
The DORA survey shows a mixed picture. Quality of code, documentation and review speed rose; stability and throughput fell. A mixed result is the normal case. If your own review of drift shows only bad news, check the method; if it shows only good, check it again.
A team-sized worked example
This is a constructed scenario with invented figures, set out so you can adapt the arithmetic to your team. A team of eight engineers owns a service of about 120,000 lines. Three months after adopting assistants, the lead takes a baseline and then a reading. All numbers below are illustrative.
Check the arithmetic. The duplication alert is 1.5 times 4.0, which is 6.0, and 7.5 is above it. The refactor floor is 8 percent, and 7 is below. Churn at 13 percent is above its 12 percent alert (1.3 times 9 is 11.7, rounded to 12), and warnings alert at 18 plus 20 percent, or 21.6, so 21 is inside. The owner-explains sample fell short of 8 of 10. That is four breaches out of five signals.
The rule says two breaches open the budget, so it opens. The team has 8 engineers and a sprint of 10 working days, which is 80 engineer-days a sprint. At 20 percent that is 16 engineer-days per sprint, and 32 over the two sprints. The lead picks the targets from the data. Duplicated blocks point to a small shared-utilities cleanup. The owner-explains misses name the three modules where changes were hardest to explain, and those get short written notes, plus a walkthrough between each module’s owner and whoever last changed it. After the two sprints the lead re-reads the signals and reports to the director in one line per signal. No outcome is claimed here, because the example ends at the plan.
What this means for engineering managers
Monday action (owner: you for the baseline, one named teammate for the monthly read): take this month’s baseline for the five signals, even roughly, and put the date of the first monthly review in the calendar. Then copy this template.
Check yourself
- One study of open-source projects found that the speed gain after adopting an assistant lasted indefinitely.
- The studies prove that AI assistants degrade every codebase they touch.
- A rising count of merged changes is enough evidence that the codebase is healthy.
- A person explaining a random merged change is a legitimate drift signal.
- Drift signals work best as individual performance targets.
- Agreeing the refactoring budget and its trigger in advance avoids a negotiation every time the signals move.
Reflection
What comes next
Drift is the slow version of the problem. The large version is a migration, where assistants make a rewrite cheap to start and hard to finish safely. The next chapter, Legacy Modernization and Migration With AI, covers scope, test harnesses and progress measures.
References
- Hao He, Courtney Miller, Shyam Agarwal, Christian Kastner and Bogdan Vasilescu. Speed at the Cost of Quality: How Cursor AI Increases Short-Term Velocity and Long-Term Complexity in Open-Source Projects. 23rd International Conference on Mining Software Repositories (MSR 2026). 2026.
- DevClass. AI is eroding code quality, states new in-depth report. DevClass. 2025.
- DORA (Google Cloud). Accelerate State of DevOps Report 2024. Google Cloud. 2024.
Further reading
- Hao He, Courtney Miller, Shyam Agarwal, Christian Kastner and Bogdan Vasilescu. Speed at the Cost of Quality: How Cursor AI Increases Short-Term Velocity and Long-Term Complexity in Open-Source Projects. 23rd International Conference on Mining Software Repositories (MSR 2026). 2026.
- DevClass. AI is eroding code quality, states new in-depth report. DevClass. 2025.
- DORA (Google Cloud). Accelerate State of DevOps Report 2024. Google Cloud. 2024.
Sources last verified 2026-10-12.