Mav claude code recovery

From thermiteau/maverick · View interactive version

Mav claude code recovery is an AI agent skill from the GitHub repository thermiteau/maverick. Patterns for Claude Code workflow resilience — state persistence, crash recovery, command failure handling, subagent failure handling, and artefact durability. Not about application-level error handling.

How to use this skill

Skill file

Claude Code Error Handling and Recovery

Patterns for making Claude Code workflows resilient to failures. This covers Claude Code's own recovery mechanisms, not error handling in generated application code.

Principles

  1. Persist state early and often — checkpoint progress after each phase so work can be resumed
  2. Post artefacts immediately — designs, plans, and status updates go to GitHub as soon as they are ready, not at the end
  3. Diagnose before retrying — when something fails, understand why before trying again
  4. Verify before continuing — on resume, confirm recorded state matches reality
  5. Isolate failures — subagent failures stay in the subagent; fix via a new subagent, not by polluting the main session

State Persistence

The maverick-task-progress marker on the GitHub issue is the single

state surface for issue-driven work (see

mav-github-issue-workflow): phase, branch, and artefact

comment ids, written via uv run maverick task-progress set after

each milestone completes — never before. Writing after completion means

the marker always reflects a consistent, completed milestone: if a

failure occurs mid-phase, the marker points at the last completed phase

and the incomplete phase re-executes from scratch.

Local files (worktrees, shortlists, diffs) are derivable caches. When a

local artefact and GitHub disagree, GitHub wins.

Artefact Durability

Post artefacts to GitHub immediately after they are produced, via

uv run maverick issue comment post --kind <design|plan|tasks|completion>.

| Artefact | When |

|---|---|

| Solution design | Immediately after design is approved/produced |

| Implementation plan | Immediately after plan is approved/produced |

| Completion summary | After all steps pass verification |

| Blocking questions | When blocked and unable to resolve |

Batching artefacts to the end means a crash loses all intermediate work,

the human has no visibility, and recovery re-does the design/planning.

Crash Recovery (Session Resume)

When starting a session that may be resuming previous work, do not

reconstruct the position by hand:

uv run maverick coord resume-point <repo> <issue>

The command reads the task-progress marker, locates the PR via the

recorded branch, inspects CI and the review verdict, and returns where to

resume with evidence. Then verify the physical prerequisites for that

resume point before acting:

| Check | Command |

|---|---|

| Branch exists locally / remotely | git branch --list $BRANCH / git ls-remote --heads origin $BRANCH |

| Expected commits present | git log --oneline -5 |

| Issue still open | gh issue view $ISSUE --json state -q '.state' |

Common reconciliations: branch on remote but not local → fetch and check

out; branch nowhere but marker says branch → re-create from the story

base; issue closed → check whether a PR already merged (work may be

complete). When resuming, briefly report what was recovered and where you

are continuing from.

For epic recovery — DAG, epic-state, claims, in-flight block walks,

worktree reconciliation — follow mav-durability-on-gh

(cold-start hydration order) and mav-block-propagation

(resume an interrupted walk with uv run maverick bprop run **before any

other epic work**).

Command Failure Handling

When a tool or command fails: read the error output, diagnose the root

cause, then fix — applying the canonical retry budget defined in

mav-plan-execution (two attempts → systematic debugging →

escalate).

Rules

Subagent Failure Handling

When a subagent fails or returns incomplete results:

Rules

<!-- maverick-plugin-version: 5.3.1 -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.