BehindTheMusicTree

Clean Repos — Git skill for Claude Code

Git community

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

Terminal
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 Repository