Agent skill

Git Worktree Manager

by borghei in borghei/Claude-Skills

Manage parallel development with Git worktrees: creation with port allocation, environment sync, branch isolation, and cleanup.

MITAuto-check: notesDevelopment

Install Git Worktree Manager

skills CLI
$ npx skills add borghei/Claude-Skills --skill git-worktree-manager -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install borghei/Claude-Skills git-worktree-manager --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineering/git-worktree-manager .claude/skills/git-worktree-manager && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
git-worktree-manager
GitHub stars
874
Token cost
~1.6k tokens
SKILL.md length
687 words
Files
7 (incl. scripts, references)
Skills in repo
364
Repo updated
First seen
Licence
MIT

At a glance

Manage parallel development with Git worktrees: creation with port allocation, environment sync, branch isolation, and cleanup.

  • Working multiple branches at once
  • SKILL.md covers Core Capabilities, When to Use, Clarify First and Tools, plus 3 more sections
  • Runs Python scripts from its folder; calls python and git
  • Running parallel CI validations

What it does

Git Worktree Manager is an agent skill from borghei/Claude-Skills. 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.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `references/cleanup-and-workflows.md`, `references/operations-playbook.md` and `references/setup-and-ports.md`).

It sits in Development, covering Git worktrees. It works with Git and Docker. The repository describes itself as: 385 AI skills, 77 expert agents, and 900 stdlib Python tools for every team: engineering, PM, marketing, C-level, compliance, business ops, research, and a LinkedIn toolkit… The licence is MIT.

When your agent uses it

  • Working multiple branches at once
  • Running parallel CI validations
  • Isolating agent workspaces

Example prompts

  • “/git-worktree-manager”

