Cleanup Branches — Development skill for Claude Code
Clean up stale branches after merged PRs.
How to install Cleanup Branches
Installs to ~/.claude/commands/julianoczkowski-notebooklm-mcp-2026-cleanup-branches.md
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/julianoczkowski/notebooklm-mcp-2026/HEAD/.claude/commands/cleanup-branches.md -o ~/.claude/commands/julianoczkowski-notebooklm-mcp-2026-cleanup-branches.md Restart Claude Code, or start a new session, for it to be picked up.
What Cleanup Branches does
Clean up stale branches after merged PRs.
Instructions
You are cleaning up local and remote branches that are no longer needed. Follow these steps in order.
Step 1: List all branches
Run `git branch -a` to see all local and remote branches.
Identify branches that are NOT `master` or `remotes/origin/master` or `remotes/origin/HEAD`.
If there are no extra branches, tell the user everything is clean and stop.
Step 2: Show the user what will be deleted
List the branches grouped by
Alternatives in Development
- Clean Worktree (Interactive) — Interactive cleanup of worktrees: lists merged/stale branches and asks confirmation before deleting 25.5k ★
- Worktree Cleanup — Remove worktrees and branches that have been merged: $ARGUMENTS 23.4k ★
- Shopify CLI Update — Create Shopify CLI PRs after releasing new version of @shopify/cli-hydrogen 2.1k ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Clean Worktree
Clean stale worktrees (pruned, merged, or orphaned branches)
Clean Worktrees
Automatically clean all stale worktrees (pruned refs + merged branches)
Ctx Cleanup
Clean up completed worktrees and branches
Mail Cleanup
/mail-cleanup - Clean the Gmail inbox after an apply cycle
Tidy Branches
Survey local branches and worktrees, delete the ones already merged upstream, and report a short state summary
Just Ship Status
/just-ship-status — Lokalen Repo-Zustand anzeigen (Branches, PRs, Board, Worktrees)
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
Branch Gardener
Triages local branches and stashes in a managed repo (merged, stale, superseded, unpushed) and proposes deleti