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-ref and git worktree list to identify active working directories.
  • It performs file system cleanup using git worktree remove and branch management with git branch -d based 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-run mechanism 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 --all flag.
Audit Metadata
Risk Level
SAFE
Analyzed
Jul 7, 2026, 08:36 AM
Security Audit — agent-trust-hub — git-worktree-clean