Preventing Technical Debt in AI Development Guide
Suppose an agent adds a currency formatter. Its tests pass, the output looks right, and the feature ships, but the repository already has a formatter with different rounding rules. Now a rounding change means finding and updating both implementations.
I'd want to catch that before asking the agent to write the second one. For this workflow, technical debt means extra maintenance work you've accepted or accidentally introduced, such as repeated behavior or code that never gets connected to the feature it was meant to implement, leaving someone else to work out whether it can be removed.
The useful place to start is the next task. Give it a discovery step before editing, make the caller check part of the plan, and require evidence from the feature's entry point before calling it finished, even when the helper's own tests already pass.
What the research supports
GitClear's 2025 code-quality report found duplicated blocks in 1.80% of sampled commits in 2023 and 6.66% in 2024. Its measure looks for repeated runs of at least five lines, excluding blank and keyword-only lines, so this is a particular duplication measure, not the percentage of a codebase that is duplicated.
That trend is a