From git-clean-gone
Clean up local branches with deleted remote tracking and their worktrees. Use after merging PRs to remove stale branches, detect squash-merged and rebased branches, and clean up associated worktrees.
npx claudepluginhub smykla-skalski/sai --plugin git-clean-goneThis skill is limited to using the following tools:
Delete local branches whose remote tracking is gone or merged, and remove their associated worktrees.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Reviews prose for communication issues impeding comprehension, outputs minimal fixes in a three-column table per Microsoft Writing Style Guide. Useful for 'review prose' or 'improve prose' requests.
Delete local branches whose remote tracking is gone or merged, and remove their associated worktrees.
Parse from $ARGUMENTS:
| Flag | Default | Purpose |
|---|---|---|
| (none) | — | Full cleanup: gone + merged branches + worktrees |
--dry-run | off | Preview only, no changes |
--no-worktrees | off | Branches only, skip worktree removal |
git for-each-ref --format="%(upstream:remotename)" refs/heads/main 2>/dev/null || git remote | head -1 2>/dev/null || echo "origin"basename "$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo refs/remotes/origin/main)"command -v gh >/dev/null 2>&1 && echo "available" || echo "unavailable""${CLAUDE_SKILL_DIR}/scripts/clean-gone.sh" as a single Bash invocationExecute "${CLAUDE_SKILL_DIR}/scripts/clean-gone.sh" immediately, passing through any flags from $ARGUMENTS.
--dry-run → preview only, no changes--no-worktrees → gone branches only, no worktree removal or merge detection--dry-run, --no-worktrees), stopParse script output line prefixes and render formatted summary directly as text.
Line prefixes (from script output):
| Prefix | Meaning |
|---|---|
DELETED:branch:reason | Deleted branch |
REMOVED_WT:worktree:branch | Removed worktree |
SKIPPED:branch:reason | Skipped branch |
KEPT:branch:reason | Kept branch |
KEPT_WT:worktree:branch:reason | Kept worktree |
Dry-run uses WOULD_DELETE, WOULD_REMOVE_WT, WOULD_SKIP, WOULD_KEEP, WOULD_KEEP_WT.
Summary format:
**Cleanup Summary**
Deleted:
🗑️ fix/old-feature (gone)
🗂️ fix-old-feature-wt (worktree)
Skipped:
⚠️ feat/current-work (current branch)
Kept:
🗂️ wt-name (worktree) - branch (N unmerged)
ℹ️ feat/in-progress (14 unmerged)
Only include sections with items. Empty state: ✅ Repository already clean — no branches to process
Dry-run header: **Dry Run Preview** with "Would delete/remove" phrasing.
[gone] (remote tracking deleted)git cherry)gh pr list --state merged) when gh CLI is available--force flaggh CLI (see preprocessed context): squash merges won't be detected, only git cherry used/git-clean-gone
</example>
<example>
Preview what would be deleted:
/git-clean-gone --dry-run
</example>
<example>
Branches only, no worktree removal:
/git-clean-gone --no-worktrees
</example>