cleanup

Clean up Git worktrees by removing merged ones, pruning stale remotes, and rebasing active worktrees onto main.

5|1|Updated Dec 14, 2025
One-click install
npx skills add https://github.com/joshsmithxrm/power-platform-developer-suite --skill cleanup-joshsmithxrm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/joshsmithxrm/power-platform-developer-suite/tree/main/.claude/skills/cleanup
Command: npx skills add https://github.com/joshsmithxrm/power-platform-developer-suite --skill cleanup-joshsmithxrm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean up Git worktrees by removing merged or squash-merged worktrees, prune stale remote refs, and rebase remaining active worktrees onto main to keep the repository tidy and efficient.

Core Features & Use Cases

  • Prunes stale remotes and cleans merged worktrees to prevent clutter in multi-worktree workflows.
  • Safely removes branches after confirmation through merge checks and supports force removal for squash-merged branches.
  • Rebases active worktrees onto main to maintain linear history and reduce conflicts when switching contexts.

Quick Start

Run the cleanup workflow to prune stale remotes, remove merged worktrees, and rebase active worktrees onto main.

Frequently Asked Questions about cleanup

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

FAQPage Schema
How do I clean up Git worktrees after merging branches?

To clean up Git worktrees after merging, you can automate the removal of merged worktrees and prune stale remote refs to keep the repository tidy. This process also includes deleting associated branches safely after verification.

What is the best way to prune stale Git remote references and manage multiple worktrees?

The best way to prune stale Git remote references and manage multiple worktrees is through automated orchestration that removes merged worktrees, prunes remotes, and rebases active worktrees onto main to maintain repository hygiene.

How do I rebase active Git worktrees onto the main branch?

You rebase active Git worktrees onto the main branch by running an automated cleanup workflow that targets active worktrees, applying the rebase to maintain a linear history and reduce conflicts when switching development contexts.

Can I remove squash-merged Git branches safely without losing uncommitted changes?

You can remove squash-merged Git branches safely by using a cleanup process that supports force removal specifically for squash-merged branches. It performs merge checks and requires confirmation before deleting branches to prevent data loss.

Why does my Git repository become cluttered when frequently switching worktree contexts?

Git repositories become cluttered when frequently switching worktree contexts because stale remote refs and merged worktrees accumulate. Automating worktree removal, branch deletion, and remote pruning solves this by maintaining repository efficiency.