mcpbeat

Clean Gone Branches

fcakyon/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".

236 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
955
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/fcakyon/claude-codex-settings --skill clean-gone-branches

The instruction itself

2 sections, as written by the author

Clean Gone Branches

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

Process

  • Update remote references
  • Run git fetch --prune.
  • 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.
  • Remove worktrees first
  • For each [gone] branch that still has a worktree, remove the worktree before deleting the branch.
  • Delete the gone branches
  • Delete each local branch marked as [gone].
  • Report the result
  • List removed worktrees and deleted branches.
  • If there are no [gone] branches, report that nothing needed cleanup.

How to use it

Copy the folder

Take fcakyon/clean-gone-branches from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.