julianoczkowski

Cleanup Branches — Development skill for Claude Code

Development community

Clean up stale branches after merged PRs.

How to install Cleanup Branches

Installs to ~/.claude/commands/julianoczkowski-notebooklm-mcp-2026-cleanup-branches.md

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