HandbookIV the PraetoriumBreaking the agent's loop
IVthe Praetorium, Direct the agentBreaking the agent's loop
In plain words
An agent loop is when each fix breaks something else or the same error keeps returning, and another "try again" only digs the hole deeper.
Where you see it
Forty minutes of clicking "Try to fix" in Lovable while the same error comes back in a slightly different form. Or Cursor fixes login, which breaks sign-up, and fixing sign-up breaks login again.
What goes wrong
- Pressing "Try to fix" for the ninth time
Each attempt is built on top of the last failed one. Three misses in a row is your signal to stop and try something else.
- Saying "still broken" with nothing new
The agent has the same information as last time, so it makes a similar guess. Add something new: the latest error, a log line, what you clicked.
still broken - Keeping the pile of failed fixes
Every attempt leaves code behind. Roll back to the last version that worked, so the next try starts clean.
What to tell your agent
Quick check
Sign in to earn +10 XP for itThe agent has tried to fix the same error five times. What's the best next move?