cleanup-worktrees

List and interactively remove old Git worktrees with associated branches and Android emulators.

1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/luigiinred/dotfiles --skill cleanup-worktrees-luigiinred
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-worktrees
Source: https://github.com/luigiinred/dotfiles/tree/main/dot_cursor/skills/cleanup-worktrees
Command: npx skills add https://github.com/luigiinred/dotfiles --skill cleanup-worktrees-luigiinred

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps manage and clean up old or unused Git worktrees and their associated local branches, preventing clutter and ensuring a tidy repository.

Core Features & Use Cases

  • List Worktrees: Displays all Git worktrees, sorted by their last activity timestamp.
  • Interactive Removal: Allows users to select multiple worktrees for deletion.
  • Associated Cleanup: Automatically removes the corresponding local branch (if merged) and any associated Android Virtual Device (AVD) emulator.
  • Use Case: After completing a feature in a separate worktree, use this Skill to easily remove the worktree, delete the feature branch, and clean up the related AVD emulator.

Quick Start

Use the cleanup-worktrees skill to list and remove old git worktrees.

Frequently Asked Questions about cleanup-worktrees

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

FAQPage Schema
How do I clean up old git worktrees and their associated local branches?

To clean up old git worktrees, this skill lists all worktrees sorted by last modification time, allowing you to interactively select and remove them alongside their associated local branches.

Can I remove Android emulators when deleting git worktrees?

Yes, you can remove Android emulators during git worktree cleanup. The skill automatically detects and deletes any associated Android Virtual Device (AVD) emulator linked to the selected worktree.

What is the best way to manage repository hygiene for multiple git worktrees?

The best way to manage repository hygiene for multiple git worktrees is scanning their last activity timestamps and interactively selecting outdated ones for removal alongside their merged local branches.

Does the worktree cleanup process automatically delete unmerged branches?

No, the worktree cleanup process only deletes the corresponding local branch if it has been merged, ensuring you do not lose uncommitted or unmerged work during the interactive removal process.

When should I use an interactive script to remove git worktrees?

You should use an interactive script to remove git worktrees when you have finished a feature in a separate worktree and need to selectively clear the worktree, branch, and emulator to maintain a tidy repository.