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

  • 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 ★
  • Validate Title Provided — if [ -z "$PLAN_TITLE" ]; then echo "❌ Error: Plan title required" echo "Usage: /sync-todos-to-github \"Plan Ti 618 ★

Full documentation available on GitHub

View Source Repository