How AI Is Accelerating Technical Debt (And What to Do About It)
Manage AI technical debt with comprehension checks, repository conventions, duplication searches and tests that check intended behaviour before code ships.
I've been using AI coding assistants daily since early 2024. Copilot, Cursor, Claude, the works. My personal output has roughly doubled. So has the rate at which I introduce technical debt.
That's not a contradiction. It's the core tension of the AI-assisted development era. AI makes it faster to write code, and it makes it faster to write the wrong code. The same tool that helps me scaffold a service in 20 minutes also generates 300 lines of plausible-looking code that I don't fully understand.
This isn't an anti-AI article. I'm not going back to writing everything by hand. But I've learned that AI changes the technical debt equation in ways most teams aren't accounting for.
The technical debt guide covers the broader management choices. Comprehension debt is the gap between the code in the repository and what the team understands. Generated code can widen that gap when it is accepted without review.[1]
I reviewed a PR last month where a developer had used Copilot to generate a complex caching layer. It worked. The tests passed. But when I asked why the cache invalidation used a specific TTL strategy, they couldn't explain it. The AI had chosen it, and it seemed reasonable, so they shipped it.
Two weeks later, that caching layer caused a subtle data consistency bug that took 3 days to diagnose. The fix was a one-line change, but finding it required understanding a design decision nobody on the team had consciously made.
AI assistants use their model and the context available to them. They may use repository context and instructions, but suggestions can still introduce inconsistent error handling, naming or architectural choices.[2]
Over time, this creates a codebase that looks like it was written by 50 different people with 50 different opinions about how to structure code. Because it was.
AI is extremely good at generating plausible code from scratch. It's much less good at finding and reusing existing code in your project. I've caught multiple instances where AI generated a new utility function that duplicated one already in our codebase, with slightly different naming and edge case handling.
typescript
// File 1: generated by AI in Februaryfunction formatCurrency(amount: number, currency: string): string { return new Intl.NumberFormat('en-US', { style: 'currency', currency: currency, }).format(amount);}// File 2: generated by AI in March (different developer, same project)function toCurrencyString(value: number, currencyCode: string): string { const formatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: currencyCode, }); return formatter.format(value);}// File 3: the one that was already in utils/ since Januaryexport function displayCurrency(cents: number, currency = 'USD'): string { return new Intl.NumberFormat('en-US', { style: 'currency', currency, }).format(cents / 100);}
Three functions doing almost the same thing. Only the original handles cents-to-dollars conversion. The AI-generated ones introduce a bug where prices display 100x too high if the input is in cents.
AI generates tests that pass. That's not the same as tests that catch bugs.[3]
I ran an experiment on one of our services: I asked AI to generate a test suite, then I intentionally introduced 10 bugs. The AI-generated tests caught 3 of them. Hand-written tests by a developer who understood the business requirements caught 8.
AI tests tend to test that the code does what it does, not that it does what it should.
In this illustrative calculation, code output doubles and the assumed debt volume grows sixfold. These assumptions do not establish feature-delivery speed or a time to payback for a real team.[4]
I was wrong about this. For the first 6 months of using AI coding tools, I thought I was being more productive. My commit frequency went up. My PR size went up. But when I looked at the data, our team's end-to-end delivery time hadn't improved. We were writing code faster and debugging it longer.
Before merging any AI-generated code, every engineer on my team must be able to explain every function in the diff. Not "it formats currency." But "it formats currency using Intl.NumberFormat with locale en-US, and here's why that locale is correct for our use case."
If you can't explain it, you can't maintain it. Rewrite it or learn it before merging.[5]
We maintain a CONVENTIONS.md file that documents our patterns. Before accepting AI suggestions, check them against conventions. Better yet, include your conventions in the AI's context window.
markdown
## Conventions for AI Context- Error handling: Always use Result<T, Error> pattern, never throw- Naming: camelCase for functions, PascalCase for types, UPPER_SNAKE for constants- Data fetching: Use our internal fetchApi() wrapper, never raw fetch()- Currency: Always stored in cents, use utils/currency.ts for display- Dates: Always stored as UTC, use utils/date.ts for formatting
Before accepting AI-generated utility functions, search your codebase for existing implementations. This takes 30 seconds and prevents a category of debt that's surprisingly expensive to clean up later.
bash
# Before accepting a new function, check for existing implementationsgrep -r "formatCurrency\|toCurrency\|displayCurrency" src/
Figure 2. Continue through test review after checking whether an existing implementation can be reused.
Is this code for a critical path (auth, payments, data integrity)?
├── YES: Write it yourself. Use AI for syntax help only.
└── NO: Proceed with AI generation
│
Can you explain every line to a teammate?
├── NO: Stop. Learn it or rewrite it.
└── YES: Proceed
│
Does it follow your team's conventions?
├── NO: Modify it to match conventions.
└── YES: Proceed
│
Does similar code already exist in your codebase?
├── YES: Use the existing code. Delete the generated code.
└── NO: Review tests and run the required checks before merging.
AI coding tools are a multiplier, not a replacement for engineering judgment. A 2x multiplier on good engineering practices gives you great results. A 2x multiplier on careless practices gives you a codebase that's twice as hard to maintain in half the time.
The teams that will win in the AI era aren't the ones that generate the most code. They're the ones that maintain the highest ratio of understood code to total code. That's the metric that matters now.
Most AI-in-engineering discourse focuses on productivity gains. I think the bigger story is quality risk. AI doesn't just change how fast you code. It changes the relationship between the developer and the code. For the first time in software history, it's normal for developers to ship code they didn't write and don't fully understand.
That's not inherently bad. But pretending it doesn't change the technical debt equation is dangerous. Account for it. Measure it. Manage it. Or drown in code nobody on your team can explain.
Does faster AI code generation prove faster delivery?
More generated code and more commits measure activity. Delivery also includes review, integration, debugging and deployment, so compare end-to-end delivery time and stability before concluding that generation speed improved the team outcome.
How can a team check comprehension of generated code?
Ask the author to explain the important decisions and edge cases in the diff, including units, error handling and dependencies. An explanation should show why the behaviour suits the application and identify what the tests actually verify.
Why can passing AI-generated tests miss a bug?
A generated test may repeat the implementation assumptions or omit a required edge case. Review its assertions against the business requirement and check whether a plausible behaviour change would make the test fail.
How do repository conventions help AI-assisted development?
Written conventions give developers and supported assistants a common reference for patterns such as currency units, date handling and error handling. Review the resulting code against those conventions because supplying guidance does not guarantee compliance.
Five predictions for where code intelligence is heading by 2028, based on 6 years of building tools in this space. Includes what's real, what's overhyped, and a maturity model for planning.
Most code quality dashboards fail because they track too many metrics and live outside the team's workflow. Here are exactly 7 metrics and a 3-week adoption plan that actually works.
Small frictions cost more than big blockers. 47 micro-frictions consume 96 minutes per engineer per day. Here's the TAX Return framework for finding and eliminating the developer productivity tax.
Engineers spend 38% of their time on repetitive, automatable work. Here's a toil audit process that identifies where time disappears and a framework for systematic elimination with measurable ROI.
Developer experience is a systems design problem, not a culture problem. Platform engineering reduces cognitive load from 12 concepts to 3 for common tasks. Here's the LOAD assessment framework.
The 10x developer myth is actively harmful to engineering teams. After tracking individual metrics vs team output, I found that the highest performers often had negative correlations with team throughput.