What problem does it solve?
Cleaning up after a merged GitHub PR often leaves behind stale worktrees and both local and remote branches, wasting disk space and confusing future work; this skill performs that cleanup safely and correctly.
Core Features & Use Cases
- PR-merged verification using GitHub CLI: Confirms the PR is truly in the MERGED state (and reads mergedAt) before deleting anything, avoiding false positives caused by squash merges.
- Worktree + branch cleanup with safety contracts: Frees the session from active worktrees, syncs local default branch with fast-forward only, and removes the merged branch and its remote counterpart.
- Multiple removal strategies with robust fallbacks: Uses a rimba post-merge hook fast path when active, otherwise tries rimba removal, and finally falls back to a shell-based probe and
git worktree remove with dirty/unpushed safeguards.
Quick Start
Invoke the workflow by running /swe-workbench:cleanup-merged after your PR is confirmed merged on GitHub, optionally providing the PR number.