clean-gone-branches

Identify and remove local git branches deleted from the remote.

1|1|Updated May 1, 2026
One-click install
npx skills add https://github.com/funsaized/claude-and-codex-settings --skill clean-gone-branches-funsaized
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-gone-branches
Source: https://github.com/funsaized/claude-and-codex-settings/tree/main/plugins/github-dev/skills/clean-gone-branches
Command: npx skills add https://github.com/funsaized/claude-and-codex-settings --skill clean-gone-branches-funsaized

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remove stale local git branches that have been deleted from the remote, keeping your local repo clean and easier to navigate.

Core Features & Use Cases

  • Identify branches marked as [gone] locally and assess worktrees.
  • Remove associated git worktrees before deleting branches.
  • Delete stale local branches and report the cleanup results.

Quick Start

Identify local branches with gone status and remove them after verifying no active worktrees.

Frequently Asked Questions about clean-gone-branches

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

FAQPage Schema
How do I delete local git branches that are gone from the remote?

To delete local git branches marked as gone from the remote, this Skill identifies stale branches, checks for active worktrees, removes them, and safely deletes the branches while generating a final cleanup report.

What is a git worktree and why does it matter when pruning branches?

A git worktree is a linked working directory for a branch. This Skill checks and removes associated worktrees before deleting gone branches to prevent orphaned directories and ensure safe cleanup.

How do I clean up stale git branches in repositories with many short-lived branches?

For repositories with many short-lived branches, this Skill automates the cleanup by targeting only branches marked as gone, verifying worktrees, and safely removing the stale local branches.

Is it safe to prune local branches that no longer exist on the remote?

Yes, pruning gone local branches is safe because the Skill preserves active worktrees and only deletes branches explicitly marked as gone after verifying and clearing their associated worktrees.

Does this branch cleanup process work without additional git dependencies?

Yes, this branch cleanup process works without additional dependencies, using standard git commands to identify gone branches, manage worktrees, and delete the stale local branches while reporting the results.