branch-cleanup

Identify local git branches safe for deletion by cross-referencing merged and open PRs.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/dgowrie/claude-workflows --skill branch-cleanup-dgowrie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: branch-cleanup
Source: https://github.com/dgowrie/claude-workflows/tree/main/skills/branch-cleanup
Command: npx skills add https://github.com/dgowrie/claude-workflows --skill branch-cleanup-dgowrie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers clean up local git branches by automatically identifying which branches are safe to delete (merged), which should be kept (open PRs), and which require user judgment (stale or WIP branches), guiding the interactive pruning process.

Core Features & Use Cases

  • Interactive local branch cleanup with categorization into Safe to delete (merged PRs), Open PRs to keep, and WIP/no-PR branches.
  • Cross-reference with merged and open PRs via Git and GitHub CLI to determine safe deletion candidates.
  • Step-by-step review and guided execution flow with user confirmation before any deletions or remote pruning.

Quick Start

Ask Claude to review your local branches and guide you through safe deletions.

Frequently Asked Questions about branch-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up local git branches safely?

Local git branch cleanup is handled by cross-referencing merged and open PRs to categorize branches into safe deletions, open PRs to keep, and WIP branches, guiding you through an interactive review before executing any deletes or remote pruning.

What is the best way to identify which git branches are safe to delete?

Identifying branches safe for deletion is done by cross-referencing local branches with merged PRs and open PRs, categorizing them into safe deletions, open PRs to keep, and WIP branches while preserving the current branch.

Can I use this workflow with different base branches and stale local branches?

This interactive workflow applies across varying repo states, including different base branches and stale branches, enforcing safety checks and providing categorized results to guide user confirmation before executing deletes or prunes.

Do I need the GitHub CLI to prune my local git branches?

Cross-referencing merged and open PRs via Git and GitHub CLI is required to determine safe deletion candidates and distinguish them from branches with open PRs that should be kept.

How does interactive branch pruning prevent accidental deletion of my current branch?

Interactive branch pruning prevents accidental deletion by enforcing safety checks that preserve the current branch and by requiring user confirmation before executing any deletes or remote pruning operations.