cleanup-branches

Delete merged and stale Git branches with dry-run safety.

2|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/dmzoneill/skills --skill cleanup-branches-dmzoneill
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cleanup-branches
Source: https://github.com/dmzoneill/skills/tree/main/cleanup-branches
Command: npx skills add https://github.com/dmzoneill/skills --skill cleanup-branches-dmzoneill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the tedious process of identifying and deleting merged or stale feature branches in a Git repository, helping to keep your local and remote branches organized.

Core Features & Use Cases

  • Automated Branch Cleanup: Identifies branches that are merged into the main development line or have not been updated in a specified period.
  • Safety Features: Includes a dry_run mode by default to preview deletions and protects critical branches like main, master, and develop.
  • Use Case: After completing several features and merging their corresponding branches, use this Skill to automatically remove the now-redundant branches, preventing clutter and potential confusion.

Quick Start

Run the cleanup-branches skill to see which branches would be deleted without actually deleting them.

Frequently Asked Questions about cleanup-branches

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

FAQPage Schema
How do I clean up merged Git branches automatically?▼

To clean up merged Git branches automatically, use a tool that fetches all branches, identifies merged candidates, and optionally deletes remote branches. This skill automates that process while keeping your repository organized and clutter-free.

Can I preview which Git branches will be deleted before removing them?▼

Yes, you can preview which Git branches will be deleted by running the skill in its default dry-run mode. This safety mechanism lists stale and merged branches scheduled for deletion without actually removing them.

Does the branch cleanup process protect critical branches like main and develop?▼

Yes, the branch cleanup process protects critical branches like main, master, and develop. It includes built-in safety mechanisms to ensure these essential repository branches are never accidentally deleted during automated cleanup.

What is the best way to remove stale remote Git branches that haven't been updated?▼

The best way to remove stale remote Git branches is to use an automated cleanup tool that identifies branches based on age and merge status. This skill fetches branch data and optionally deletes outdated remote branches to prevent clutter.

Do I need any special Git dependencies installed to delete stale branches automatically?▼

No, you do not need any special dependencies installed to delete stale branches automatically. This skill operates independently without external dependencies to fetch, identify, and optionally delete merged and outdated branches.