r/ChatGPTCoding • u/Fantastic-Sleep-3352 • Oct 20 '26
Question Are your dev teams noticing a massive wave of "AI code debt" and subtle race conditions lately?
Lately, looking through pull requests across a few projects, I’ve noticed a pattern with code written by AI assistants (Cursor, Copilot, Claude Code, etc.).
The code looks clean at a glance, passes standard unit tests, and gets merged quickly. But beneath the surface, it seems to introduce massive structural issues:
- Semantic Clones: The AI generates a brand-new helper function in a file instead of searching the repo to reuse an existing utility, leading to sudden code bloat.
- Silent Concurrency Flaws: Async functions and database calls missing proper idempotency locks or transaction boundaries that only break under production load.
Traditional linters don't catch this because the syntax is valid. Senior devs are spending hours hunting down these subtle AI patterns during code reviews.
For those managing engineering teams utilizing AI heavy right now—have you hit this wall? How are you gatekeeping or catching these structural/AI-specific anti-patterns before they hit production, or are you just absorbing the technical debt?
19
u/First-Tutor-5454 Oct 20 '26
no. we have enormous token budgets, haven't written code by hand in ~8 months, and things are going fine. we are adopting AI code review more and more
18
u/2053_Traveler Oct 20 '26
Why do you spam your posts and use AI slop writing? Are you an LLM?
What you describe can be improved by agent md and skills. But it’s still AI and has no actual judgement. Humans know when to break rules and AI doesn’t, it will just get “confused” and waste all it’s thinking budget on thought loops.
12
u/sreekanth850 Oct 20 '26
No
3
u/bostonaholic Oct 20 '26
It's the same failure mode as a fast junior who doesn't know the codebase yet, just at higher volume. Small PRs so review is actually possible, the 'use the existing helper, don't write a new one' rules in the agent instructions file, and a required senior review on anything touching concurrency or transactions. The debt is real, but it's mostly a review-process problem, not an AI one.
2
u/honorspren000 Oct 22 '26
Regarding #1, the last company I worked at had maybe 5 variations of a Util.java. They were all named slightly different and located in different packages. They also had somewhat similar helper methods in them. It’s the results of 10 years of development with different devs.
It seems like AI is just doing the same things at a faster pace.
1
u/SangerGRBY Oct 20 '26
1
u/ComprehensiveShake76 Oct 20 '26
Both of those can be caught before review if you turn them into explicit checks. For semantic clones, give the reviewer, human or agent, one narrow question: which new function here duplicates something that already exists in the repo? A targeted question finds far more than a general review. For concurrency, list the operations that must be idempotent or run in a transaction (payments, inventory, anything a queue can retry) and require a test that runs the same call twice or concurrently. That test fails fast when a lock is missing. Unit tests that call things once will never see these. Which one bites you more often?
1
u/shetritr Oct 20 '26
it passes the tests because it wrote the tests. the duplicate helpers and missing locks show up when you ask it why, not when you skim.
1
u/Dacusx Oct 20 '26
No. On the contrary, less bugs than ever and faster development.
1
u/Alarmed-Bank2249 Oct 21 '26
We ran into this exact problem with generated tests. What worked was splitting generation and review into two separate agents: one writes the tests, the other only reviews - edge cases, weak assertions, the confident nonsense a single model happily produces. A human still holds the merge button. Coverage went up 17 points in a few months, but the real win was that reviewers started trusting the queue again. Single-agent output without a review step got rejected within a week, and honestly it deserved it.
1
u/nateccs Oct 22 '26
Sounds like a good use for a skill
1
u/ChristianKl Oct 22 '26
When it comes to semantic clones, it's important to frequently run queries to reduce code duplication. You don't need senior devs to do the work to hunt for code duplication but you should not assume that the task specific AI output is good at code reuse.
The same goes for silent concurrency flaws, finding and solving them is a task that the AI can do but needs to be specifically tasked to do so.
1
u/neketguy Oct 22 '26
Recently I removed 36 instances of the same component reimplemented over and over again. They were the same, no difference. We had another one in Design System, Claude ignored it and just copy pasted the component over and over again. Yes, we feel.
1
u/3tt07kjt Oct 20 '26
We use code review and fix these issues before merging, mostly.
If it’s taking you hours to find concurrency issues in code reviews, I think there’s some kind of code style issue. You shouldn’t have concurrency all over the place. It should be contained within high-scrutiny sections. Most of your code should be straight-line.
Humans have a pretty good sense of “there should be a library function for this” and catch it pretty well.
1
u/MzCWzL Oct 20 '26
Public open source projects/repos are not representative of for-profit/corporate work
1
u/bliceroquququq Oct 20 '26
Yes. Claude will always write new code to do a thing rather than understanding and utilizing the existing architecture. It'll cut a brand new road from Point A to Point B despite the fact one already exists.
0
u/Gargle-Loaf-Spunk Oct 20 '26
No