git-cleanup

Analyze local git branches and worktrees, categorizing them as merged, squash-merged, superseded, or active.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/ofelixdev/cc-kit --skill git-cleanup-ofelixdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-cleanup
Source: https://github.com/ofelixdev/cc-kit/tree/main/template/skills/git-cleanup
Command: npx skills add https://github.com/ofelixdev/cc-kit --skill git-cleanup-ofelixdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you safely analyze and clean up local Git branches and worktrees, preventing accidental deletion of active work and streamlining repository management.

Core Features & Use Cases

  • Categorization: Identifies branches as merged, squash-merged, superseded, or active work.
  • Safety First: Requires explicit user confirmation at two distinct gates before any deletion.
  • Group Analysis: Groups related branches by prefix for comprehensive review.
  • Use Case: After a large feature development cycle, use this Skill to identify and safely remove all completed and merged local branches, keeping your repository tidy.

Quick Start

Use the git-cleanup skill to analyze and suggest local git branches for removal.

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 local git branches without losing active work?

Categorize local git branches as merged, squash-merged, superseded, or active work before removal. The process requires explicit user confirmation at two distinct gates prior to executing any deletion commands, ensuring active work is never lost.

How can I identify squash-merged git branches for deletion?

Identify squash-merged git branches through automated analysis that categorizes branch states. The system groups related branches by prefix for comprehensive review and suggests removal only after verifying the branch is safely merged or superseded.

What is the best way to manage local git worktrees after a feature development cycle?

Manage local git worktrees after a feature cycle by analyzing and categorizing them to identify completed work. The system groups related branches by prefix for comprehensive review and requires two-gate user confirmation before safely removing any worktrees.

Does this git branch cleanup process require manual approval before deleting branches?

Yes, this git branch cleanup process requires manual approval. It implements a two-gate confirmation process that requires explicit user interaction at two distinct stages before executing any Git commands for branch or worktree deletion.

Can I group related git branches by prefix for repository cleanup?

Yes, you can group related git branches by prefix for repository cleanup. The analysis groups related branches by prefix for comprehensive review, allowing you to safely identify and remove completed local branches while keeping your repository tidy.