claude/git-clean-gone/skills/git-clean-gone/SKILL.md
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 skillsauth add smykla-skalski/sai git-clean-goneInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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>development
Run the council workflow from a normal Copilot session only when the user explicitly asks for council review, multi-persona critique, debate, design review, code review, architecture feedback, UX review, or tradeoff analysis. Do not use it for commit, stage, merge, approval, or generic pre-commit requests. Accept the same mode syntax as the bundled council reviewers: `core|auto|core-eng|core-ux|core-mix|all|debate <problem|@file>`. During council slash-command use, the current session agent moderates reviewer agents directly. Runs broader than 6 reviewers require explicit AskUserQuestion approval before launch.
tools
Use when the user invokes $council, $council:council, Council review, or Council debate. Use loaded SKILL body or one direct installed `skills/council/SKILL.md` read. Direct read path must contain `/.codex/plugins/cache/sai/council/` and end `/skills/council/SKILL.md`. `cd <cwd> && sed -n ... <path>` is valid. Do not use `pwd`, `ls`, `find`, `rg`, `cat`, multiple `&&`, or `;`. Never use repo-local paths. If unavailable, stop exactly `Council not run: skill unavailable.` At most one pre-tool message, exact `Council progress:` line only. Non-final lines start `Council progress:`.
development
Run council reviews with sourced engineering, UX, reliability, performance, AI, and strategy persona lenses. Use when the user asks for council review, multi-persona critique, debate, design review, code review, architecture feedback, UX review, or tradeoff analysis.
development
Use when the user asks for council review, multi-persona critique, debate, design review, code review, architecture feedback, UX review, or tradeoff analysis. Bare invocations use `core` profile auto-detect; explicit `auto` selects the best-fit 6 personas from the sourced 27-persona engineering and UX roster. Users can still pin `core`, `core-eng`, `core-ux`, `core-mix`, `all`, or `debate`.