How do you undo AI generated code that nobody can explain?
A Reddit discussion highlights the difficulty of removing AI-generated code, especially when its implications aren't immediately clear. While some AI output is easily modifiable, other parts can become deeply integrated into system schemas, tests, and team understanding before their true cost is realized. The conversation seeks examples of the most challenging AI-generated code to undo.
This discussion uniquely focuses on the practical challenges of undoing AI-generated code, unlike most conversations that center on its creation or immediate utility.
Time & source
Times shown in UTC
Display time zone: UTC
Local time zone unavailable; showing UTC.
PublishedOffset at this time: UTC+0Sep 12, 2026, 15:22 UTC
IngestedOffset at this time: UTC+0Sep 12, 2026, 21:01 UTC
- Published
- Sep 12, 2026, 15:22
- Ingested
- Sep 12, 2026, 21:01
- Source type
- Dev community
- Tier
- Community
- Source status
- Healthy
Tier is a per-source editorial setting, not a per-item score.
One thing I think gets missed in all the talk about agent speed is how hard some of the output is to take back out later.
Plenty of it is trivial to change once you know more. Other bits end up wired into the schema, the tests and everyone's mental model of how the thing works, before anybody notices what they are going to cost.
I have run into this with changes that looked completely reasonable at review time. The original call usually wasn't wrong. It was that unpicking it later touched a lot more of the system than the diff ever suggested.
The worst one for us is a caching layer an agent added to our pricing service back in February. It works, it has been in prod for seven months, and nobody on the team can tell you why it invalidates on write instead of on read. Two features built since then depend on the write behaviour.
What would actually have helped is not better code, it is a record of why. We run coderabbit on prs and its summaries are the closest thing we have to one, though they describe what changed rather than what was considered and dropped, which is the half I keep wanting.
The ones that worry me most are the decisions where nobody chose anything. The model picked, the review said fine, and the reason never existed in the first place.
What's the hardest thing you've had to undo that an agent put in?