macanderson

Prune Stale Branches And Worktrees — Git skill for Claude Code

Git community

Prune stale git branches (merged, abandoned, or older than 30 days with no open PR) and stale git worktrees.

How to install Prune Stale Branches And Worktrees

Installs to ~/.claude/skills/macanderson-agent-harness-prune-stale-branches-and-worktrees/SKILL.md

Terminal
mkdir -p ~/.claude/skills/macanderson-agent-harness-prune-stale-branches-and-worktrees && curl -fsSL https://raw.githubusercontent.com/macanderson/agent-harness/HEAD/commands/prune-stale-branches-and-worktrees.md -o ~/.claude/skills/macanderson-agent-harness-prune-stale-branches-and-worktrees/SKILL.md

Restart Claude Code, or start a new session, for it to be picked up.

What Prune Stale Branches And Worktrees does


description: Prune stale git branches (merged, abandoned, or older than 30 days with no open PR) and stale git worktrees. Shows a plan, confirms, then executes. allowed-tools: Bash, Read, Agent, TodoWrite, ToolSearch, mcp__plugin_github_github__list_pull_requests, mcp__plugin_github_github__list_branches

/prune-stale-branches-and-worktrees

Clean up stale git branches (local + remote) and git worktrees. Always show the plan before deleting anything. Never delete `main`, `develop`, or

Alternatives in Git

  • 使用 Git Worktrees — 创建孤立的 Git worktrees,带有智能目录选择与安全验证 115.1k ★
  • Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
  • OSS PR — Commit + PR workflow for open source contributions: auto-creates a user-prefixed branch when on main/master, t 19.7k ★

Full documentation available on GitHub

View Source Repository