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

  1. Turn 1: "Add sorting." (AI works)
  2. Turn 3: "Wait, sort is broken when I filter." (AI patches sort)
  3. Turn 7: "Sorting works but it's very slow now." (AI adds "optimization")
  4. Turn 12: "Sorting is fast but it crashes on empty lists." (AI adds more patches)
  5. 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

  1. The Hard Stop: When you realize you're in a loop, STOP.
  2. Learnings Audit: Identify why the AI is struggling (e.g., bad architecture, missing context).
  3. 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

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.

Stop the iteration death spiral