git-worktree-manager

Create isolated Git worktrees with deterministic port allocation and environment syncing.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/Patasse97/claude-skills --skill git-worktree-manager-patasse97
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree-manager
Source: https://github.com/Patasse97/claude-skills/tree/main/engineering/git-worktree-manager
Command: npx skills add https://github.com/Patasse97/claude-skills --skill git-worktree-manager-patasse97

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Parallel feature work is hard to manage locally and risks cross-branch contamination. This skill standardizes branch isolation with git worktrees, assigns deterministic ports per worktree, synchronizes environment files, and provides safe cleanup to keep multi-branch local development productive.

Core Features & Use Cases

  • Create and prepare worktrees for new or existing branches with deterministic naming.
  • Auto-allocate non-conflicting ports per worktree and persist assignments in .worktree-ports.json.
  • Copy local environment files (.env* and similar) from the main repo to the new worktree.
  • Optionally install dependencies based on detected lockfiles.
  • Detect stale or dirty worktrees and safely remove outdated ones when merged.
  • Designed for multi-agent workflows where each agent owns a separate worktree.

Quick Start

Create a new worktree for a feature branch and automatically generate port mappings and env sync for immediate development.

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 parallel feature development without cross-branch contamination?

Git worktrees isolate parallel feature development by creating separate working directories for concurrent branches. This skill standardizes branch isolation, assigns deterministic ports per worktree, and synchronizes environment files to prevent cross-branch contamination.

How do I prevent port conflicts when running multiple local development branches simultaneously?

To prevent port conflicts during parallel development, this skill auto-allocates non-conflicting ports per worktree and persists assignments in a .worktree-ports.json file. This ensures multiple concurrent branches run simultaneously without port collisions.

Can I sync environment files across multiple git worktrees automatically?

Yes, you can sync environment files across multiple git worktrees automatically. The skill copies local environment files, such as .env configurations, from the main repository directly into new worktrees during creation to ensure consistent local development setups.

What is the best way to clean up stale or dirty git worktrees after a branch merge?

The best way to clean up stale git worktrees is through safe removal checks that detect outdated or dirty directories after a branch merge. This skill identifies these worktrees and safely removes them to keep multi-branch local development productive.

Does this worktree manager install dependencies for new isolated branches automatically?

Yes, this worktree manager optionally installs dependencies for new isolated branches automatically. It detects project lockfiles during worktree creation and runs the appropriate installation commands to prepare the environment for immediate development.

Can I use git worktrees for multi-agent workflows where each agent owns a separate branch?

Yes, you can use git worktrees for multi-agent workflows where each agent owns a separate branch. This skill is designed specifically for multi-agent environments, providing deterministic port allocation and environment syncing for each concurrent agent.