# Stuck
<!--
ref: @protocol/stuck
type: protocol
tags: [stuck, debugging, escalation, rescue, thrash, blocked, recovery, judgment]
triggers: [stuck, I'm stuck, going in circles, same error again, tried everything, nothing works, error won't go away, blocked, can't figure out, spinning, thrashing, no progress, keep failing]
trigger_prompt: When progress has stopped and repeated attempts aren't working — the same error keeps coming back, the fix didn't fix, or you've lost the thread of what you're even trying to do. The rescue ladder: cheapest escape first, escalation last, thrash never.
category: core
last_reviewed: 2026-07-05
complements: [@protocol/chunk, @protocol/loop, @protocol/context-quality]
audience: [agent-author, claude-code-user, operator]
version: 4
updated_at: 2026-11-22T08:19:58.818Z
-->

> **Stuck is a state, not a failure. Thrash is the failure.** The moment you notice the same approach failing twice, stop executing and start diagnosing.

The rescue ladder for an agent (or human) whose progress has stopped. Rungs are ordered by cost — climb from the top. Most stucks resolve on rungs 1-3 without new information; the expensive rungs exist for the minority that don't.

## The three-strike rule

**The same approach failing three times means the approach is wrong, not the execution.** Retrying harder, with small variations, is thrash — it burns budget and buries the signal under noise. After strike two, you owe the ladder a climb.

## The ladder

### Rung 0 — Say it

State out loud (in your transcript, your notes, your commit message): *"I am stuck on X. I have tried A and B."* Naming the stuck breaks the thrash loop and forces the inventory that every later rung needs. Cost: one sentence.

### Rung 1 — Actually read the error

Not pattern-match — *read*. Line numbers, the exact identifier, the first error (not the last), the stack frame that's in *your* code. Most "mysterious" failures are a misread or half-read message. If output scrolled past, capture it to a file and read it cold.

### Rung 2 — Reproduce minimally

Strip the failing thing to the smallest case that still fails. Half the time the bug evaporates — which tells you the problem is in what you removed. The other half, you now have a 10-second test loop instead of a 5-minute one.

### Rung 3 — Enumerate assumptions, verify the cheapest two

Write down what you *believe* to be true: "the config is loaded," "this function is being called," "the file I'm editing is the file being run," "the variable contains what I think." Verify the two cheapest with a print/log/inspect. Stuck almost always lives in an unverified assumption — frequently an embarrassing one. (A loop variable named `path` clobbering `$PATH` in zsh has burned better agents than you.)

### Rung 4 — Search for the missing knowledge

You may be stuck because the answer exists and you haven't fetched it. Search your protocol library, grep the codebase for prior art, read the actual docs for the tool that's failing. One targeted search beats ten speculative retries.

### Rung 5 — Change altitude

- **Zoom out:** is the task itself right? Are you solving a problem that a different decision upstream would dissolve? Re-read the goal; check whether the obstacle is worth passing at all.
- **Zoom in:** bisect. Half the input, half the diff, half the pipeline. Find the smallest boundary between working and broken.

### Rung 6 — Fresh eyes

Get a perspective that doesn't share your context contamination (and when you cannot notice you are stuck, an outside trigger has to fire this rung for you: see §An outside reviewer at every stop): spawn a sub-agent with a clean prompt and *only* the facts (not your theories), or write the rubber-duck summary — goal, expected, actual, tried. Writing the summary solves it surprisingly often; if not, you've already drafted rung 7.

### Rung 7 — Escalate well

Escalating is the correct final rung, not a defeat — but earn it with a crisp state summary:

1. **Goal** — what you're trying to accomplish and why.
2. **State** — what's done, what's broken, exact error.
3. **Ruled out** — what you tried, with evidence (this is the valuable part; it saves the human from re-walking your path).
4. **The ask** — the specific decision or information you need. Not "help."

A good escalation is answerable in one message. A bad one ("it doesn't work") costs a round-trip and goodwill.

## An outside reviewer at every stop

**The ladder has a hole: a session climbs it only after noticing it is stuck.** Two kinds of stall cost the most, and neither can be noticed from inside the session:

- **The session stops to wait for input.** It ends its turn on "want me to…?" and counts that as done. It does not feel stuck, so it never reaches rung 0.
- **It goes down a rabbit hole.** Each turn makes local progress on a sub-goal (a score, some wording, one more variation), so the three-strike rule never trips. Reviewing itself does not help, because its own context holds the framing that made the sub-goal look important.

The driver of an unattended fleet misses both as well, because it sees acks and result lines, not transcripts. **So rung 6 has to be fired from outside by a trigger. The stalled session never fires it.**

### The reviewer

The reviewer starts with a fresh context and no tools, and makes one model call. It reads only:

- the mission;
- the project brief;
- the hand-off chain (the titles of earlier session notes, because a session that clears and resumes starts from a prompt that names only its current sub-goal);
- the transcript tail.

It returns one verdict:

| Verdict | Meaning | What it writes |
|---|---|---|
| `CONTINUE` | Stopped, but the next step is obvious and within the session's mandate | The step |
| `UNBLOCK` | Ended on a question it could answer itself, because a reasonable default exists and the step is reversible | The default, plus "proceed" |
| `RABBIT_HOLE` | Recent turns optimise something the mission does not need, or they produced results with no *why* | The drift in one sentence, plus the redirect |
| `NEEDS_HUMAN` | Money, acting as the operator, an irreversible or outward-facing step, or a taste call with no default | One question with a recommended default |
| `DONE` | Finished and reported | Nothing |

### Triggers

- **A stop:** idle at the prompt for 30 min or more, with the transcript changed since the last review.
- **Drift:** busy, with a large number of turns (for example 60) since the last review. Rabbit holes happen while the session is busy, so an idle trigger alone never catches one.

Cap the reviews per pass.

### Point a camera at the driver too

A worker that does what it was ordered is "done" at every stop, even when the orders are the rabbit hole. In a replay of a real overnight run:

- The reviewer correctly unblocked a session that had sat idle for nearly 3 hours on "should I do X next?".
- It correctly left a finished session alone.
- It missed a 4-hour score-settling chase. Every step of that chase had been ordered by the driving agent, and the project's goal card itself asked for a scoreboard win.

Drift is often upstream of the worker. So:

1. Run the same reviewer on the driver's orders for each endeavor: the driver's messages to one worker and the worker's replies, oldest first, checked against that endeavor's goal card.
2. When the reviewer endorses an obvious overfit, read the goal as written: a goal phrased as a score invites a chase for that score.

The driver test, in order: find the main result (the reply that answered, proved or killed the headline question). Classify each later order as SCORE (regrade, grader or fixture patch, re-run, more n, a symmetry fix, a new column) or CAUSE (asks why, asks what a result changes, closes the endeavor). A SCORE order passes only if it names the decision its result would change. "Make the pair symmetric" names none. When most orders after the main result are SCORE orders that name no decision, the verdict is `RABBIT_HOLE`, even if one order also asks for a one-line interpretation at the end.

On the replay, this test flagged the score chase on every run with a small model. A mid-size model excused it every time, because it credited the one order that named a decision. Pick the reviewer model by replaying it on a known miss, not by its size.

### Modes

1. **Flag** is the default. Each verdict is logged and shown to the driver. The driver sends the reviewer's line when it agrees, and records whether it agreed.
2. **Act** sends the line for `CONTINUE`, `UNBLOCK` and `RABBIT_HOLE` without waiting for the driver; the driver gets a one-line notice of each send. Turn it on only after the flag-mode record shows the verdicts match what was actually right, and after fixing what that record shows was wrong. The first flag-mode grades on a real fleet produced four gates that act mode needs:
   - **Dedupe on the pane, not the transcript.** An idle transcript still grows (hooks, system lines), so a line-count check re-flags the same stop every pass. Hash the visible pane, without placeholder text and without status footers that drift on their own.
   - **Gate on the box's paging rate, not on swap used.** A right `UNBLOCK` for heavy work is still wrong while the machine is paging. Hold the whole pass and retry later. If the paging monitor has gone quiet, sample live.
   - **Placeholder text is not input.** A dim prompt suggestion in the input box is neither the operator typing nor a reason to hold. Refuse only real typed text, which a send would concatenate onto.
   - **Cap sends per session per day.** A reviewer and a session that disagree must not loop. Past the cap, the verdict goes back to being a flag.
3. `NEEDS_HUMAN` always goes to a person as one question with a default.

## Anti-patterns

| Pattern | What it looks like | Instead |
|---|---|---|
| **Thrash** | Same fix, small variations, 3+ times | Three-strike rule → climb the ladder |
| **Tool blame** | "The framework/API/model must be broken" | It's almost never the tool. Verify assumptions (rung 3) |
| **Scope-creep escape** | Refactoring unrelated code to feel productive | Stuck on X means work on X or escalate X |
| **Silent stall** | No progress, no statement, budget burning | Rung 0 — say it; unattended, an outside reviewer fires on the stop |
| **Polite stop** | Turn ends on "want me to…?" with a reversible default available | Take the default and proceed; unattended, nobody is there to answer |
| **Premature escalation** | Asking before reading the error | Rungs 1-3 first; escalations carry your ruled-out list |
| **Sunk-cost tunneling** | "One more retry and it'll work" | The retry counter doesn't reset because you feel close |

## When stuck repeats

If the *same kind* of stuck recurs across sessions — same missing knowledge, same environment trap, same ambiguity — that's not a stuck anymore, it's a gap. Capture it: write the protocol, fix the doc, add the convention. A recurring stuck that never becomes an artifact is a loop nobody closed.

---

*Related: `@content/youtube/ai-jason/how-to-install-and-use-claude-code-agent-teams-reverse-engineered` · `@content/youtube/daniel-priestley/why-you-must-stop-selling-your-time-for-money` · `@protocol/example-impulse` · `@protocol/root-cause` · `@protocol/handler`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*