Prune Worktrees — Git skill for Claude Code
Remove git worktrees whose PR has merged, to recover disk (dry-run first).
How to install Prune Worktrees
Installs to ~/.claude/commands/saasy-solutions-mockforge-prune-worktrees.md
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/SaaSy-Solutions/mockforge/HEAD/.claude/commands/prune-worktrees.md -o ~/.claude/commands/saasy-solutions-mockforge-prune-worktrees.md Restart Claude Code, or start a new session, for it to be picked up.
What Prune Worktrees does
allowed-tools: Bash, Read description: Remove git worktrees whose PR has merged, to recover disk (dry-run first)
/prune-worktrees — Reclaim Disk from Merged Worktrees
`/mnt/projects` fills up because each worktree carries ~15-26G of build artifacts. This removes worktrees whose branch's PR has already merged.
Squash-merge aware: because PRs land as squash commits, `git branch --merged` can't see them, so merged-ness is matched against `gh pr list --state merged` head branches (the c
Alternatives in Git
- 使用 Git Worktrees — 创建孤立的 Git worktrees,带有智能目录选择与安全验证 115.1k ★
- Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
- Worktree Parallel Init — Create multiple git worktrees for parallel development: $ARGUMENTS 23.4k ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Prune Stale Branches And Worktrees
Prune stale git branches (merged, abandoned, or older than 30 days with no open PR) and stale git worktrees. S
Clean Garden
Prune merged-PR worktrees and (optionally) create a new one in the same shot
Cards.Management
Cards is a local-first VS Code extension. It groups your plans, transcripts, and commits into project-scoped G
Clean Branches
Safely prune merged and stale Git branches: drop dead remote-tracking refs, list merged candidates for review,
Branch Cleanup
Clean up merged, stale, and orphaned git branches. Protects main/develop/release/ automatically. Supports --dr
Pushcheck Local Gates Before CI
Run every gate the project already declares — prek plus a real (non-dry-run) compile of what changed — before
Related Agents
Tp Session Restorer
PROACTIVELY use this as the FIRST step after /clear, compaction, or a fresh window when a recent session_snaps
Branch Janitor
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes
Unqualify
Remove a qualified skill from this plugin when it has drifted — become redundant, broken, or obsolete. Two-pha