Using Git Worktrees
farm-fe/farm
A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git…
Use Git worktrees to isolate parallel coding tasks. An agent skill from davidondrej/skills.
$ npx skills add davidondrej/skills --skill git-worktree -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install davidondrej/skills git-worktree --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/davidondrej/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agent-orchestration/git-worktree .claude/skills/git-worktree && 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-worktree" agent skill from https://github.com/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktree into .claude/skills/git-worktree/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktree", 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/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktreeType 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 davidondrej/skills --skill git-worktree -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install davidondrej/skills git-worktree --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/agent-orchestration/git-worktree .agents/skills/git-worktree && 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-worktree" agent skill from https://github.com/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktree into .agents/skills/git-worktree/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktree", 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 davidondrej/skills --skill git-worktree -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install davidondrej/skills git-worktree --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/agent-orchestration/git-worktree .cursor/skills/git-worktree && 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-worktree" agent skill from https://github.com/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktree into .cursor/skills/git-worktree/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktree", 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/davidondrej/skills.git --path skills/agent-orchestration/git-worktree--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 davidondrej/skills --skill git-worktree -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install davidondrej/skills git-worktree --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/agent-orchestration/git-worktree .gemini/skills/git-worktree && 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-worktree" agent skill from https://github.com/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktree into .gemini/skills/git-worktree/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktree", 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 davidondrej/skills git-worktreeInstalls 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 davidondrej/skills --skill git-worktree -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/agent-orchestration/git-worktree .github/skills/git-worktree && 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-worktree" agent skill from https://github.com/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktree into .github/skills/git-worktree/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktree", 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 davidondrej/skills --skill git-worktree -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install davidondrej/skills git-worktree --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/agent-orchestration/git-worktree .opencode/skills/git-worktree && 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-worktree" agent skill from https://github.com/davidondrej/skills/tree/main/skills/agent-orchestration/git-worktree into .opencode/skills/git-worktree/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "git-worktree", 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-worktreeUse Git worktrees to isolate parallel coding tasks. An agent skill from davidondrej/skills.
Git Worktree is an agent skill from davidondrej/skills. Use Git worktrees to isolate parallel coding tasks. Use when setting up a task checkout, working in a shared repo, or managing existing worktrees.
Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).
It sits in Agent Workflows, covering Git worktrees. It works with Git. The repository describes itself as: access to david ondrej's personal agent skills. The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit ea32e5f. It shows what the files ask for, not the result of running them.
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.
Shell commands in SKILL.md call:
gitnpmpnpmuvbundleFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, npm, pnpm and uv, 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 Worktree loads about 1.1k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 455 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.
1. **Env/secret files** — copy `.env`, `.env.local`, and similar files from the primary checkout. Never symlink them: ed"cp $ROOT_WORKTREE_PATH/.env.local .env.local"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); files beside SKILL.md are not scanned.
The full file from davidondrej/skills at commit ea32e5f, republished under its MIT licence (© davidondrej). 455 words, ~1,098 tokens.
.claude/skills/git-worktree/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Detect where you are before editing:
[ "$(git rev-parse --path-format=absolute --git-dir)" = "$(git rev-parse --path-format=absolute --git-common-dir)" ] \
&& echo "primary checkout" || echo "worktree"cd into it before editing.Worktrees have separate working files and branches but share Git history, stashes, config, and refs.
git worktree add ../myrepo-task-x # new worktree + branch "myrepo-task-x"
git worktree add ../fix-y -b fix-y main # explicit branch off main
git worktree list # see all worktrees
git worktree remove ../myrepo-task-x # delete when merged/abandoned
git worktree prune # clean up stale registrationsA branch can be checked out in only one worktree, including main.
In Cursor, use the Agents Window or /worktree <task>. /apply-worktree applies results to the main checkout; /delete-worktree discards them. /best-of-n model1,model2 <task> runs the same task in parallel worktrees, one per model. Cursor auto-deletes older worktrees, so preserve results promptly; pushing task branches still requires explicit approval.
A fresh worktree contains tracked files only. Bootstrap it before task work:
.env, .env.local, and similar files from the primary checkout. Never symlink them: edits would change the originals.npm ci, pnpm install, uv sync, bundle install). Never symlink node_modules from the primary checkout: bundlers such as Next.js/Turbopack reject paths outside the worktree. If it is a symlink, remove it with rm -f node_modules and install normally.name:; otherwise each worktree's folder name creates a separate project. Copy or re-seed per-worktree state such as SQLite files.npm run build, codegen).core.hooksPath and .git/config are shared; verify hook scripts don't assume the primary checkout's path.In Cursor, .cursor/worktrees.json runs setup on creation ($ROOT_WORKTREE_PATH is the primary checkout):
{
"setup-worktree": [
"npm ci",
"cp $ROOT_WORKTREE_PATH/.env.local .env.local"
]
}Otherwise, put the checklist in scripts/setup-worktree.sh and run it first in each new worktree. Find the primary checkout from a worktree with:
dirname "$(git rev-parse --path-format=absolute --git-common-dir)"# from the primary checkout, after reviewing the worktree's diff:
git merge --no-ff task-branch # or: git merge --squash task-branch
git worktree remove ../myrepo-task-x
git branch -d task-branchIn Cursor, use /apply-worktree, then review and commit.
© davidondrej, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/agent-orchestration/git-worktree of davidondrej/skills.
Open the folder on GitHubat commit ea32e5f
Git Worktree 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 Worktree this skilldavidondrej/skills | 4.1k | — | ~1.1k | Automated safety check: Notes | MIT | |
| Using Git Worktreesfarm-fe/farm | 5.6k | 13 repos | ~2k | Automated safety check: Pass | MIT | |
| Agtx Task Sweepfynnfluegge/agtx | 1.7k | — | ~1.7k | Automated safety check: Pass | Apache-2.0 | |
| PRP Workstream OrchestratorWirasm/prp | 2.3k | — | ~3.5k | Automated safety check: Pass | MIT | |
| Squad Agent Collaboration Patternsmicrosoft/waza | 1.4k | 4 repos | ~500 | Automated safety check: Pass | MIT | |
| Vspawnvlinx-io/VelaTerm | 259 | — | ~2.5k | Automated safety check: Pass | MIT |
farm-fe/farm
A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git…
fynnfluegge/agtx
Breaks a conversation's results into feature-level tasks and pushes them to the agtx kanban board, where each task gets its own worktree and agent session.
Wirasm/prp
Coordinates several PRP workstreams in isolated Git worktrees from one session, verifying proof, holding merge gates and sequencing the merges.
microsoft/waza
Shared collaboration rules for a team of squad agents covering worktree awareness, writing decisions to an inbox, cross-agent requests and reviewer lockout.
vlinx-io/VelaTerm
Explicitly spawn a standalone child session under the current vlx-term session, passing the task in as its first message (mirrors spawntask).
awebai/aweb
Guides decisions for agents working in an aweb team: when to check shared state, claim tasks, take locks, read team roles and instructions, and open separate worktrees.
davidondrej/skills
Launch a new bb worker thread with the right project, model, worktree, and task brief.
davidondrej/skills
Direct browser control via CDP. An agent skill from davidondrej/skills.
davidondrej/skills
Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents.
davidondrej/skills
Reset a stuck Cursor ACP thread in <chat-system and reload its configuration.
davidondrej/skills
Keep a Mac awake for a set duration or while a process runs.
davidondrej/skills
Use this when controlling bb. An agent skill from davidondrej/skills.
Works with
Categories
Use Git worktrees to isolate parallel coding tasks. An agent skill from davidondrej/skills. Git Worktree is an agent skill from davidondrej/skills. Use Git worktrees to isolate parallel coding tasks.
Git Worktree fits situations like: setting up a task checkout; working in a shared repo; managing existing worktrees.
Run `npx skills add davidondrej/skills --skill git-worktree -a claude-code`. Or copy the skill folder (skills/agent-orchestration/git-worktree in davidondrej/skills) into .claude/skills/git-worktree in your project. Claude Code loads it when a task matches its description.
Run `npx skills add davidondrej/skills --skill git-worktree -a codex`. Or copy the skill folder (skills/agent-orchestration/git-worktree in davidondrej/skills) into .agents/skills/git-worktree 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 davidondrej/skills --skill git-worktree -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, .gemini/skills/git-worktree, .github/skills/git-worktree and .opencode/skills/git-worktree in your project.
Going by SKILL.md and its folder, Git Worktree needs the command-line tools its instructions call (git, npm, pnpm, uv and bundle). Our summary lists: Docker.
SKILL.md contains no URLs. Its commands use git, npm and uv, 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 (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Git Worktree is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.1k tokens (SKILL.md is roughly 4.4k 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 Worktree: Using Git Worktrees (farm-fe/farm, 5.6k stars), Agtx Task Sweep (fynnfluegge/agtx, 1.7k stars), PRP Workstream Orchestrator (Wirasm/prp, 2.3k stars) and Squad Agent Collaboration Patterns (microsoft/waza, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
davidondrej (a GitHub user) maintains it in davidondrej/skills, which has 4,105 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 6, 2026.
Source: davidondrej/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.