Skip to content
Back to skills

Clean Gone Branches

ASecurity

This skill should be used when user asks to "clean gone branches", "remove deleted local branches", "prune branches removed from remote", or explicitly invokes "clean-gone-branches".

  • 1,161 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
developmentgogit

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add fcakyon/claude-codex-settings --skill clean-gone-branches --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Gone Branches?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clean Gone Branches
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fcakyon-clean-gone-branches/badge)](https://www.skillsdirectory.com/skills/fcakyon-clean-gone-branches)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clean-gone-branches
description: This skill should be used when user asks to "clean gone branches", "remove deleted local branches", "prune branches removed from remote", or explicitly invokes "clean-gone-branches".
---

# Clean Gone Branches

Remove local git branches that have been deleted from the remote.

## Process

1. **Update remote references**
   - Run `git fetch --prune`.

2. **Inspect local state**
   - Run `git branch -vv` to find branches marked as `[gone]`.
   - Run `git worktree list` to see whether any of those branches still have worktrees.

3. **Remove worktrees first**
   - For each `[gone]` branch that still has a worktree, remove the worktree before deleting the branch.

4. **Delete the gone branches**
   - Delete each local branch marked as `[gone]`.

5. **Report the result**
   - List removed worktrees and deleted branches.
   - If there are no `[gone]` branches, report that nothing needed cleanup.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…