worktree-manager

Create, launch, and clean up isolated Git worktrees with a global registry.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill worktree-manager-miptah21
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree-manager
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/worktree-manager
Command: npx skills add https://github.com/miptah21/skills --skill worktree-manager-miptah21

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the hassle of creating and coordinating multiple parallel Git worktrees for agent-driven development, including port conflicts and keeping track of what’s running or safe to clean up.

Core Features & Use Cases

  • Global worktree orchestration: Creates, launches, syncs, and cleans up isolated worktrees stored under a centralized base directory, tracking them in a global JSON registry.
  • Port allocation with safety: Allocates per-worktree ports from a global pool and releases them on cleanup to avoid collisions across many concurrent agents.
  • Agent-ready workflows: Copies required runtime resources into each worktree, launches Claude Code (via configurable terminal/shell), and supports PR creation flows that update the registry with PR numbers.

Quick Start

Ask your agent: Create three worktrees for branches feature/auth, feature/billing, and bugfix/login and launch the Claude Code agent in each one with unique ports.

Frequently Asked Questions about worktree-manager

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

FAQPage Schema
How do I manage git worktrees for parallel agent development without port conflicts?▼

You can manage git worktrees by creating isolated environments tracked in a global registry, which automatically allocates unique ports from a centralized pool to prevent conflicts across concurrent agents.

What is the best way to run multiple Claude Code agents in separate git branches simultaneously?▼

The best way is to create isolated git worktrees for each branch, which copies required runtime resources and launches Claude Code in each worktree with unique ports assigned from a global pool.

How does centralized port allocation work when spinning up multiple worktrees?▼

Centralized port allocation assigns each worktree a unique port from a defined pool (8100-8199 by default) and releases the port back to the pool upon worktree cleanup to avoid collisions.

Can I track worktree status and PR numbers across multiple isolated dev environments?▼

Yes, a global JSON registry tracks worktree status, paths, timestamps, assigned ports, and optional PR numbers, syncing entries automatically after manual changes or PR creation flows.

How do I clean up git worktrees after completing parallel development tasks?▼

You clean up git worktrees using deterministic git worktree remove and prune operations, which safely deletes the environment and releases allocated ports back into the global pool.

Do I need a global registry to coordinate concurrent git worktree workflows?▼

A global registry is required to orchestrate parallel git worktrees, maintaining centralized tracking of paths, ports, statuses, and PR numbers to ensure safe cleanup and prevent conflicts.