ce-clean-gone-branches

Detect and remove local Git branches absent from the remote.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Manages and removes stale local branches that are no longer present on the remote, ensuring your repository is clean and up to date.

Core Features & Use Cases

  • Branch Cleanup: Identifies and deletes local branches that no longer have a corresponding remote branch.
  • Worktree Removal: Also handles the removal of worktrees associated with the deleted branches.
  • User Confirmation: Asks for user confirmation before deleting any branches to prevent accidental loss of data.
  • Use Case: Ideal for maintaining order in a repository that has seen many updates and deletions.

Quick Start

Run the command to clean up your branches and remove any that have been deleted from the remote: run ce-clean-gone-branches

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 delete local git branches that are no longer on the remote?

To clean up stale local branches, this Skill performs a git fetch and prune operation to detect branches no longer tracked on the remote. It then asks for user confirmation before deleting those local branches to prevent accidental data loss.

What is the best way to clean up stale branches and keep my repository tidy?

The best way to keep your repository tidy is to eradicate unused branches through an automated fetch and prune workflow. This Skill detects branches lacking a corresponding remote branch, removes associated worktrees, and deletes them after user confirmation.

Does branch cleanup also remove git worktrees associated with deleted branches?

Yes, branch cleanup does remove git worktrees associated with deleted branches. When the Skill identifies and removes locally tracked branches that are no longer present on the remote, it handles the removal of linked worktrees as well to maintain a clean repository state.

Do I need external dependencies to remove locally tracked branches that are gone from the remote?

No, you do not need external dependencies to remove locally tracked branches gone from the remote. The Skill assumes a Git environment, uses built-in fetch and prune commands, and requires no additional software to perform its branch cleanup operations.

Why does stale branch removal ask for confirmation before deleting local branches?

Stale branch removal asks for confirmation before deleting local branches to prevent accidental loss of data. This user confirmation step ensures that you have explicit control over which branches are eradicated during the repository synchronization process.