Git Clean Gone Branches (Grade A) logo

Git Clean Gone Branches (Grade A)Security-tested development skill for Claude AI. Grade A. Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local

(0)
Daniel NikulshynReviewed by Daniel Nikulshyn·Updated July 2026

Overview

Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated worktrees for branches that have them. The tool works in three steps: discover gone branches by fetching the latest remote state, present the branches for confirmation, and delete confirmed branches while handling associated worktrees. It's a security-tested development skill for Claude AI, graded A.

Key features

  • Discover gone branches
  • Present branches for confirmation
  • Delete confirmed branches
  • Handle associated worktrees
  • Prune local branches

Pricing

Model
Free
Category
Skills
Rating
No reviews yet

Use cases

Cleaning up stale branches

Use the tool to remove local branches that no longer have a remote counterpart, keeping the repository tidy.

Automating branch maintenance

Integrate the tool into development workflows to automate the process of cleaning up gone branches and associated worktrees.

Pros & Cons

Pros

  • Removes stale local branches
  • Handles associated worktrees
  • Simple yes-or-no confirmation
  • Prunes local branches based on remote state

Cons

  • Requires user confirmation for deletion
  • Limited to branches with gone remote tracking
  • No selective branch deletion

Reviews

Sign in to leave a review.

No reviews yet. Be the first!

Q&A

What user interaction is required before branches are removed?

After listing all detected gone branches, the tool prompts the user with a simple yes/no question (e.g., “Delete all of them? y/n”). Deletion proceeds only if the user confirms; otherwise, the process stops without making changes.

Asked by Constantin Ionescu · Sep 16, 2025

Will the tool delete worktrees linked to the stale branches?

Yes. Before removing a branch, the script checks `git worktree list` for any worktree associated with that branch and, if found, removes it with `git worktree remove --force` to ensure no orphaned worktrees remain.

Asked by Esther Adeyemi · Jul 26, 2025

How does Git Clean Gone Branches identify which local branches to delete?

The tool runs a discovery script that first executes `git fetch --prune` to update the remote state, then parses `git branch -vv` for branches marked as `: gone]`, indicating their remote tracking branch has been deleted.

Asked by Frank Müller · Jul 6, 2025

Ask a question

Skills alternatives

Manage Headers (Grade A) logo
Manage Headers (Grade A)Skills

Security-tested development skill for Claude AI. Grade A. Inspects and configures the security headers a Power Pages site sends to browsers — Content Security Policy, frame and clickjacking protection

(0)
Free
Using Git Worktrees (Grade A) logo
Using Git Worktrees (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktre

(0)
Free
Ga4 Bigquery Schema (Grade A) logo
Ga4 Bigquery Schema (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. GA4 BigQuery Export Schema Reference — complete field reference, nested structures, query patterns, and performance tips

(0)
Free
Meta Capi (Grade A) logo
Meta Capi (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Meta Conversions API (CAPI) Setup Reference — architecture, event types, customer information hashing, deduplication, implementation examples, AEM

(0)
Free
Callees (Grade A) logo
Callees (Grade A)Skills

Security-tested development skill for Claude AI. Grade A. Lista o que uma funcao/metodo chama (call graph direto)

(0)
Free
Test Module Name (Grade A) logo
Test Module Name (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Name Haskell test modules after the module under test with a Spec suffix in the same namespace. Use when writing or reviewing Haskell test module

(0)
Free
Board Of Directors (Grade A) logo
Board Of Directors (Grade A)Skills

Security-tested data-ai skill for Claude AI. Grade A. Simulate a 5-member expert board deliberation for major decisions. Use when evaluating plans, architecture choices, feature designs, or any decisi

(0)
Free
Advpl Mvc Avancado (Grade A) logo
Advpl Mvc Avancado (Grade A)Skills

Security-tested development skill for Claude AI. Grade A. MVC avançado via PE (Pontos de Entrada) — adicionar grids customizadas em telas MVC padrão (CNTA300/MATA070/MATA440/MATA460/FINA040 via *STRU)

(0)
Free