AI Keeps Fixing the Same Bug: How to Escape the Loop
Updated · Tech checked
Stop regenerating: write the repro, test one hypothesis at a time, restore the last working snapshot on the second failure, ask for human help with a packaged report.
The direct answer
Escaping the loop takes four moves: write expected versus actual with steps, test one hypothesis with one check, restore the last working snapshot when the second fix fails, and re-ask with the packaged report. Never send the same message a third time hoping for luck.
Controlled example
Two quantity fields hold "30" and "40": expected 70, actual "3040" because the values join as text. Hypothesis one: inputs read as text. Check: log both types. Fix: convert to numbers before adding, then re-run. If the next fix also fails, restore the snapshot and re-report with the log attached.
Method and mistakes
One variable per test; last change is suspect one; assumptions written down. The loop pattern is regenerate, skim, regenerate, with no written repro and no snapshot.
Frequently asked questions
When should I stop and ask a human? After two failed fixes with a written repro: post the packaged report (steps, logs, last change, tries) in a help channel.
Is the loop my fault? No. It is the normal shape of vague retries; the Module 7 method exists exactly for this.
Sources and review
- Debugging module M07 with the cage and six-line-report labs (this course). Last review: 2026-10-04.