AI has changed technical debt. What is it now?

• 8 min read

A developer struggles. Probably with some slop.

AI has changed technical debt. What is it today?

Tech debt is evolving as AI takes over more of our coding.

Recently, I wrote “Technical debt is a good thing; it always was” where I talked about tech debt and why it’s good. How it lets you borrow from the future to do more today.

This is truer than ever, but AI is changing the costs of software development (in both time and money). Naturally, this has changed how we accumulate technical debt and how we pay it back. Some of the usual debt patterns are becoming much cheaper to deal with; others are becoming far more dangerous.

The cost of doing things properly

Imagine you’re building an MVP. You could spend months getting the first version to market. Traditionally, you would shortcut a lot of this by building things that won’t scale, maybe skipping tests or generally doing things that you would never do in a mature product. You’d do this knowing that if things go well, you will go back and “do things properly”.

But what if doing those things “properly” now only adds an hour or two?

The relative cost of implementing something “properly”, compared with taking a shortcut, has shrunk considerably. Some debt is no longer worth taking on because the shortcut’s benefit has diminished to the point of being irrelevant.

This means we can build much more. Expectations for what an early product or feature can be are much higher. So naturally, we do build more.

But just because something is cheap to build doesn’t mean it’s cheap to maintain.

Imagine a mechanical system that can do its job with five cogs. You wouldn’t use a hundred just because you could. Every additional part can wear out or fail. Software is the same. Each new abstraction, dependency or service introduces more moving parts.

AI makes it tempting to build everything. If something only takes an hour, why not go nuts? But those additional moving parts need maintenance and create an extra surface for things to go wrong.

You can and should do more. But if you build more things without raising the quality bar, you’ve multiplied the old problems of poorly managed debt.

Where the debt really matters

You can ask an agent to write a module, refactor it, add tests, or rewrite it using a different approach. Things that used to take days of engineering effort can sometimes be done in hours.

And that means the quality of individual lines of code starts to matter a little less, at least economically.

I’ve always believed a well-decoupled, modular system matters far more than perfectly written code everywhere.

If you’ve got a slightly horrible module that does its job, is well contained, reliable and doesn’t need changing, who cares?

The problem comes when you need to change something and discover that you can’t do so without changing everything else. AI doesn’t really alter that principle. If anything, it makes it more important.

If you develop good contracts and boundaries with robust testing layers, AI makes replacement much cheaper. If you don’t, you just stack more onto your house of cards.

Paying back debt, little by little

We’re seeing this in the PonchoPay codebase. We now have several automations that progressively work through refactors, renamings, and other improvements, picking off a file or module at a time and delivering changes bit by bit.

Renaming is particularly interesting in domain-driven design.

As the domain evolves, the terminology changes. But renaming a concept throughout a large codebase can be a massive undertaking, and hard to justify against features providing user value. It’s often easier to leave things as they are, even when the names no longer make sense. It takes a bit longer to get up to speed, but you can keep the translations in your head.

Over time, the terminology in the code drifts away from the business language. Previously, fixing that might have meant a substantial rewrite, introducing the risks that any large rewrite naturally brings.

This is one area where we’ve seen real change. Now we can have agents work through these changes progressively, on a schedule. Our robot friends work through small, easily reviewable chunks that we can deliver one by one, rather than one big rewrite.

This changes the cost of paying back technical debt and, importantly, reduces the risk.

So cheaper implementation makes debt less necessary, but cheaper repayment makes it more attractive. Things you wouldn’t have risked before feel less risky, because you feel like you have the solution in your back pocket.

But this assumes you understand the debt you’ve taken on.

Understanding debt

A fairly common argument is that you don’t really need to understand AI-generated code anymore. Just let the agent write it. If something breaks, let the agent fix it.

There is some truth in this. You don’t need to understand every line of code. Honestly, does anyone in a sufficiently large codebase or company? But you do need to understand what it is aiming to achieve and why.

I think of this as understanding debt.

You might have a functioning system with no idea why it’s structured the way it is or what assumptions it relies on. You have no clue how much effort it would take to change. It’s a bit like having a loan where you don’t really know how much you owe, what the interest payments are, or how close you are to defaulting. You might be absolutely fine, but you don’t actually know.

Debt can still be good if you can service it. But you can’t make sensible trade-off decisions if you don’t understand your existing debt.

Small mistakes²

I use smaller projects to work at the bleeding edge of development, using approaches I’m not yet sure are ready for critical infrastructure like payments. While working on these, I’ve noticed how quickly they can go in the wrong direction if you’re not careful.

You give an agent a task. It makes a nearly right decision, then it makes another decision based on that one. And another. Each decision seems reasonable in isolation, but the errors compound. Before long, you’ve gone much further off track than you expected.

This is decision debt.

This problem is baked into the way agents work today. Each new session, or agent pass, doesn’t necessarily have the same understanding of the project’s history that a human developer would. You can provide context, specifications, documentation and summaries. Context compaction helps keep longer tasks going. But information gets lost, and assumptions become accepted facts.

Now, this sounds a lot like human systems, but the difference is speed.

A human developer might spend a day heading in the wrong direction. An agent can make a whole series of interconnected decisions in that time, producing a substantial amount of apparently working software.

I’ve seen this in our own codebase. We have good testing infrastructure, well-defined domain concepts, documentation, and plenty of context we provide to agents. But every so often, they go off on bizarre tangents.

They’ll reimplement something that already exists, introduce an abstraction that makes no sense or make a perfectly reasonable assumption that happens to be wrong. The code is good; it’s just not solving the right problem.

This is where the human in the loop remains especially important. Not necessarily reviewing every line of code, but understanding the system’s direction, and making sure the decisions make sense for the business and the customer.

It’s all in the domain

So I keep coming back to domain-driven design.

If your software models the real world accurately, you have a solid foundation to build on. Your entities represent real things, and your language describes actual business concepts. That gives both developers and agents something solid to work with.

It’s a bit like telling the truth. If you lie, you have to remember all sorts of details to keep your story straight. The truth is easy, since you can recall what happened. When the underlying model is sound, it’s much harder to drift from reality.

Getting the domain model right is becoming one of the most valuable things an engineer can do. An LLM can write perfectly correct code against a completely incorrect model, and if you’ve misunderstood the problem, it can implement that misunderstanding remarkably efficiently.

Once that misunderstanding spreads, fixing it gets much harder. Incorrect assumptions spread across modules, user flows, interfaces and data. If you don’t understand the problem, you can’t untangle the consequences.

Good debt/bad debt

I don’t think the fundamentals of tech debt have really changed. Good debt is still a conscious decision to defer work because it creates more value today than it costs later.

Bad technical debt still makes future change risky, especially when you don’t know how much you have.

So we shouldn’t worry too much about specific implementations, but we should worry a lot about understanding our products as a whole, so we see the nuance the machines won’t.

AI has made it much clearer where the most important tech debt has always lived in our understanding of the problem.

Done well, this should mean we spend far less time on low-level code choices and far more time on users, business needs, and why we’re writing the software in the first place.

We’ve enormously increased our capacity to produce software. Our capacity to make good decisions hasn’t increased at quite the same rate.