clean-gone
/clean-gone
Clean up git branches marked as [gone] (deleted on remote but still exist locally). Use when you want to prune stale local branches, remove worktrees for deleted branches, or clean up after PR merges.
- Author
- heyAyushh ↗
- Repository
- stacc ↗
- Licence
- MIT
- Last repository change
- 21.09.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 21.09.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Clean up git branches marked as [gone] (deleted on remote but still exist locally). Use when you want to prune stale local branches, remove worktrees for deleted branches, or clean up after PR merges.
Original author description
Clean up git branches marked as [gone] (deleted on remote but still exist locally). Use when you want to prune stale local branches, remove worktrees for deleted branches, or clean up after PR merges.
How it works
- Steps
- Expected Outcome
SKILL.md preview
---
name: clean-gone
description: Clean up git branches marked as [gone] (deleted on remote but still exist locally). Use when you want to prune stale local branches, remove worktrees for deleted branches, or clean up after PR merges.
---
# Clean Gone Branches
Execute the following to clean up stale local branches deleted from the remote.
## Steps
1. **List branches to identify [gone] status**
```bash
git branch -v
```
Note: Branches with '+' prefix have worktrees that must be removed first.
2. **Identify worktrees for [gone] branches**
```bash
git worktree list
```
3. **Remove worktrees and delete [gone] branches**
```bash
git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do
echo "Processing branch: $branch"
worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}')
if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then
echo " Removing worktree: $worktree"
git worktree remove --force "$worktree"
fi
echo " Deleting branch: $branch"
git branch -D "$branch"
done
```
## Expected Outcome
- List all local branches with status
- Remove worktrees for [gone] branches
- Delete branches marked as [gone]
- Report which worktrees and branches were removed
If no branches are marked as [gone], report that no cleanup was needed.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · heyAyushh/stacc | 100 | MIT |
| rlajous/claude-code-commands | 100 | MIT |
| heyAyushh/stacc | 100 | MIT |
| hakula139/plugins | 85 | MIT |
Identical content appears in 2 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version a796b7f77519 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100clean-branches
Delete local branches whose remote has been deleted ([gone]), including their worktrees. Use for branch cleanup after merging PRs. - 100git-clean-gone-branches
Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated… - 100git-clean-gone-branches
Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated… - 100git-clean-gone-branches
Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated… - 100cleanup-git
Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "delete merged branches", "gone branches", or wants to clean local git state. NOT for creating commits, creating worktrees,… - 100branch-hygiene
Classify and clean up merged, stale, and orphaned git branches and worktrees. Detects squash-merges that git branch --merged cannot see, stale worktrees, and remote-gone branches. Use when user asks to clean up branches, prune worktrees, tidy the repo, or perform git housekeeping.