What problem does it solve?
When using a dedicated git worktree for pull request diff reviews, leftover uncommitted changes or extra files often block standard worktree removal, leaving unnecessary clutter in your project repository. This Skill automates the cleanup of these PR review worktrees, even when they are dirty or non-empty, eliminating manual deletion hassle and git errors.
Core Features & Use Cases
- Force Cleanup Support: Removes worktrees with uncommitted changes or extra files that would normally block deletion, with an optional no-force mode for strict cleanup requirements.
- Flexible Target Identification: Accepts either the worktree folder name under the project's worktrees/ directory or an absolute filesystem path to the worktree location.
- Safety Guardrails: Restricts cleanup operations only to paths under the project's designated worktrees/ root, preventing accidental deletion of unrelated directories.
- Use Case: After finishing a PR code review in an isolated worktree, use this Skill to instantly clean up the worktree without manually resolving git worktree removal errors or deleting leftover files.
Quick Start
Use the cleanup-pr-diff-worktree skill to remove the PR-123 worktree from your current git project, including any leftover uncommitted files.