Git Worktree Manager

Manage Git worktrees with deterministic port allocation and safe cleanup.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/tapanshah/Claude-Skills --skill git-worktree-manager-tapanshah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Worktree Manager
Source: https://github.com/tapanshah/Claude-Skills/tree/main/engineering/git-worktree-manager
Command: npx skills add https://github.com/tapanshah/Claude-Skills --skill git-worktree-manager-tapanshah

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines parallel development by managing multiple Git worktrees, ensuring isolated environments with deterministic port allocation and safe cleanup procedures.

Core Features & Use Cases

  • Worktree Creation: Easily create new worktrees from branches, syncing environment files and optionally installing dependencies.
  • Port Allocation: Automatically assigns non-conflicting ports for services (app, DB, Redis) per worktree.
  • Safe Cleanup: Identifies and helps remove stale, merged, or unused worktrees with safety checks.
  • Use Case: A team needs to work on a new feature, a hotfix, and a PR review simultaneously. This Skill allows each developer to create isolated worktrees for each task, preventing port conflicts and ensuring a clean development environment for each branch.

Quick Start

Use the Git Worktree Manager to create a new worktree for the branch 'feature/new-auth' named 'wt-auth', syncing environment variables and installing dependencies.

Frequently Asked Questions about Git Worktree Manager

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

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

Git worktree management automates parallel development by creating isolated environments with deterministic port allocation for services like app, DB, and Redis. It ensures each branch gets non-conflicting ports, preventing conflicts when running multiple worktrees simultaneously.

How do I safely clean up stale git worktrees and merged branches?

Safe cleanup of stale git worktrees involves detecting uncommitted changes, merged branches, and unused environments. The process includes safety checks to identify removable worktrees and options for safe removal, ensuring no uncommitted work is lost during cleanup.

Can I automatically sync environment files when creating a new git worktree?

Yes, creating a new git worktree can automatically synchronize environment files from your main project. This ensures the isolated development environment has the necessary configuration, and it can optionally install dependencies to make the worktree immediately ready for use.

What is the best way to isolate development environments for multiple git branches?

Isolating development environments for multiple git branches is best achieved using worktrees with deterministic port allocation. This approach assigns unique ports for services per worktree, allowing simultaneous work on features, hotfixes, and reviews without environment contamination.

How do I detect uncommitted changes before removing a git worktree?

Detecting uncommitted changes before removing a git worktree is handled through built-in safety checks. The management process identifies stale worktrees and verifies if uncommitted changes exist, providing options for safe removal to prevent data loss.