Skip to content
alirezarezvani avatar

Git Worktree Manager

Parallel Git worktree setup that isolates branches, ports, and env files for multi-agent or multi-session work.

CCM score
60 of 100
skills.sh installs
609
GitHub stars
30.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers creating worktrees from new or existing branches, allocating ports, copying .env* files, and cleaning up stale trees
  • Includes worktree_manager.py for creation and port persistence and worktree_cleanup.py for stale, dirty, and merged checks
  • Enforces safety rules such as no force-removal of dirty worktrees and no reuse of default ports across branches
  • Designed for teams running several feature or hotfix branches at once, with one agent or terminal session per worktree

Install

$ npx -y skills add alirezarezvani/claude-skills --skill git-worktree-manager -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Git Worktree Manager

Tier: POWERFUL
Category: Engineering
Domain: Parallel Development & Branch Isolation

Overview

Use this skill to run parallel feature work safely with Git worktrees. It standardizes branch isolation, port allocation, environment sync, and cleanup so each worktree behaves like an independent local app without stepping on another branch.

This skill is optimized for multi-agent workflows where each agent or terminal session owns one worktree.

Core Capabilities

  • Create worktrees from new or existing branches with deterministic naming
  • Auto-allocate non-conflicting ports per worktree and persist assignments
  • Copy local environment files (.env*) from main repo to new worktree
  • Optionally install dependencies based on lockfile detection
  • Detect stale worktrees and uncommitted changes before cleanup
  • Identify merged branches and safely remove outdated worktrees

When to Use

Details

Repository
github.com/alirezarezvani/claude-skills
Categories
Git & Releases, DevOps & Cloud, Agent Workflow & Planning
First seen
Jun 3, 2026

Questions

What does the git-worktree-manager skill do?

git-worktree-manager runs parallel feature work safely with Git worktrees. It creates worktrees from new or existing branches, allocates non-conflicting ports per worktree, copies .env files into each one, and cleans up stale or merged worktrees with safety checks.

How do I install git-worktree-manager?

Run npx -y skills add alirezarezvani/claude-skills --skill git-worktree-manager -y inside your project. Once installed, git-worktree-manager lets your agent create and clean up isolated worktrees for each branch or agent session.

Who is git-worktree-manager for?

git-worktree-manager suits developers who need two or more branches open at once or who run several agents on one repo. Each agent or terminal session can own one worktree, so branches never share a working directory or dev server ports.

What does git-worktree-manager need to run?

git-worktree-manager runs its worktree_manager.py and worktree_cleanup.py scripts with Python against a Git repository. Dependency installation is optional and detected from the lockfile in your project.

Where does git-worktree-manager fit among Git & Releases skills?

git-worktree-manager sits in the Git & Releases category, next to triage, git-guardrails-claude-code, setup-pre-commit, caveman-commit and pr. It stands apart by isolating ports, env files and dependencies per worktree, not only managing branches.

More from alirezarezvani/claude-skills

All 259

Similar to Git Worktree Manager

More Git & Releases