title: "Anti-Pattern: The Redo Loop" last_updated: 2026-03-21 status: proven difficulty: beginner prerequisites:

  • Basic experience with any agentic coding tool

The Redo Loop

What It Looks Like

The agent generates a component. It's not quite right. You say "try again." Still not right. You say "no, redo it but better." Then "make it more like what I described." Five attempts later, you're frustrated, the context window is bloated, and the output is worse than attempt #1.

Why Developers Do This

It mirrors how you might talk to a person: "not that, try again." It feels faster than articulating what specifically is wrong. There's also hope that the next attempt will magically land on the right answer.

Why It Fails

"Try again" gives the agent zero signal about what to change. Each redo consumes context tokens and pushes the original requirements further from the agent's attention. The agent may change things that were already correct, creating a regression spiral.

The Symptoms

  • Output quality decreasing with each attempt
  • Agent changing parts you liked while missing the actual problem
  • Growing frustration on both sides of the prompt
  • Context window filling with failed attempts

What to Do Instead

Give specific, targeted feedback about what is wrong and what "right" looks like.

# Wrong: vague redo requests
"Try again"
"Make it better"
"That's not what I wanted, redo it"

# Right: specific feedback
"The error handling is good, but change the retry logic to use
exponential backoff starting at 100ms with a max of 3 retries.
Keep everything else as-is."

# Even better: point at the exact issue
"In the fetch wrapper on line 15, replace the fixed 1-second delay
with exponential backoff. The rest of the function is correct."

Treat feedback like a code review comment: be specific about what to change and what to preserve.