The recovery toolkit

Most pain in agentic coding doesn't come from preventing failure. It comes from not recognising failure — and feeding the same broken context back into the loop for the next 30 turns. This page teaches you to recognise the signal and pick a move.

Signs the session is poisoned

The earlier you spot these, the cheaper the recovery. Train yourself to notice them in the first two turns of trouble.

Move 1 · Reset

Use when: the agent is going in circles but the task itself is sound. The context is poisoned, not the goal.

How: close the session, start a new one, restate the task in one sentence. Bring forward only the conclusions you've reached — not the failed attempts. "Build X. We've ruled out approach A because of B. Use approach C instead."

Cost: ~2 minutes. The cheapest move. Use it earlier than feels comfortable.

Move 2 · Escalate

Use when: the smaller model is plateauing. You can see it making local edits without understanding the whole picture.

How: switch from Flash → Pro, or Pro → reasoning model. Restate the task. The same prompt to a smarter model often unblocks instantly.

Cost: tokens, mostly. Worth it when the wall-clock cost of staying stuck exceeds the model upgrade cost — usually after 5 minutes of going nowhere.

Move 3 · Drop to vibe

Use when: the agentic loop is failing at a specific step (one tricky function, one weird API). The rest of the work is fine.

How: take the wheel for the messy bit. Drive prompt-by-prompt, one decision at a time, until the path through is clear. Then re-engage the agent to keep going.

Cost: your attention, briefly. The right move when the friction is local, not global.

Move 4 · Write it yourself

Use when: the bug is 10 minutes for a human and 2 hours for an agent. Trust your gut here — you usually know within one turn whether this is one of those bugs.

How: just type the fix. Then hand the finished file back to the agent and ask it to verify your change passes the tests. The agent is great at verification, even when it can't author the fix.

Cost: minutes of your typing. Pays back when the agent would have burned an hour.

The decision tree

  1. Is the goal still right? If no, restart from a fresh spec, not a recovery move.
  2. Is the agent looping or guessing? Reset.
  3. Is the model out of its depth? Escalate.
  4. Is the friction local to one tricky step? Drop to vibe.
  5. Would a human fix this in 10 minutes? Write it yourself.

← Memory & context · Plumbing reference →