Git Worktree Isolation
jnMetaCode/superpowers-zh
Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.
Create isolated git workspaces for feature development. An agent skill from xenitV1/claude-code-maestro.
$ npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install xenitV1/claude-code-maestro git-worktrees --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/git-worktrees .claude/skills/git-worktrees && rm -rf skills-srcUse ~/.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/
Install the "git-worktrees" agent skill from https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktrees into .claude/skills/git-worktrees/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktrees", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktreesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install xenitV1/claude-code-maestro git-worktrees --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/git-worktrees .agents/skills/git-worktrees && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "git-worktrees" agent skill from https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktrees into .agents/skills/git-worktrees/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktrees", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install xenitV1/claude-code-maestro git-worktrees --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/git-worktrees .cursor/skills/git-worktrees && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "git-worktrees" agent skill from https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktrees into .cursor/skills/git-worktrees/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktrees", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/xenitV1/claude-code-maestro.git --path skills/git-worktrees--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install xenitV1/claude-code-maestro git-worktrees --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/git-worktrees .gemini/skills/git-worktrees && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "git-worktrees" agent skill from https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktrees into .gemini/skills/git-worktrees/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktrees", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install xenitV1/claude-code-maestro git-worktreesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/git-worktrees .github/skills/git-worktrees && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "git-worktrees" agent skill from https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktrees into .github/skills/git-worktrees/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktrees", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install xenitV1/claude-code-maestro git-worktrees --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/git-worktrees .opencode/skills/git-worktrees && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "git-worktrees" agent skill from https://github.com/xenitV1/claude-code-maestro/tree/main/skills/git-worktrees into .opencode/skills/git-worktrees/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktrees", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
git-worktreesCreate isolated git workspaces for feature development. An agent skill from xenitV1/claude-code-maestro.
Git Worktrees is an agent skill from xenitV1/claude-code-maestro. Create isolated git workspaces for feature development. Smart directory selection, safety verification, and cross-platform support (Windows/Unix).
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Git worktrees. It works with Git. The licence is MIT.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 924315b. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditGlobGrepBashFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitnpmpytestcargogoFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git and npm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Git Worktrees loads about 2.1k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 627 words of instructions outside code blocks.
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.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Read, Write, Edit, Glob, Grep, BashAutomated 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); files beside SKILL.md are not scanned.
The full file from xenitV1/claude-code-maestro at commit 924315b, republished under its MIT licence (© xenitV1). 627 words, ~2,149 tokens.
.claude/skills/git-worktrees/SKILL.md (or your agent's skills folder).<domain_overview>
Philosophy: Isolation prevents contamination. Work on features without affecting the main workspace. Systematic directory selection + safety verification = reliable isolation. ISOLATION INTEGRITY MANDATE (CRITICAL): Never create worktrees in directories that are not explicitly ignored by Git. AI-generated workflows often fail by polluting the primary repository with tracked worktree data. You MUST verify that the destination directory is within
.gitignorebefore execution. Furthermore, you MUST ensure a 'Clean Baseline' by running tests before starting any feature work in a new worktree to avoid cross-contamination of artifacts. </domain_overview>
<directory_selection>
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching. Benefits:
Use before:
@planning-masteryFollow this priority order:
Unix/macOS:
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # AlternativeWindows (PowerShell):
if (Test-Path ".worktrees") { ".worktrees" }
elseif (Test-Path "worktrees") { "worktrees" }If found: Use that directory. If both exist, .worktrees wins.
grep -i "worktree.*director" CLAUDE.md 2>/dev/nullIf preference specified: Use it without asking.
If no directory exists and no CLAUDE.md preference:
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. %USERPROFILE%\.config\maestro\worktrees\<project>\ (global location)
Which would you prefer?</directory_selection> <safety_verification>
MUST verify directory is ignored before creating worktree: Unix/macOS:
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/nullWindows (PowerShell):
git check-ignore -q .worktrees 2>$null
if ($LASTEXITCODE -ne 0) {
git check-ignore -q worktrees 2>$null
}If NOT ignored:
No .gitignore verification needed - outside project entirely. </safety_verification> <creation_and_setup>
Unix/macOS:
project=$(basename "$(git rev-parse --show-toplevel)")Windows (PowerShell):
$project = Split-Path -Leaf (git rev-parse --show-toplevel)Unix/macOS:
# Project-local
path=".worktrees/$BRANCH_NAME"
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"
# Or global
path="$HOME/.config/maestro/worktrees/$project/$BRANCH_NAME"
mkdir -p "$(dirname "$path")"
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"Windows (PowerShell):
# Project-local
$path = ".worktrees\$BRANCH_NAME"
git worktree add $path -b $BRANCH_NAME
Set-Location $path
# Or global
$path = "$env:USERPROFILE\.config\maestro\worktrees\$project\$BRANCH_NAME"
New-Item -ItemType Directory -Force -Path (Split-Path $path)
git worktree add $path -b $BRANCH_NAME
Set-Location $pathAuto-detect and run appropriate setup: Cross-platform:
# Node.js
if [ -f package.json ]; then npm install; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Go
if [ -f go.mod ]; then go mod download; fiWindows (PowerShell):
# Node.js
if (Test-Path "package.json") { npm install }
# Python
if (Test-Path "requirements.txt") { pip install -r requirements.txt }
if (Test-Path "pyproject.toml") { poetry install }
# Rust
if (Test-Path "Cargo.toml") { cargo build }
# Go
if (Test-Path "go.mod") { go mod download }Run tests to ensure worktree starts clean:
# Use project-appropriate command
npm test
pytest
cargo test
go test ./...If tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report ready.
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name></creation_and_setup> <audit_and_reference>
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify ignored) |
worktrees/ exists | Use it (verify ignored) |
| Both exist | Use .worktrees/ |
| Neither exists | Check CLAUDE.md → Ask user |
| Directory not ignored | Add to .gitignore + commit |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
When feature work is complete: List worktrees:
git worktree listRemove worktree:
git worktree remove .worktrees/feature-name
# or force if uncommitted changes
git worktree remove --force .worktrees/feature-namePrune stale entries:
git worktree prunegit check-ignore before creating project-local worktreeYou: I'm using the git-worktrees skill to set up an isolated workspace.
[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run npm install]
[Run npm test - 47 passing]
Worktree ready at C:\Users\Dev\myproject\.worktrees\auth
Tests passing (47 tests, 0 failures)
Ready to implement auth featureNever:
@brainstorming - After design approved, before implementation@planning-mastery - When executing plan@planning-mastery - Work happens in this worktree@tdd-mastery - Implementation methodology@verification-mastery - Complete development after all tasksWhen Ralph Wiggum is active:
© xenitV1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/git-worktrees of xenitV1/claude-code-maestro.
Open the folder on GitHubat commit 924315b
Git Worktrees 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Git Worktrees this skillxenitV1/claude-code-maestro | 229 | — | ~2.1k | Automated safety check: Notes | MIT | |
| Git Worktree IsolationjnMetaCode/superpowers-zh | 8.3k | 1 repos | ~982 | Automated safety check: Pass | MIT | |
| WorktreeAgentsMesh/AgentsMesh | 2.4k | — | ~553 | Automated safety check: Notes | Custom licence | |
| Cursor Composer Task DelegateChachamaru127/claude-code-harness | 3.2k | — | ~4.4k | Automated safety check: Notes | MIT | |
| Git Worktree Setupk8zdev/k8z | 155 | — | ~930 | Automated safety check: Pass | None | |
| New Featuremichaelshimeles/skills | 1.3k | 1 repos | ~699 | Automated safety check: Pass | None |
jnMetaCode/superpowers-zh
Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.
AgentsMesh/AgentsMesh
Creates or reuses an isolated AgentsMesh Git worktree from a verified base branch, preserves existing changes, and optionally starts the worktree-scoped development environment.
Chachamaru127/claude-code-harness
Hands one implementation task to Cursor Composer in an isolated git worktree, then reviews its diff and cherry-picks the result into the main branch.
k8zdev/k8z
Automate git worktree creation and copy private files (not tracked in git) to new workdirs.
michaelshimeles/skills
Start a new task in an isolated Git worktree branched from origin/main so multiple agents can work on the same repo in parallel without conflicts.
vaayne/mori
Use Mori CLI to enable agent-to-agent communication and coordination across Mori-managed panes.
xenitV1/claude-code-maestro
Surgical Debugger & Code Optimizer. An agent skill from xenitV1/claude-code-maestro.
xenitV1/claude-code-maestro
A skill your agent uses when you need to act as an Elite Software Architect (Maestro) to manage complex repositories.
xenitV1/claude-code-maestro
The Foundation Skill. An agent skill from xenitV1/claude-code-maestro.
xenitV1/claude-code-maestro
Elite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.
xenitV1/claude-code-maestro
Design-first methodology. An agent skill from xenitV1/claude-code-maestro.
xenitV1/claude-code-maestro
Master specialized skill for building 2025/2026-grade browser extensions.
Works with
Categories
Create isolated git workspaces for feature development. An agent skill from xenitV1/claude-code-maestro. Git Worktrees is an agent skill from xenitV1/claude-code-maestro. Create isolated git workspaces for feature development.
Git Worktrees fits situations like: tasks that involve Git worktrees.
Run `npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a claude-code`. Or copy the skill folder (skills/git-worktrees in xenitV1/claude-code-maestro) into .claude/skills/git-worktrees in your project. Claude Code loads it when a task matches its description.
Run `npx skills add xenitV1/claude-code-maestro --skill git-worktrees -a codex`. Or copy the skill folder (skills/git-worktrees in xenitV1/claude-code-maestro) into .agents/skills/git-worktrees in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xenitV1/claude-code-maestro --skill git-worktrees -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-worktrees, .gemini/skills/git-worktrees, .github/skills/git-worktrees and .opencode/skills/git-worktrees in your project.
Going by SKILL.md and its folder, Git Worktrees needs the command-line tools its instructions call (git, npm, pytest, cargo and go). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep, Bash.
SKILL.md contains no URLs. Its commands use git and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Git Worktrees is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Git Worktrees: Git Worktree Isolation (jnMetaCode/superpowers-zh, 8.3k stars), Worktree (AgentsMesh/AgentsMesh, 2.4k stars), Cursor Composer Task Delegate (Chachamaru127/claude-code-harness, 3.2k stars) and Git Worktree Setup (k8zdev/k8z, 155 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
xenitV1 (a GitHub user) maintains it in xenitV1/claude-code-maestro, which has 229 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on January 24, 2026.
Source: xenitV1/claude-code-maestro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.