git-cleanup

Audit local git branches and worktrees against GitHub pull request state.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the manual burden of auditing stale Git branches and worktrees, helping you safely clean up repositories without deleting anything that is still active, in progress, or protected by pull request state.

Core Features & Use Cases

  • Branch Audit and Cleanup: Checks local branches against GitHub pull requests and upstream tracking state to decide what can be removed automatically and what needs confirmation.
  • Worktree Safety: Protects current branches, default branches, and worktrees with uncommitted changes so cleanup does not break active development.
  • Conservative Repo Maintenance: Supports single-repository cleanup, workspace-wide sweeps, dry-run audits, and optional stack-aware synchronization through sdf when present.
  • Use Case: After a large release cycle, you can review which feature branches were merged, which were abandoned, and which still need attention before deleting them.

Quick Start

Ask Claude to run git cleanup on the current repository so it audits branches, explains the deletion plan, and safely removes only the branches you approve.

Frequently Asked Questions about git-cleanup

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

FAQPage Schema
How do I safely clean up stale Git branches after a release?

Cleaning up stale Git branches involves auditing local branches against GitHub pull request state to classify merged or closed items, then safely deleting approved branches while protecting default and active work.

Can I check local Git branches against GitHub pull requests before deleting them?

Checking local Git branches against GitHub pull requests requires fetching PR state and upstream tracking data to classify branches as merged, closed, or diverged before prompting for deletion.

How do I remove abandoned Git worktrees without losing uncommitted changes?

Removing abandoned Git worktrees safely requires guarding worktrees with uncommitted changes, current branches, and default branches so cleanup prunes only stale worktrees without breaking active development.

Does this Git branch cleanup tool require the gh CLI and git installed?

Git branch cleanup requires both git and gh installed to fetch pull request state, classify branches, and perform guarded deletions and pruning operations across repositories.

What is the best way to audit stale branches across an entire workspace?

Auditing stale branches across a workspace involves running workspace-wide sweeps that check local repositories against GitHub pull request state, using dry-run audits to review deletion plans before removing anything.

Can I do a dry-run audit of Git branches before deleting them?

Performing a dry-run audit of Git branches lets you review which feature branches are merged, abandoned, or need attention, generating a deletion plan without removing any branches.