Skip to content
4 min read

Why is the AI stuck in a loop making the same fix?

Reading progress: 4 min remaining

Three tries at the same bug means a wrong assumption. Five steps that break the loop: restate, plan mode, rule out, make it ask, fresh chat.

Short answer

When the AI makes the same wrong fix three times, it is working from a wrong assumption, and a fourth try will repeat it. Restate what you want in two lines, switch to plan mode for a read-only diagnosis, tell it which approach already failed, and start a fresh chat if the conversation has grown long.

1. Restate the brief in two lines

A stuck agent is often acting on an outdated assumption from earlier in the chat. A short restatement of what you actually want is the cheapest reset.

2. Switch to plan mode

"Switch to plan mode. Don’t change anything. Read the save path end to end and tell me what’s actually causing this, including anything you assumed earlier that turned out to be wrong."

Plan mode is read-only, so the agent can’t patch its way out of thinking. You get a diagnosis you can argue with.

3. Rule out what already failed

If it keeps going back to an approach you rejected, say so: "We already tried X and it didn’t work. Don’t propose it again. Why didn’t it work?"

4. Make it ask instead of guess

"If you’re not sure which of these is happening, ask me. Don’t guess." The agent pauses and asks a real question.

5. Start a fresh chat

If the chat is long and the agent contradicts its own earlier decisions, the context is the problem. Put what matters into Knowledge, open a new chat, and describe the bug in four lines: steps, expected, actual, where.

Frequently asked questions

Will starting a new chat lose my app?

No. Your files are kept with the project, not in the chat. Move anything the agent must remember into Knowledge first, then open a new chat and restate the bug.

Does restarting the preview fix it?

Only when the dev server is wedged: unreachable, stuck on an old bundle, or hung after a dependency change. A build or type error is code, and a restart changes nothing.