Agent Skills
› fcakyon/claude-codex-settings
› clean-gone-branches
clean-gone-branches
GitHub清理本地已删除的Git分支。通过fetch prune更新远程引用,识别并处理关联的worktree后删除gone分支,最后报告结果。
Trigger Scenarios
clean gone branches
remove deleted local branches
prune branches removed from remote
Install
npx skills add fcakyon/claude-codex-settings --skill clean-gone-branches -g -y
SKILL.md
Frontmatter
{
"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
-
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.
Version History
- 9d0ce8b Current 2026-07-25 10:34


