Clean Repos — Git skill for Claude Code
Scan every repo under ~/git/ for branches already merged into trunk (or develop under Gitflow) and worktrees pointing at them, then delete what's confirmed.
How to install Clean Repos
Installs to ~/.claude/skills/behindthemusictree-agent-config-clean-repos/SKILL.md
mkdir -p ~/.claude/skills/behindthemusictree-agent-config-clean-repos && curl -fsSL https://raw.githubusercontent.com/BehindTheMusicTree/agent-config/HEAD/commands/clean-repos.md -o ~/.claude/skills/behindthemusictree-agent-config-clean-repos/SKILL.md Restart Claude Code, or start a new session, for it to be picked up.
What Clean Repos does
description: Scan every repo under ~/git/ for branches already merged into trunk (or develop under Gitflow) and worktrees pointing at them, then delete what's confirmed. model: haiku
Delete local/remote branches already merged into trunk, and worktrees on those branches, across every repo under `~/git/`. All discovery and deletion goes through `scripts/clean-repos.sh`, one call per phase. Always confirm before deleting.
Optional scope: **$ARGUMENTS** — e.g. "only ", "exclude
Alternatives in Git
- Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
- Create Worktrees — by evmts - Creates git worktrees for all open PRs or specific branches, handling branches with slashes, cleani 440 ★
- MiniCode Roadmap — MiniCode already has a usable lightweight terminal coding workflow, but there is still a visible gap between t 388 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Branch Cleanup
Clean up merged, stale, and orphaned git branches. Protects main/develop/release/ automatically. Supports --dr
Clean Branches
Safely prune merged and stale Git branches: drop dead remote-tracking refs, list merged candidates for review,
PR Post Merge
Clean up after a PR is merged — close fork issue, update local branch, delete issue branch
Clean After Merged
Switch to the repo's main branch, pull, and delete the just-merged local branch.
Git.Merge
Merge the current branch's PR, switch to the default branch, and clean up all merged/gone local and remote bra
Prune Stale Branches And Worktrees
Prune stale git branches (merged, abandoned, or older than 30 days with no open PR) and stale git worktrees. S
Related Agents
Branch Janitor
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes
Pipeline Designer
CI/CD 파이프라인 설계자. 빌드→테스트→보안스캔→배포 스테이지를 설계하고, 브랜치 전략(GitFlow, Trunk-based), 트리거 조건, 환경별 배포 전략(Blue-Green, Canary
Branch Hygiene
MUST be used whenever the user asks to find stale, merged, or orphaned git branches, or asks to review/clean u