Smell #12: Over-Iteration
Severity: Medium
Over-Iteration: The practice of trying to "fix" an AI's mistakes through endless successive chat turns, often resulting in code that is more complex and less functional than the first attempt.
Symptoms
- Your chat session is longer than 15 turns for a single small feature.
- You find yourself saying "No, that didn't work either" to the AI multiple times.
- Each "fix" introduces a new regression in a feature that was previously working.
- The code is worse after Turn 10 than it was at Turn 2.
Self-Assessment
If you spend more than 30 minutes "fixing" an AI's logic in one chat, you are Over-Iterating.
The "Death Spiral" Pattern
- Turn 1: "Add sorting." (AI works)
- Turn 3: "Wait, sort is broken when I filter." (AI patches sort)
- Turn 7: "Sorting works but it's very slow now." (AI adds "optimization")
- Turn 12: "Sorting is fast but it crashes on empty lists." (AI adds more patches)
- Turn 15: Code is a 200-line "Spaghetti Monster" that no one understands.
Debt Impact
This smell contributes to:
| Debt Category | Impact | |---------------|--------| | 🧠 KNOW | Reasoning is buried in a messy, unusable chat history (Prompt Drift). | | 💸 FIN | Massive token waste from long, redundant chat sessions. | | ⚙️ OPS | Fragile, "over-patched" code fails unpredictably in production. |
How to Fix
- The Hard Stop: When you realize you're in a loop, STOP.
- Learnings Audit: Identify why the AI is struggling (e.g., bad architecture, missing context).
- Reset: Start a fresh chat session with a more precise Clean Prompt.
How to Prevent
- The 3-5 Turn Rule: If it's not working by turn 5, your prompt (or the architecture) is the problem. Reset.
- Manual Intervention: If the AI can't fix a bug in 2 tries, fix it yourself. You are the engineer.
- Small Batches: Break the task into smaller, atomic sub-tasks.
Related Smells
- Smell #2: Prompt Drift — Over-iteration is the process; drift is the result.
- Smell #1: Ambiguous Goal — Vague goals lead to more iterations.
Book Reference
- Chapter 2: Chat Until It Works — the anatomy of the iteration death spiral.
- Chapter 13: Clean Prompts — how to achieve "First Prompt Magic" and avoid loops.