clean-branch

Categorize Git branches and generate a dry-run cleanup report.

5|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/SteveFeldman/agents-skills --skill clean-branch-stevefeldman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-branch
Source: https://github.com/SteveFeldman/agents-skills/tree/main/skills/clean-branch
Command: npx skills add https://github.com/SteveFeldman/agents-skills --skill clean-branch-stevefeldman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you manage your Git branches by safely identifying and cleaning up merged, stale, or unnecessary branches, keeping your repository tidy.

Core Features & Use Cases

  • Branch Cleanup: Automatically identifies branches that are merged into your main branch.
  • Stale Branch Detection: Flags branches that haven't seen activity for a configurable period.
  • Dry-Run Mode: Provides a report of what would be deleted without making any changes, ensuring safety.
  • Confirmation: Requires explicit user confirmation before executing any deletions.
  • Use Case: After completing a feature, you can use this skill to automatically remove the feature branch once it's merged, preventing clutter.

Quick Start

Run /clean-branch to see a report of branches that can be safely deleted.

Frequently Asked Questions about clean-branch

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

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

To clean up merged git branches safely, use the dry-run mode to generate a report of categorized deletable branches, requiring explicit confirmation before executing any local or remote deletions.

How do I find and delete stale branches in my git repository?

Finding and deleting stale git branches involves flagging inactive branches over a configurable period, categorizing them, and pruning remote tracking references only after user confirmation during the cleanup process.

Can I see what branches will be deleted before removing them?

Yes, you can see what branches will be deleted before removing them by running a dry-run report that categorizes branches into deletable, stale, protected, and active without making any actual changes.

Does git branch cleanup handle both local and remote tracking branches?

Git branch cleanup handles both local and remote tracking branches by identifying merged references, pruning remote tracking branches, and providing recovery notes after executing confirmed repository deletions.

What is the best way to manage git repository maintenance and branch clutter?

The best way to manage git repository maintenance and branch clutter is automated branch categorization, distinguishing active and protected branches from merged or stale ones to ensure safe repository cleanup.

When should I avoid using an automated git branch cleanup tool?

You should avoid using automated git branch cleanup without reviewing the dry-run report if you have unmerged changes, as the tool categorizes branches into protected and active states to prevent data loss.