Recovery¶
When workflows fail, execution gets stuck, or commits need reverting — these workflows provide structured recovery without losing work.

New in v2.1.0.
/forensics¶
Post-mortem investigation for failed or stuck workflows. Read-only — never modifies project files.
/forensics # interactive — asks what went wrong
/forensics "phase 3 got stuck" # with problem description
What it does:
- Gathers evidence from git history,
.planning/artifacts, and file system state - Analyzes anomalies (stuck loops, missing summaries, state mismatches)
- Determines root cause (execution stuck, context exhaustion, plan deficiency, etc.)
- Writes a structured forensic report to
.planning/reports/
Root cause categories:
| Category | Description | Recovery |
|---|---|---|
| Execution stuck | Agent looped on same files | Re-run with --wave or fix trigger |
| Context exhaustion | Agent ran out of context | Break into smaller plans |
| Session interrupted | Human/system terminated | /resume-work |
| State mismatch | STATE.md doesn't match filesystem | Manual correction |
| Plan deficiency | Plans were wrong | plan-phase --gaps |
| External failure | API/dependency issue | Fix external, re-run |
Output: .planning/reports/FORENSIC-[date].md
Learning checkpoint: reflect
/undo¶
Safe git revert for phase or plan commits. Uses git revert (NEVER git reset) to preserve history.
/undo --last 5 # show last 5 commits, select which to revert
/undo --phase 03 # revert all commits for phase 03
/undo --plan 03-02 # revert all commits for plan 03-02
What it does:
- Gathers candidate commits based on mode
- Checks for downstream dependencies (warns if later commits touch the same files)
- Shows confirmation gate with revert plan
- Executes
git revert --no-commitfor each commit - Creates a single revert commit preserving full history
Safety features:
- Dependency checking before reverting
- Confirmation gate — never auto-reverts
- Preserves git history — reverts are traceable
- Updates STATE.md with revert log
Learning checkpoint: either-or — what led to needing the undo?