git-worktree-clean
Pass
Audited by Gen Agent Trust Hub on Jul 7, 2026
Risk Level: SAFECOMMAND_EXECUTION
Full Analysis
- [COMMAND_EXECUTION]: The skill leverages Git CLI tools to automate the discovery and removal of worktrees.
- It parses repository metadata using
git symbolic-refandgit worktree listto identify active working directories. - It performs file system cleanup using
git worktree removeand branch management withgit branch -dbased on parsed output. - It includes logic to delete remote tracking branches via
git push origin --delete, which is a standard operation for the skill's stated purpose. - [SAFE]: The skill incorporates safety-first design patterns to mitigate the risk of data loss.
- Hardcoded protection for common development branches (main, master, develop, staging, production) prevents accidental deletion of critical environments.
- A
--dry-runmechanism is implemented to allow users to audit the script's intended actions without modifying the repository or remote state. - Default behavior is restricted to merged branches, ensuring that unmerged work requires explicit user confirmation via the
--allflag.
Audit Metadata