Skip to main content
Handbook/Debug/Page 62 · Escalation

Getting Unstuck

Share

Share this page

Pass it to someone who needs it.

Star on GitHub

Key takeaway: Know when to take over

You have been going in circles with your agent on the same bug for an hour. It keeps trying, each attempt sounds just as confident as the last, and none of them work. The hard skill here is not another fix, it is knowing when to stop letting the agent try. This chapter gives you that judgment: when to take over, when to call a human, and when to accept the problem is beyond the tool for now.

The escalation ladder: stop the agent, step in, ask a human, then call a pro.

7.7.1When to stop the agent

An agent has no sense that it is failing. It will cheerfully attempt the same broken idea a tenth time, because nothing in it tracks that the last nine did not work. That meta-judgment is yours, and noticing the point of diminishing returns is the whole job here.

Watch for three signals. It has looped over the same two or three fixes, its context is now full of dead ends so it contradicts itself, or it has stopped reasoning and started guessing. When you see them, stop. Another attempt only buries the real signal deeper.

Stop and take over when: [ ] The same error survives three or more attempts [ ] Each fix trades one error for a new one [ ] It changes lines at random, not by reason [ ] It contradicts what it said a few messages ago [ ] It edits files you never asked it to touch [ ] You no longer understand what it is doing

7.7.2Step in yourself

Taking over does not mean writing the fix by hand. It means reading the actual code around the failure yourself, so you stop guessing along with the agent. A fresh hypothesis, a specific and testable guess at the cause, is usually the exact thing a stuck agent is missing.

Then hand it back a much smaller task. Not "fix the login," but "the token is null here, check whether it is set before this line runs." As the retry-loop chapter covered, starting the agent clean on that narrow task often breaks a loop nothing else could.

Rule of thumb: when you step in, your job is to narrow the problem, not to solve it. A smaller, precise task is usually all the agent needed.

7.7.3When to ask a human

Sometimes both of you are out of ideas, and the answer only lives in a person's head. Bring the specific error and what you already tried to where the experts are: the library's own issue tracker on GitHub, Stack Overflow, or a community for your stack.

Bring one more thing, or you will be ignored: a minimal reproduction, the smallest file or snippet that still shows the failure, with everything else stripped out. Have your agent do the stripping, cutting one piece at a time from the repro you already have and re-running until only the failure is left.

Do it even when you never post it. Minimizing finds the cause more often than the answer does, because the piece you remove that makes the bug disappear is the piece that caused it.

7.7.4Know when it's beyond the tool

A few problems are genuinely beyond what the tool does well right now, and saying so is judgment, not defeat. Sometimes the cost of getting it wrong is high: real money, user data, security, or work you cannot afford to lose. There, an hour of an actual professional is cheap insurance against a very expensive mistake.

Before you burn a day on any hard bug, roll back to the last working state, as the rollback chapter showed, so you are never both stuck and broken. Then, when you do take over, make the agent hand you a clean diagnosis instead of one more guess:

Stop trying to fix this. Step back and act as a senior engineer doing a fresh diagnosis. Treat every fix we already tried as noise; it failed. Based only on the evidence below, state in plain words the single most likely root cause, and why. If you are unsure, say what you do not know and what one piece of information would settle it. Then propose the smallest experiment to confirm or kill that theory: one change, one thing to observe, nothing more. Do not write the full fix. Where I'm stuck:

When the checklist trips, this prompt forces one clean theory instead of another guess:

Ready prompt
Act as a senior engineer taking over a stuck debugging session. Do not attempt a fix yet. Read my debug log, my repro steps, and the architecture map in my rules file first. Restate what is actually broken in one sentence, in terms of what the user sees, and what my spec says should happen instead. Then list what we have already tried and what each attempt ruled out. Then give me your single most likely cause, the one cheapest observation that would confirm or kill it, and what you would try next if it is killed. If the evidence supports no single theory, say so and tell me what to capture instead. Append the theories you ruled out to my debug log, so we never retest them. If you need the full reasoning behind this step, read https://zalt.me/guides/vibe-coding/debug/getting-unstuck The bug, and everything we have tried so far:

Do this now: take the bug you are most stuck on and run the stop-and-take-over checklist against it. If it trips, paste the prompt above to get one clean theory instead of another guess, then carry the fix forward.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Star on GitHubContribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license