clean-gone

Remove local git branches marked [gone] and their associated worktrees.

15|6|Updated May 7, 2026
One-click install
npx skills add https://github.com/MinhThang1009/dotclaude --skill clean-gone-minhthang1009
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-gone
Source: https://github.com/MinhThang1009/dotclaude/tree/main/plugins/commit-commands/skills/clean-gone
Command: npx skills add https://github.com/MinhThang1009/dotclaude --skill clean-gone-minhthang1009

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Local Git repositories often accumulate branches deleted on the remote but still present locally, along with unneeded worktrees. This can cause confusion and clutter that slows development.

Core Features & Use Cases

  • Detect local branches labeled [gone] and remove them from the local repository.
  • Identify and remove any associated worktrees to ensure complete cleanup.
  • Use case: a developer prunes a feature branch on the remote and wants to clean up all local remnants in one step.

Quick Start

Run the cleanup to remove all local [gone] branches and their worktrees.

Frequently Asked Questions about clean-gone

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

FAQPage Schema
How do I remove local git branches marked as gone after remote deletion?

To remove local git branches marked as gone, you can run a cleanup process that detects stale local branches reflecting remote deletions and deletes them. This ensures your local repository matches the remote state by clearing out branches that no longer exist upstream.

What are [gone] branches in git and why do they accumulate locally?

[gone] branches are local git branches whose remote counterparts have been deleted, causing them to accumulate locally and clutter your repository. They are labeled [gone] by git when tracking remote branches that no longer exist, creating confusion and slowing development.

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

Yes, branch cleanup can remove git worktrees associated with deleted branches. The process identifies any worktrees linked to [gone] branches and removes them to ensure complete cleanup, handling both branches with and without associated worktrees.

What's the best way to automate git worktree and branch cleanup in one step?

The best way to automate git worktree and branch cleanup in one step is to use a cleanup tool that runs standard git commands to detect, remove worktrees, and delete corresponding [gone] branches. This allows developers to prune all local remnants after a remote branch deletion simultaneously.

Do I need specific git plugins to delete stale local branches and worktrees?

No, you do not need specific git plugins to delete stale local branches and worktrees. The cleanup process requires only standard git commands, specifically git branch and git worktree, to detect and remove branches marked as [gone] and their associated worktrees.