clean-gone

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

3|1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/heyAyushh/stacc --skill clean-gone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-gone
Source: https://github.com/heyAyushh/stacc/tree/main/configs/commands/skills/clean-gone
Command: npx skills add https://github.com/heyAyushh/stacc --skill clean-gone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill cleans up local Git branches that have been marked as [gone] on the remote, and removes their associated worktrees to keep your repository tidy.

Core Features & Use Cases

  • Branch cleanup: Detects and removes branches labeled [gone] locally.
  • Worktree management: Identifies and removes obsolete worktrees linked to removed branches.
  • Use Case: Ideal after merging PRs or deleting remotes to prune stale branches and reclaim space.

Quick Start

Run the clean-gone skill to prune local branches marked as [gone] and remove 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 delete local git branches that are marked as gone?▼

To delete local git branches marked as gone, you need to prune stale refs and remove the branches. This skill identifies branches labeled [gone] locally and automatically deletes them to keep your repository tidy after remotes are merged or deleted.

How do I remove git worktrees associated with deleted remote branches?▼

Removing git worktrees linked to deleted remote branches requires identifying obsolete worktrees and pruning them. This skill detects worktrees tied to [gone] branches and removes them alongside the branch deletion to reclaim disk space.

What is the best way to clean up stale branches after merging PRs?▼

The best way to clean up stale branches after merging PRs is to prune local refs tracking deleted remotes. This skill automates the cleanup by detecting [gone] branches, removing linked worktrees, and deleting the branches with a final report of actions taken.

Does this branch cleanup tool work with standard git workflows?▼

Yes, this branch cleanup works across typical git workflows where remote branches have been deleted or merged. It requires no additional dependencies and handles standard local refs marked as [gone] and their associated worktrees.

Why are stale local branches still showing after remote deletion?▼

Stale local branches remain after remote deletion because local git refs are not automatically pruned. This skill solves the problem by identifying branches marked [gone], removing their worktrees, and deleting the branches themselves.