git-cleanup

Analyze and remove outdated local Git branches and worktrees.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/iiammae/opero --skill git-cleanup-iiammae
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-cleanup
Source: https://github.com/iiammae/opero/tree/main/.agents/skills/git-cleanup
Command: npx skills add https://github.com/iiammae/opero --skill git-cleanup-iiammae

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, grep, askuserquestion, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Manages and safely removes outdated local Git branches and worktrees, helping users maintain a clean and organized local Git repository.

Core Features & Use Cases

  • Branch Analysis: Safely analyzes and categorizes local Git branches based on their merge status and remote relationships.
  • Branch Cleanup: Removes unnecessary branches by safely deleting them.
  • Worktree Management: Detects and handles stale or outdated Git worktrees.
  • Use Case: Useful for developers with large local Git repositories who need to remove old, inactive branches and worktrees without the risk of losing important code.

Quick Start

Use the /git-cleanup command to start the branch and worktree cleanup process.

Frequently Asked Questions about git-cleanup

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

FAQPage Schema
How do I safely delete outdated local Git branches?

You can safely delete outdated local Git branches by triggering a cleanup process that analyzes branch merge status and remote dependencies, ensuring only branches verified as safe are removed to prevent data loss.

What is the best way to clean up stale Git worktrees?

The best way to clean up stale Git worktrees is to use a dedicated worktree management command that detects outdated worktrees and safely handles their removal alongside local branch cleanup.

How does a Git branch cleanup tool prevent data loss?

A Git branch cleanup tool prevents data loss by performing safety checks that analyze merge status and branch dependencies, categorizing branches before removal to ensure important unmerged code is not deleted.

Can I clean up local Git branches in a large repository?

Yes, you can clean up local Git branches in a large repository. A dedicated branch management tool handles repository organization by analyzing multiple branches and safely removing inactive ones to maintain a clean local state.

Do I need bash to remove local Git branches safely?

Yes, you need bash along with grep to run the safety checks and scripts required to analyze branch dependencies and safely remove local Git branches without losing important code.

When should I not use an automated Git branch cleanup tool?

You should not use an automated Git branch cleanup tool when you have unmerged local branches containing important code, as the tool relies on merge status analysis and might flag active branches as outdated if not properly tracked.