| name | restore |
| description | Restore session context from the task checklist — add 'continue' to also resume execution from the first non-closed item |
| argument-hint | Path to task — or 'continue' to resume execution (e.g., docs/tasks/043-harness-redesign continue) |
Restore
Resume long-running work from its data plane. The checklist is the state; restoring is reading it, not reconstructing history. Load context only for incomplete work — completed phases need no re-reading.
Step 0: Parse arguments
$ARGUMENTS carries an optional task path (directory containing requirements.md) and an optional continue flag. No path → auto-detect: find . -name "requirements.md" -path "*/docs/*" -mtime -14 | head -5 plus git log --oneline -10 for recent activity.
Step 1: Read the state, reconcile against git
<task-path>/plan/checklist.json — the resume point is the first phase not closed, first item not done. No checklist → the task predates the manifest pipeline or never reached /build planning; fall back to reading requirements.md and reporting that state.
- Reconcile before trusting: a phase claiming
closed whose commit is absent from git log is stale state — surface it as the resume point, never as completed. Receipts in the state dir (${XDG_STATE_HOME:-$HOME/.local/state}/claude-build/<repo>/<task>/receipts.jsonl) outrank checklist claims; git status --short shows any in-flight working-tree state.
- Read
requirements.md (Done-When + Deferred slices) and tests.manifest.json amendment entries — pending proposed rows are open user decisions and must be surfaced.
Do not read plan payloads for closed phases, results of completed work, or full historical diffs.
Step 2: Report
## Session Resumed
- Closed: [phases with commits confirmed in git log]
- In flight: [first non-closed phase, its last leg per receipts, uncommitted files]
- Open decisions: [proposed amendment rows awaiting ratification]
- Blockers: [open blocker findings, held dependents]
- Next: [the concrete next action]
Without continue: STOP HERE.
Step 3: Continue (only with the flag)
Re-enter /build at the point the state names: an unratified amendment → surface it first; an in-flight phase with a red receipt but no close → resume that phase in-session from the checklist (green leg onward); a closed-but-uncommitted phase → run the close gate and commit; otherwise launch the next ready phase per /build Step 1.