Clean gone branches
Skill fcakyon/claude-codex-settings/plugins/github-dev/skills/clean-gone-branches
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".From its SKILL.md
npx -y skills add fcakyon/claude-codex-settings --skill clean-gone-branchesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- runs commandsInstructs the agent to run 3 commands, including `git fetch --prune` and 2 more.
SKILL.md
0.9 KB, 173 tokens by cl100k_base, as published. Nobody here has run it
Clean Gone Branches
Remove local git branches that have been deleted from the remote.
Process
-
Update remote references
- Run
git fetch --prune.
- Run
-
Inspect local state
- Run
git branch -vvto find branches marked as[gone]. - Run
git worktree listto see whether any of those branches still have worktrees.
- Run
-
Remove worktrees first
- For each
[gone]branch that still has a worktree, remove the worktree before deleting the branch.
- For each
-
Delete the gone branches
- Delete each local branch marked as
[gone].
- Delete each local branch marked as
-
Report the result
- List removed worktrees and deleted branches.
- If there are no
[gone]branches, report that nothing needed cleanup.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.