worktree-cleanup

Remove merged or stale Git worktrees to free disk space.

18|5|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/HomericIntelligence/ProjectOdyssey --skill worktree-cleanup-homericintelligence
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-cleanup
Source: https://github.com/HomericIntelligence/ProjectOdyssey/tree/main/.claude/skills/worktree-cleanup
Command: npx skills add https://github.com/HomericIntelligence/ProjectOdyssey --skill worktree-cleanup-homericintelligence

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps manage disk space and maintain a clean development environment by removing Git worktrees that are no longer needed, especially after branches have been merged.

Core Features & Use Cases

  • Automated Cleanup: Scans for and removes worktrees associated with merged branches.
  • Manual Removal: Provides commands to remove individual worktrees.
  • Use Case: After successfully merging a feature branch into main, you can use this skill to automatically clean up the corresponding worktree, freeing up disk space and decluttering your project.

Quick Start

Run the script to automatically clean up all merged git worktrees.

Frequently Asked Questions about worktree-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 branches, you can run an automated script that scans for and removes worktrees linked to merged branches, freeing up disk space and decluttering your project.

Why do merged git worktrees take up disk space?

Merged git worktrees take up disk space because the linked working directories remain on your system even after the associated branch is deleted. Removing stale worktrees frees up space and maintains project organization.

Can I manually remove a single stale git worktree?

Yes, you can manually remove individual stale git worktrees. The skill provides specific commands to target and delete single worktrees that are no longer needed in your development environment.

Do I need Git installed to automate worktree cleanup?

Yes, you need Git installed and properly configured for your repository to automate worktree cleanup. The skill relies on Git to identify and remove merged or stale worktrees from your project.

What is the best way to remove stale worktrees linked to merged branches?

The best way to remove stale worktrees linked to merged branches is using an automated cleanup script that scans your repository and safely deletes worktrees associated with branches merged into the main branch.