# Recover a failed run 1. Read `pipelines inspect ID` (then `--step N` or `--json`), the failed stage's actual input/result, retained tool evidence, artifacts and Git diff. A timeout is not proof of lost work. 2. Separate code failure, environment/setup failure and result-format failure. Missing evidence is not a passing check; a failed result does not erase edits. 3. Fix the specific cause directly or continue the original pipeline from the necessary stage. Preserve completed work and original history. Do not create another pipeline simply to merge a prepared commit. 4. Verify the repair with a focused regression; run broader checks once relevant inputs settle. Do not raise retry/time budgets to hide a reproducible defect. Read the run's `failure_class` first (in `inspect`, `runs`, `wait` and the app's failure line; `stats` counts them): | class | meaning and next action | |---|---| | `quota` | provider usage/balance refused; a Claude window parks instead (below), so this means an exhausted paid balance or a failed park | | `loop_exhausted` | a stage's visit limit or the 30-step cap; fix the cause the loop kept hitting | | `timeout` | a stage attempt ran past its `timeout`; check whether work landed before raising it | | `permission_denied` | the stage's tool use was refused (named in the diagnostic) and it gave up; widen `tools`/write paths or change the task | | `harness_error` | the harness failed (transport, readback, cleanup); a deterministic one was not looped | | `blocked` | a stage deliberately routed to `#failure` (its own outcome); read its handoff | | `environment` | harness missing or signed out, workspace/env/delivery access problems | | `budget` | the run's `--budget`/default run budget (or a stage budget) was spent | | `check_failed` | a verification target or delivery gate check failed | | `canceled`, `interrupted`, `other` | operator cancel, server stop, anything else | A Claude stage refused for a usage limit is never failed and never retried into the limit. The server first switches the Claude home to another saved account with usage left (when that home's auto-switch is on) and runs the visit again; otherwise the run is parked in `waiting_quota` with `quota_wait.resets_at`/ `resume_at` and resumes the same visit a minute after the reset, also after a restart. The visit that runs again is told in `# Previous attempt` that it was interrupted and that partial edits may be in the worktree. Do not retry or cancel a parked run to "unstick" it: `pipelines wait ID` waits through it, `pipelines resume ID --yes` resumes it now (only when the limit is known to be lifted) and `pipelines cancel ID --yes` stops it. While an account is known to be limited, `run`/`retry` under `--json`/`--yes` are refused with the reset time; pass `--defer` to queue the run for the reset or `--now` only when you know the limit is gone. A run's `--budget USD` (or the server's `pipelines run-budget`) warns at 80% and stops at 100% with class `budget`. `pipelines retry ID --yes --json` resumes the failed stage; `--stage KEY [--visit N]` picks a recorded stage, `--input-file FILE|-` merges a bounded JSON correction (shown to the stage as `# Operator correction`), `--version N` a published version of the same pipeline, `--mode=restart` starts at entry (say so). `failed` and `interrupted` runs retry (an interrupted run resumes its unfinished stage or the stage after the last completed one); a `canceled` one needs a new run or direct work on its preserved branch. The retried stage sees a `# Previous attempt` section with the failing stage and diagnostic. Verify the retry's actual stage input, not merely its admission. A clean preparation stage succeeds without an empty commit. A `land` stage with a delivery gate succeeds with a clean checked candidate; the server lands afterward. Read-only, nonvisual work does not require device screenshots. Visual acceptance requires a ready fixture, verified connection and actual captured interactions. Preserve exclusive fixture ownership; inspect tool/process termination before reuse. Stop and await exact owned fixture processes, not just a go-run parent. Do not disrupt another active fixture or restart a shared service over running work. Report the exact blocker and next action briefly. Keep independent work moving.