ce-clean-gone-branches

Identify and delete local Git branches with deleted remote tracking branches.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/DieStok/ridder_lab_retreat_ai_hackathon_2026 --skill ce-clean-gone-branches-diestok
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ce-clean-gone-branches
Source: https://github.com/DieStok/ridder_lab_retreat_ai_hackathon_2026/tree/main/.agents/skills/compound-engineering/skills/ce-clean-gone-branches
Command: npx skills add https://github.com/DieStok/ridder_lab_retreat_ai_hackathon_2026 --skill ce-clean-gone-branches-diestok

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Clean Gone Branches helps you prune local Git branches whose remote tracking branches no longer exist, including any associated worktrees, to keep your local repository tidy.

Core Features & Use Cases

  • Discover and list local branches that have been removed from the remote.
  • Remove affected worktrees and delete stale branches in a safe, user-confirmed workflow.
  • Use case: after a long-running feature, prune outdated branches to reduce confusion and mental load.

Quick Start

Run the clean-gone script to prune local branches whose remotes are gone.

Frequently Asked Questions about ce-clean-gone-branches

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

FAQPage Schema
How do I prune local Git branches after a remote branch is deleted?

To prune local Git branches, run a script that identifies local branches whose remote tracking branch has been deleted and safely removes them after user confirmation.

Does Git branch cleanup remove associated worktrees?

Yes, Git branch cleanup removes associated worktrees. The process cleans stale local branches and explicitly removes any linked worktrees to ensure a safe, end-to-end repository cleanup.

What is the safest way to delete stale Git branches?

The safest way to delete stale Git branches is using a workflow that prompts for user confirmation before deletion. This prevents accidental data loss while cleaning up outdated local branches.

How do I find local Git branches that no longer exist on the remote?

You can find local Git branches that no longer exist on the remote by discovering and listing branches whose remote tracking counterparts have been deleted, preparing them for safe removal.

Can I automate Git worktree cleanup alongside stale branch deletion?

Yes, you can automate Git worktree cleanup alongside stale branch deletion. The cleanup process identifies affected worktrees and removes them together with the stale local branches in one workflow.