git-cleanup

Categorize local git branches and worktrees as merged, squash-merged, superseded, or active.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps manage and clean up local Git branches and worktrees, preventing clutter and ensuring only necessary branches are kept.

Core Features & Use Cases

  • Categorizes branches: Identifies branches as merged, squash-merged, superseded, or active work.
  • Safety-first approach: Requires explicit user confirmation before any deletion.
  • Handles complex scenarios: Differentiates between safe deletions (-d) and force deletions (-D) for squash-merged branches.
  • Use Case: After completing several features, you can use this Skill to automatically identify and remove all local branches that have already been merged into your main branch, keeping your repository tidy.

Quick Start

Run 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 clean up local git branches that have already been merged?

To clean up merged local git branches, this Skill analyzes your repository and categorizes branches as merged, squash-merged, superseded, or active work. It then provides a gated workflow requiring explicit user confirmation before executing any branch deletions.

What is the difference between deleting squash-merged and fully merged git branches?

Deleting squash-merged git branches differs from fully merged ones because squash merges do not register as standard merges. This Skill identifies squash-merged branches and uses force deletion (`-D`) for them, while applying safe deletion (`-d`) to fully merged branches.

How can I safely remove local git worktrees without deleting active work?

You can safely remove local git worktrees by using this Skill to categorize them as active work or superseded. It ensures active work is protected and requires explicit user confirmation through a gated workflow before removing any superseded worktrees.

Does this git branch cleanup tool require specific tools to run?

Yes, this git branch cleanup tool requires Bash, Read, Grep, and AskUserQuestion tools for execution. These tools allow it to analyze repository metadata, categorize branches, and prompt for user confirmation before deleting anything.

Can I automate git repository management to delete branches without confirmation?

No, you cannot automate branch deletion without confirmation. This Skill uses a safety-first approach that requires explicit user confirmation before executing any deletions, preventing accidental removal of active or unmerged local branches.