git-worktree-manager
Run parallel Git worktrees without collisions: a port block per worktree, .env sync, health checks for stale or dirty trees, and safe cleanup of merged ones
Install / Use
npx skills add borghei/Claude-Skills --skill git-worktree-managerInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of git-worktree-manager
git-worktree-manager scores 84/100 on our quality scale, 2965th of 4,702 Development & Engineering skills we index.
Its SKILL.md is 6.3 KB long, well organised into 8 sections and no code examples: a thorough specification that gives an agent plenty to work with.
It has 817 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so git-worktree-manager is actively maintained.
- Our last check on 2026-11-06 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
git-worktree-manager compared with similar skills
All 4 of these similar skills score higher than git-worktree-manager; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| git-worktree-manager (this skill)by borghei | 84 | 817 | 57d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 117.6k | 9d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 112.7k | 9d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.3k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.4k | 3d ago | CLAUDE.md |
Frequently asked questions
- How do I install git-worktree-manager?
- Run
npx skills add borghei/Claude-Skills --skill git-worktree-manager. The install tabs above show the steps for each supported agent. - Which AI agents does git-worktree-manager work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is git-worktree-manager safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is git-worktree-manager still maintained?
- The repository was last updated about 2 months ago, so git-worktree-manager is actively maintained.
Skill content
View source on GitHubname: git-worktree-manager description: > Manage parallel development with Git worktrees: creation with port allocation, environment sync, branch isolation, and cleanup. Use when working multiple branches at once, running parallel CI validations, or isolating agent workspaces. license: MIT + Commons Clause metadata: version: 1.1.0 author: borghei category: engineering domain: developer-tooling tier: POWERFUL updated: 2026-06-17 frameworks: git-worktree
Git Worktree Manager
Manage parallel development workflows using Git worktrees with deterministic naming, automatic port allocation, environment file synchronization, dependency installation, and cleanup automation. Optimized for multi-agent workflows where each agent or terminal session owns an isolated worktree with its own ports, environment, and running services.
Core Capabilities
- Worktree lifecycle — create worktrees from new or existing branches with deterministic naming, copy
.envfiles, install dependencies by lockfile detection, list with clean/dirty + ahead/behind status, and safely remove with uncommitted-change detection. - Port allocation — deterministic per-worktree assignment (
base + index * stride), collision detection against running processes, persistent map in.worktree-ports.json, and Docker Compose override generation. - Multi-agent isolation — one branch per worktree, one agent per worktree, no shared state, conflict-free parallel execution, task-ID mapping for traceability.
- Cleanup automation — stale detection by age, merged-branch detection for safe removal, dirty-state warnings, and bulk cleanup with safety confirmations.
When to Use
- You need 2+ concurrent branches open with running dev servers.
- You want isolated environments for feature work, hotfixes, and PR review.
- Multiple AI agents need separate workspaces that do not interfere.
- Your current branch is blocked but a hotfix is urgent.
- You want automated cleanup instead of manual
rm -rfoperations.
Clarify First
Before managing worktrees, confirm these inputs. If any is unknown or vague, ASK — do not assume:
- [ ] Operation — create, list, remove, or clean up worktrees (selects the
worktree_manager.pyaction vsport_allocator.pyvsworktree_validator.py) - [ ] Branch & base — which branch(es) the worktree(s) track and from what base (drives worktree naming and isolation)
- [ ] Port/service needs — whether dev servers or Docker need allocated ports (drives the deterministic port block and the Docker Compose override generated)
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
Tools
| Tool | Purpose | Command |
|------|---------|---------|
| worktree_manager.py | List, create, remove, and clean up worktrees | python scripts/worktree_manager.py list |
| port_allocator.py | Assign/check/release deterministic port blocks; sync registry | python scripts/port_allocator.py status |
| worktree_validator.py | Validate worktree health (stale, missing branch, env parity, port conflicts, lockfile) | python scripts/worktree_validator.py --stale-days 14 |
References
Load the reference that matches the task — keep this file lean and pull detail on demand:
- references/setup-and-ports.md — quick-start
git worktreecommands, the deterministic port-allocation strategy and.worktree-ports.jsonformat, collision-detection snippet, the fullsetup-worktree.shscript, and the Docker Compose per-worktree override. Read when creating a worktree or wiring up ports/services. - references/cleanup-and-workflows.md — the
cleanup-worktrees.shsafe-cleanup script, the multi-agent assignment pattern and rules, the scenario→action decision matrix, and the post-creation validation checklist. Read when automating cleanup or coordinating agents. - references/operations-playbook.md — common pitfalls, best practices, the troubleshooting table, and the success-criteria bar. Read before shipping a workflow or when diagnosing problems.
Scope & Limitations
This skill covers:
- Git worktree lifecycle: creation, listing, status inspection, and removal
- Deterministic port allocation and collision avoidance for parallel dev servers
- Environment file synchronization and Docker Compose override patterns
- Multi-agent workspace isolation strategies and cleanup automation
This skill does NOT cover:
- Git branching strategies or merge conflict resolution (see
pr-review-expertandrelease-manager) - Secret rotation, vault integration, or credential management (see
env-secrets-manager) - CI/CD pipeline configuration or automated test orchestration (see
ci-cd-pipeline-builder) - Monorepo package management, workspace linking, or cross-package dependency resolution (see
monorepo-navigator)
Integration Points
| Skill | Integration | Data Flow |
|-------|-------------|-----------|
| env-secrets-manager | Worktree setup copies .env files that contain secrets managed by this skill | .env files flow from main repo to each worktree; secret references remain consistent across all copies |
| ci-cd-pipeline-builder | CI pipelines can spin up worktrees for parallel test matrix execution | Pipeline config triggers setup-worktree.sh per matrix job; port allocation prevents service collisions |
| release-manager | Release branches get dedicated worktrees for stabilization while feature work continues | Release worktree is created from the release branch; merged status drives cleanup automation |
| monorepo-navigator | In monorepo setups, worktrees must respect package boundaries and shared dependencies | Worktree creation inherits the monorepo root lockfile; package-level dev servers use allocated port blocks |
| pr-review-expert | PR reviews can be performed in isolated worktrees with running code for manual validation | Reviewer creates a worktree at the PR branch, runs the dev server on allocated ports, and removes after review |
| tech-debt-tracker | Stale worktrees and abandoned branches surface as tech debt indicators | Cleanup script output feeds into debt tracking; worktree age and merge status inform priority scores |
Related Skills
taste-skill
117.6kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
112.7kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ai-job-search
72.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
47.4kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
