git-cleanup

Audit stale Git resources across local and remote hosts before deletion.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/yandy-r/claude-plugins --skill git-cleanup-yandy-r
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-cleanup
Source: https://github.com/yandy-r/claude-plugins/tree/main/.cursor-plugin/skills/git-cleanup
Command: npx skills add https://github.com/yandy-r/claude-plugins --skill git-cleanup-yandy-r

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Audit and clean up stale git resources — local branches, remote-tracking refs, worktrees, stashes, tags, pull requests, and issues — across local checkouts, GitHub, and GitLab. Before recommending any deletion, the skill cross-references active code and project state to distinguish truly abandoned resources from work-in-progress. Dry-run is the default; destructive actions require --apply plus explicit user confirmation.

Core Features & Use Cases

  • Cross-domain audit: collects state across local and remote repos, ensuring safe cleanup decisions.
  • Phase-driven workflow: performs setup, state collection, active-code checks, user gating, and optional execution with audit trails.
  • Host-aware operations: detects GitHub/GitLab hosts and uses appropriate CLIs or MCP tools, respecting protected branches and open PRs.

Quick Start

Run the git-cleanup skill to perform a safe, dry-run audit of stale resources and review the generated report before applying any destructive actions.

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 and worktrees without deleting work in progress?▼

To safely clean up stale git branches and worktrees, you can audit local and remote state first. This skill cross-references active code and project state to distinguish abandoned resources from work-in-progress before recommending any deletions.

Does the git cleanup process check for protected branches and open pull requests before deleting?▼

Yes, the git cleanup process checks for protected branches and open pull requests. It detects GitHub and GitLab hosts and uses host-aware operations to respect project protections before applying any destructive actions.

How do I audit stale git stashes, tags, and remote-tracking refs across multiple repositories?▼

You can audit stale git stashes, tags, and remote-tracking refs by running a cross-domain collection across local checkouts, GitHub, and GitLab. This generates a detailed audit report verifying activity and protection state before execution.

What is the best way to prune abandoned pull requests and issues on GitHub or GitLab?▼

The best way to prune abandoned pull requests and issues is to perform a phase-driven audit that collects state and checks for activity. Dry-run is enforced by default, requiring explicit user confirmation before applying any destructive cleanup.

Can I dry-run a git repository cleanup before actually deleting local branches and tags?▼

Yes, you can dry-run a git repository cleanup before deleting local branches and tags. A dry-run is the default mode, generating an audit report for review so you can verify state before explicitly approving destructive actions with an apply flag.