Skip to content
OverKnightsOverKnights home

AI technical debt: why code written by assistants compounds, and how to stop it

Duplicated patterns, dead code, empty tests and silenced types: how AI assistants create technical debt that compounds, and how to keep it in check.

OverKnightsPublished 3 min read
Short answer

AI technical debt is the maintainability cost created when many assistant sessions write one codebase without a shared view of it. It shows up as duplicate helpers, competing patterns for the same job, dead code from abandoned attempts, tests that assert nothing and silenced type errors. It compounds because assistants copy what they see: every inconsistent pattern becomes a template for the next feature.

  • Assistants imitate the codebase in front of them, so bad patterns multiply.
  • The fix is consolidation plus rules: one way to do each job, written down where the assistant reads it.
  • Track a few drift signals weekly so debt is visible before it slows the team.

Technical debt used to come from deadlines. Someone took a shortcut on purpose and planned to come back. AI technical debt comes from something else: each assistant session solves its task with only part of the codebase in view.

The result is a codebase that works, passes CI and gets harder to change every week.

What AI technical debt looks like

IDPatternHow it appears
AID-02Duplicate helpersformatPrice, formatCurrency and toMoney doing the same thing
AID-03Dead codeAbandoned attempts and orphaned files left after a regenerate
AID-04Competing patternsThree fetch wrappers, two state stores, two date libraries
AID-05Empty testsTests that mock the unit under test or assert constants
AID-07Silenced typesany and @ts-ignore added to get past an error

None of these break the build. All of them make the next change slower and riskier.

Why it compounds

Assistants imitate. When you ask for a new feature, the model looks at nearby code and follows its patterns. If there are three ways to call the API, the next feature picks one at random, or invents a fourth. If tests in a folder mock everything, new tests mock everything.

So debt is not linear. Every inconsistent pattern becomes a template. A codebase with one HTTP client stays that way; a codebase with three tends to grow a fourth.

How to keep it in check

Consolidate, then write it down

Pick one way to do each common job: data fetching, errors, dates, money, auth checks, logging. Move the others onto it. Then write the decision in the rules file your assistant reads, with the path to the shared module.

Make the right thing the easy thing

Assistants use what is easy to find. Put shared helpers in obvious places with obvious names, export them from one index, and delete the alternatives rather than deprecating them.

Review for drift, not just bugs

Add drift checks to your review routine: new helpers that duplicate existing ones, new libraries for solved problems, new any, skipped tests. The AI code review checklist includes them.

Track a few signals weekly

  • Duplicate blocks reported by a copy-paste detector.
  • Unused exports and files.
  • Count of any, @ts-ignore and eslint-disable.
  • Skipped or focused tests.
  • Libraries per concern.

Trends matter more than totals. See measuring AI code quality for a simple dashboard.

The weekly habit

Once a week, look at the drift signals and pick one pattern to stop. Consolidate it, add a rule, and check next week whether it came back. That single habit does more than any large refactor.

Our weekly summary for clients is built around exactly this: trend by severity, the top risks, what the team fixed, and one pattern to stop with a rule for the AI tool instructions.

Frequently asked questions

Is AI technical debt different from normal technical debt?

The causes differ. Human debt usually comes from deliberate shortcuts. AI debt mostly comes from missing context: each session solves the task without knowing how the rest of the codebase already solves it.

How do I measure it?

Count duplicate code blocks, unused exports, new any and ts-ignore usages, skipped tests and the number of libraries or wrappers per concern. Watch the trend, not the absolute number.

Should we stop using AI assistants?

No. Give them better context and constraints, and review for drift regularly. Teams that do this keep most of the speed without the decay.

OverKnights

Want to know what your repo would show?

Send one public repo. We reply with three verified findings and the prompts to fix them. No call needed.