Skip to main content

clean-git-repo

Stars10
Forks1
UpdatedJuly 23, 2026 at 05:28

Clean up a git repository: delete branches whose PRs merged (incl. squash-merges), remove their safely removable linked worktrees, list or delete local branches past a confirmed age threshold, prune stale remote-tracking refs and worktree metadata, and optionally prune local tags absent from the remote, run gc, or delete merged remote branches. Use when asked to clean up / prune / tidy git branches or worktrees, remove merged or stale branches, delete old branches, prune origin/* refs, or clear out a repo's branch/worktree list, including from a directory containing worktrees from one or more repositories. Reports first (dry run); never touches current/default/kept branches or main, dirty, ignored-content, locked, detached, unavailable, or submodule-containing worktrees.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

File Explorer
2 files
SKILL.md
readonly