Skip to main content
Epic-hierarchy orchestration runs each child epic in its own git worktree on a branch named hierarchy-child/<epic-id>. A worktree left behind after its work landed keeps its branch checked out and its directory on disk. verify-worktrees lists the ones whose work has ended. It is read-only: it flags and never deletes, because a worktree could still hold work the bookkeeping has not caught up with. New as a slash command in 0.50.0. The verb existed before, but had no command doc, so it was reachable only by calling the engine directly.
If ${CLAUDE_PLUGIN_ROOT} is empty:

What it reports

It prints one JSON document, { "orphaned": [{ "path", "branch", "epicId", "reasons" }] }. A worktree is flagged for either reason, and reasons names which:
  • epic-archived — the epic the branch is named for is archived;
  • branch-merged — the branch tip is already an ancestor of the current HEAD, whatever the epic’s status says (the case where git branch -d failed with “used by worktree” after the merge).
Only hierarchy-child/* branches are considered; any other worktree is yours and is never listed.

When git cannot list worktrees

Outside a git repository — when git itself answers “not a git repository” — it prints { "orphaned": [] } rather than failing: there are no worktrees there. Any other failure to list them (an older git, dubious ownership, a corrupt repository, git missing from PATH) is refused with git’s own message instead of an empty list.
Requires git 2.36 or later (0.50.0). It reads the NUL-terminated listing, git worktree list --porcelain -z, so a worktree whose path holds a line feed is reported whole rather than truncated at the break. An older git is refused with git’s own message.

Cleaning up a flagged worktree

See Multi-agent hierarchy for how these worktrees are created.