Branch Cleanup — Git skill for Claude Code
Clean up merged, stale, and orphaned git branches.
How to install Branch Cleanup
Installs to ~/.claude/commands/kumaran-is-claude-code-onboarding-branch-cleanup.md
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/kumaran-is/claude-code-onboarding/HEAD/.claude/commands/branch-cleanup.md -o ~/.claude/commands/kumaran-is-claude-code-onboarding-branch-cleanup.md Restart Claude Code, or start a new session, for it to be picked up.
What Branch Cleanup does
Clean up merged, stale, and orphaned git branches.
Alternatives in Git
- Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
- Validate Title Provided — if [ -z "$PLAN_TITLE" ]; then echo "❌ Error: Plan title required" echo "Usage: /sync-todos-to-github \"Plan Ti 618 ★
- Create Worktrees — by evmts - Creates git worktrees for all open PRs or specific branches, handling branches with slashes, cleani 440 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Clean Branches
Safely prune merged and stale Git branches: drop dead remote-tracking refs, list merged candidates for review,
Mise Clean
Sweep the project for hygiene cruft — junk tracked in git, backup/scratch files, stale branches and orphaned w
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
Graduate Development
Graduate a completed integration branch (develop- ) to develop. Opens the graduation PR after confirming all s
Sync Develop
Schedule sync with develop branch - adds to TODO, executes at convenient moment (after current task). Use when
Cleanup Worktree
Remove a merged worktree and its branch after verifying it was merged into main
Related Agents
Branch Janitor
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes
Branch Hygiene
MUST be used whenever the user asks to find stale, merged, or orphaned git branches, or asks to review/clean u
Issues Cleanup
Analyze GitHub issues, find stale/duplicate/orphaned, create cleanup plan