git-cleanup

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

1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/rohanbhatia27/rohanstutoring-redesign --skill git-cleanup-rohanbhatia27
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-cleanup
Source: https://github.com/rohanbhatia27/rohanstutoring-redesign/tree/main/.agents/skills/git-cleanup
Command: npx skills add https://github.com/rohanbhatia27/rohanstutoring-redesign --skill git-cleanup-rohanbhatia27

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Bash, Read, Grep, AskUserQuestion, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive solution for analyzing and cleaning up local git branches and worktrees, ensuring a safe and organized repository.

Core Features & Use Cases

  • Branch Analysis: Safely categorizes branches as merged, squash-merged, superseded, or active work.
  • Cleanup Workflow: Offers a step-by-step process to clean up unnecessary branches and worktrees.
  • User Confirmation: Ensures that no destructive actions are taken without explicit user approval.
  • Grouping and Superseding: Identifies related branches and determines which ones are superseded based on PR history.

Quick Start

Run the git-cleanup skill to analyze and clean up your local git branches and worktrees.

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 and worktrees safely?

To clean up local git branches and worktrees safely, this Skill categorizes them as merged, squash-merged, superseded, or active work, requiring explicit user confirmation before deleting anything.

What is the best way to identify superseded git branches based on PR history?

Identifying superseded git branches involves analyzing PR history to group related branches and determine which ones are no longer needed, a process this Skill automates to keep your repository organized.

How do I remove squash-merged local git branches?

Removing squash-merged local git branches is handled by analyzing branch states to distinguish them from active work, ensuring only safe targets are selected for cleanup with user approval.

Does this git cleanup workflow require user confirmation before deleting branches?

Yes, this git cleanup workflow requires explicit user confirmation via AskUserQuestion, ensuring no destructive actions are taken on your local branches or worktrees without direct approval.

Can I use this tool to manage both git branches and worktrees simultaneously?

Yes, you can manage both git branches and worktrees simultaneously, as the Skill analyzes local repository states to categorize and clean up unnecessary worktrees and branches in a single workflow.

What dependencies are needed to analyze and clean up local git worktrees?

Analyzing and cleaning up local git worktrees requires Bash, Read, Grep, and AskUserQuestion dependencies to execute commands, search repository history, and confirm cleanup actions.