worktree

List, clean, remove, and kill zombie git worktrees.

1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/hirokimry/vibecorp --skill worktree-hirokimry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/hirokimry/vibecorp/tree/main/skills/worktree
Command: npx skills add https://github.com/hirokimry/vibecorp --skill worktree-hirokimry

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing git worktrees manually is error-prone when you need to list active branches, remove merged or stale worktrees, and stop zombie tmux agents left behind after cleanup.

Core Features & Use Cases

  • Worktree inventory: list every worktree with its branch, PR state, and current status.
  • Safe cleanup: remove merged worktrees and isolated agent worktrees only when they have no uncommitted changes or lingering diffs.
  • Zombie process cleanup: detect tmux-based Claude agents whose worktree paths no longer exist and kill only the stale panes.
  • Use case: Keep a busy development machine tidy by pruning merged branches without touching active work, then shutting down orphaned automation sessions.

Quick Start

Ask the skill to list, clean, remove, or kill zombie git worktrees for the current repository.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I clean up merged git worktrees without losing uncommitted changes?

Safe git worktree cleanup requires inspecting uncommitted changes and GitHub PR status before deletion. This skill validates lingering diffs for each worktree and only removes branches that are fully merged and clear of active edits, preventing accidental data loss during branch pruning.

How do I kill zombie tmux agents left behind after deleting git worktrees?

Killing zombie tmux agents involves detecting stale panes tied to non-existent git worktree paths. This skill identifies orphaned tmux-based Claude agents and terminates only those stale panes using the project's zombie-agent script, ensuring no active automation sessions are affected.

What is the best way to list all git worktrees with their PR status?

Listing git worktrees with PR status requires combining local git worktree inspection with GitHub CLI checks. This skill generates a complete worktree inventory displaying every branch, its current PR state, and working directory status, giving you a full overview of your active repository branches.

Does git worktree cleanup work with Claude Code repositories and tmux?

Git worktree cleanup works directly with Claude Code repositories using tmux for agent management. It integrates git worktree inspection, GitHub PR status checks, and tmux pane control to safely remove merged worktrees and kill orphaned automation processes.

Why does manual git branch removal leave behind orphaned tmux panes?

Manual git branch removal leaves orphaned tmux panes because deleting a worktree directory does not automatically terminate associated agent processes. This skill resolves the issue by detecting tmux panes pointing to deleted worktree paths and killing only those stale agent sessions.