clean-gone-branches

Community

Safely prune local [gone] branches.

Authormixomat
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill automates cleaning local git branches that are no longer present on the remote (marked [gone]), while safely skipping branches with worktrees.

Core Features & Use Cases

  • Identify Gone Branches: Detect local branches with the [gone] status.
  • Safe Cleanup: Delete non-worktree branches using git branch -D.
  • Progress Reporting: Provide per-branch feedback and a final summary.

Quick Start

  • List branches: git branch -v
  • Clean gone branches (without worktrees): git branch -v | grep '\[gone\]' | while read line; do if [[ $line =~ ^[+] ]]; then branch=$(echo "$line" | awk '{print $1}' | sed 's/^+//') echo "Skipping $branch (has worktree - remove worktree first)" else branch=$(echo "$line" | sed 's/^[* ]//' | awk '{print $1}') echo "Deleting branch: $branch" git branch -D "$branch" fi done
  • Report results and note about manual worktree cleanup

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: clean-gone-branches
Download link: https://github.com/mixomat/claude-plugins/archive/main.zip#clean-gone-branches

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository