fleet-tidying-worktrees

Prune spent git worktrees across multiple repositories with dry-run and --fix modes.

125|42|Updated May 19, 2025
One-click install
npx skills add https://github.com/SocketDev/socket-mcp --skill fleet-tidying-worktrees
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fleet-tidying-worktrees
Source: https://github.com/SocketDev/socket-mcp/tree/main/.agents/skills/fleet-tidying-worktrees
Command: npx skills add https://github.com/SocketDev/socket-mcp --skill fleet-tidying-worktrees

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Sweeps across fleets of repositories to remove spent git worktrees that are fully merged into the remote base or gone from the remote with nothing unpushed. Conservative and no-prompt: a dirty worktree or one carrying unpushed commits is always kept, as it may be part of a parallel session’s live work. Use for periodic low-friction fleet maintenance or before cascade waves to clear interrupted-work leftovers. Defaults to a dry-run; pass --fix to apply changes.

Core Features & Use Cases

  • Conservative, fleet-wide pruning of spent worktrees that are safe to remove.
  • Safely preserves live worktrees with unpushed commits or active workflows.
  • Useful for periodic maintenance and pre-cascade cleanup across many repos.

Quick Start

Run the fleet-wide tidying-worktrees routine in dry-run mode to review removals, then run it again with --fix to delete spent worktrees.

Frequently Asked Questions about fleet-tidying-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely prune git worktrees across multiple repos?

To safely prune git worktrees across multiple repos, run a fleet-wide tidying routine that defaults to dry-run mode. It conservatively removes only fully merged or remotely deleted worktrees with no unpushed changes, preserving active ones. Apply changes by passing --fix.

What is the safest way to clean up spent git worktrees before a cascade wave?

The safest way to clean up spent git worktrees before a cascade wave is using a conservative, no-prompt fleet maintenance tool. It automatically preserves dirty worktrees or those with unpushed commits to protect potential parallel session live work.

Does fleet worktree pruning remove active worktrees with unpushed commits?

Fleet worktree pruning does not remove active worktrees with unpushed commits. A defined removability predicate ensures that dirty worktrees or those carrying unpushed changes are always kept, targeting only fully merged or remotely gone worktrees.

Can I preview which git worktrees will be deleted before applying changes?

Yes, you can preview which git worktrees will be deleted because the fleet tidying routine defaults to a dry-run mode. This allows you to review safe removals across your repositories before executing the routine again with --fix to apply changes.

When should I not use automated worktree pruning across my repositories?

You should avoid automated worktree pruning across repositories when parallel sessions might have live work. The conservative predicate keeps dirty worktrees and those with unpushed commits, but manual review is advised if session isolation is unclear.