ce-clean-gone-branches

Remove local branches and worktrees deleted from the remote repository.

Updated May 4, 2026
One-click install
npx skills add https://github.com/IAmKongHai/compound-engineering-plugin-zh --skill ce-clean-gone-branches-iamkonghai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ce-clean-gone-branches
Source: https://github.com/IAmKongHai/compound-engineering-plugin-zh/tree/main/3.4.2/skills/ce-clean-gone-branches
Command: npx skills add https://github.com/IAmKongHai/compound-engineering-plugin-zh --skill ce-clean-gone-branches-iamkonghai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps manage and clean up local branches that no longer exist on the remote, along with their associated worktrees, streamlining your repository maintenance.

Core Features & Use Cases

  • Branch Cleanup: Identifies and removes local branches that have been deleted from the remote repository.
  • Worktree Management: Also removes associated worktrees for branches that have them.
  • Use Case: If you have branches that are no longer needed and have been removed from the remote, this Skill can help you clean up your local repository to avoid clutter.

Quick Start

Run the script to clean up gone branches: bash scripts/clean-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 remove local git branches that have been deleted from the remote repository?

To remove local git branches deleted from the remote repository, you can run a branch cleanup script. This identifies stale local branches and removes them to streamline your repository maintenance and avoid clutter.

How do I delete associated worktrees when cleaning up stale local branches?

When cleaning up stale local branches, this worktree management process also removes their associated worktrees. It handles both branch cleanup and worktree removal simultaneously to ensure version control systems remain streamlined.

What is the best way to clean up gone branches and avoid local repository clutter?

The best way to clean up gone branches and avoid local repository clutter is to use an automated script. It identifies local branches that no longer exist on the remote and efficiently removes them along with any associated worktrees.

Do I need git installed to manage worktree removal for deleted remote branches?

Yes, you need git installed to manage worktree removal for deleted remote branches. The script requires git to interact with the repository, identify stale branches, and execute the branch cleanup commands.

Can I use a script to clean up local branches that no longer exist on the remote?

Yes, you can use a script to clean up local branches that no longer exist on the remote. By running the provided bash script, you can efficiently identify and remove stale local branches and their associated worktrees.