Requirements

  • Python 3
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit c9a1487. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Git Worktree Manager loads about 1.6k tokens when it runs, and up to ~4.8k if it reads all its reference files. Until then it costs about 64 tokens; SKILL.md has 687 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:23
    ranches with deterministic naming, copy `.env` files, install dependencies by lockfile detection, list with clean/dirty
  • NoteMentions a .env fileSKILL.md:80
    ecrets-manager` | Worktree setup copies `.env` files that contain secrets managed by this skill | `.env` files flow from

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from borghei/Claude-Skills at commit c9a1487, republished under its MIT licence (© borghei). 687 words, ~1,601 tokens.

Download SKILL.mdSave it as .claude/skills/git-worktree-manager/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
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
metadata.author
borghei
metadata.category
engineering
metadata.domain
developer-tooling
metadata.tier
POWERFUL
metadata.updated
2026-06-17
metadata.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 .env files, 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 -rf operations.

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.py action vs port_allocator.py vs worktree_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

ToolPurposeCommand
worktree_manager.pyList, create, remove, and clean up worktreespython scripts/worktree_manager.py list
port_allocator.pyAssign/check/release deterministic port blocks; sync registrypython scripts/port_allocator.py status
worktree_validator.pyValidate 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 worktree commands, the deterministic port-allocation strategy and .worktree-ports.json format, collision-detection snippet, the full setup-worktree.sh script, 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.sh safe-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.
Show full SKILL.md (254 more words)Show less

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-expert and release-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

SkillIntegrationData Flow
env-secrets-managerWorktree 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-builderCI pipelines can spin up worktrees for parallel test matrix executionPipeline config triggers setup-worktree.sh per matrix job; port allocation prevents service collisions
release-managerRelease branches get dedicated worktrees for stabilization while feature work continuesRelease worktree is created from the release branch; merged status drives cleanup automation
monorepo-navigatorIn monorepo setups, worktrees must respect package boundaries and shared dependenciesWorktree creation inherits the monorepo root lockfile; package-level dev servers use allocated port blocks
pr-review-expertPR reviews can be performed in isolated worktrees with running code for manual validationReviewer creates a worktree at the PR branch, runs the dev server on allocated ports, and removes after review
tech-debt-trackerStale worktrees and abandoned branches surface as tech debt indicatorsCleanup script output feeds into debt tracking; worktree age and merge status inform priority scores

© borghei, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in engineering/git-worktree-manager of borghei/Claude-Skills.

  • SKILL.md
  • references/cleanup-and-workflows.md
  • references/operations-playbook.md
  • references/setup-and-ports.md
  • scripts/port_allocator.py
  • scripts/worktree_manager.py
  • scripts/worktree_validator.py

Open the folder on GitHubat commit c9a1487

Compare with similar skills

Git Worktree Manager next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git Worktree Manager compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Worktree Manager this skillborghei/Claude-Skills874—~1.6kAutomated safety check: NotesMIT
Tnr Dev Serverstudie-tech/TheNinjaRPG104—~2.5kAutomated safety check: NotesNone
Superset Project Setupsuperset-sh/superset15k—~577Automated safety check: NotesCustom licence
Polyphonyalinaqi/maggy707—~980Automated safety check: PassMIT
Subwave Worktree Devperminder-klair/subwave1.4k—~2.1kAutomated safety check: NotesMIT
Burla Parallel Dev ClustersBurla-Cloud/burla263—~1.6kAutomated safety check: PassCustom licence

Similar skills

  • Tnr Dev Server

    studie-tech/TheNinjaRPG

    Run a TheNinjaRPG dev server locally from any git worktree, provision disposable test users, and call tRPC endpoints as those users.

    104 GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: notes
  • Superset Project Setup

    superset-sh/superset

    Makes a repository Superset-ready by writing .superset/config.json with setup, teardown and run scripts, then proving it with a real throwaway workspace.

    15k GitHub stars~577 tokensUpdated today
    DevelopmentAuto-check: notes
  • Polyphony

    alinaqi/maggy

    Multi-agent orchestration with container-isolated workspaces — each agent session runs in its own Docker container with independent git branches

    707 GitHub stars~980 tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Subwave Worktree Dev

    perminder-klair/subwave

    Stage a SUB/WAVE git worktree so the dev stack can run from it, then start it.

    1.4k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check: notes
  • Sets up an isolated Burla dev cluster per git worktree so several agents can work in parallel, and explains when to use local-dev or remote-dev.

    263 GitHub stars~1.6k tokensUpdated 15 days ago
    DevelopmentAuto-check passed
  • Devcontainer Dev

    stacklok/toolhive-studio

    Spin up and interact with ToolHive Studio's containerized dev environment (Xvfb + noVNC + DinD).

    170 GitHub stars~3.8k tokensUpdated today
    Agent WorkflowsAuto-check: notes

More from borghei/Claude-Skills

All 364 skills in this repo
  • Agents In The Team

    borghei/Claude-Skills

    Run delivery when AI coding and ops agents take tickets. An agent skill from borghei/Claude-Skills.

    874 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • AI Content Disclosure

    borghei/Claude-Skills

    Check AI-generated marketing content and reviews for required disclosures under the EU AI Act, FTC rules and platform AI-label policies.

    874 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • AI Prototyping

    borghei/Claude-Skills

    Idea to AI-generated prototype to customer validation to engineering handoff.

    874 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Analytics Engineer

    borghei/Claude-Skills

    Analytics engineering across data modeling, dbt, transformation, and semantic layers.

    874 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ansoff Matrix

    borghei/Claude-Skills

    Ansoff Matrix — 4-quadrant framework for growth options: market penetration, market/product development, and diversification.

    874 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Brainstorm Okrs

    borghei/Claude-Skills

    OKR brainstorming and validation using the Radical Focus framework — outcome objectives, measurable key results, counter-metrics.

    874 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Works with

Questions about Git Worktree Manager

What does Git Worktree Manager do?

Manage parallel development with Git worktrees: creation with port allocation, environment sync, branch isolation, and cleanup. Git Worktree Manager is an agent skill from borghei/Claude-Skills. Manage parallel development with Git worktrees: creation with port allocation, environment sync, branch isolation, and cleanup.

When should I use Git Worktree Manager?

Git Worktree Manager fits situations like: working multiple branches at once; running parallel CI validations; isolating agent workspaces.

How do I install Git Worktree Manager in Claude Code?

Run `npx skills add borghei/Claude-Skills --skill git-worktree-manager -a claude-code`. Or copy the skill folder (engineering/git-worktree-manager in borghei/Claude-Skills) into .claude/skills/git-worktree-manager in your project. Claude Code loads it when a task matches its description.

How do I install Git Worktree Manager in Codex?

Run `npx skills add borghei/Claude-Skills --skill git-worktree-manager -a codex`. Or copy the skill folder (engineering/git-worktree-manager in borghei/Claude-Skills) into .agents/skills/git-worktree-manager in your project. Codex loads it when a task matches its description.

Can I use Git Worktree Manager in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add borghei/Claude-Skills --skill git-worktree-manager -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/git-worktree-manager, .gemini/skills/git-worktree-manager, .github/skills/git-worktree-manager and .opencode/skills/git-worktree-manager in your project.

What does Git Worktree Manager need to run?

Going by SKILL.md and its folder, Git Worktree Manager needs Python for the scripts in its folder and the command-line tools its instructions call (python and git). Our summary lists: Python 3; Docker.

Does Git Worktree Manager access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Git Worktree Manager safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Git Worktree Manager use?

Git Worktree Manager is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git Worktree Manager use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.2k tokens, read only when the agent opens those files.

What are the alternatives to Git Worktree Manager?

Skills that share tags, products or a category with Git Worktree Manager: Tnr Dev Server (studie-tech/TheNinjaRPG, 104 stars), Superset Project Setup (superset-sh/superset, 15k stars), Polyphony (alinaqi/maggy, 707 stars) and Subwave Worktree Dev (perminder-klair/subwave, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Worktree Manager?

borghei (a GitHub user) maintains it in borghei/Claude-Skills, which has 874 GitHub stars. The repository holds 364 skills in this directory. The repository was last updated on October 7, 2026.

Source: borghei/Claude-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.