git-worktree
Skill1 starsChanged 13 days agoMITView on GitHub
Creates, lists, and removes git worktrees to manage parallel workspaces. Activate when the user needs to work on multiple branches simultaneously, run parallel tasks in isolation, or when an agent needs its own workspace. Also activate when the user says "worktree", "parallel branch", "work on two things at once", or "run these in parallel".
30 other projects use a version of this.
Adopted by
Most recently taken up by
- aegntic/compound-engineeringtheir own version, first seen Nov 8, 2026
- sbluemin/fleet-harnesstheir own version, first seen Nov 8, 2026
- yht-4403/jc-agent-skillstheir own version, first seen Nov 8, 2026
- yuri-xyz/skillstheir own version, first seen Nov 8, 2026
- iliaal/ai-skillstheir own version, first seen Nov 7, 2026
- eliasjnior/claude-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use agent-native-architecture, document-review and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CodeWithBehnamSkillagent-native-architecture
Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools, implementing self-modifying systems, or building apps where features are outcomes achieved by agents operating in a loop.
Also in 3 projects that use this
CodeWithBehnamSkilldocument-review
This skill should be used to refine brainstorm or plan documents before proceeding to the next workflow step. It applies when a brainstorm or plan document exists and the user wants to improve it.
Also in 3 projects that use this
MicrosoftSkillgit-commit
Stage user-selected paths, confirm the exact staged set, and create one local Conventional Commit, or generate a commit message for staged changes without committing. Use when you want a guarded commit or a ready-to-paste message.
Also in 3 projects that use this
OpenAISkillbrainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Also in 3 projects that use this
BlockSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Also in 4 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 4 projects that use this
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 30
- davidondrej/skills★ 4.3ksame name
- iliaal/ai-skills★ 45same name
- sbluemin/fleet-harness★ 17same name
- BackToCimaCoppi/Praxis★ 6same name
- dzianisv/skills★ 4same name
- KroxiDev/engineering-skills★ 4same name
- MithunWijayasiri/dotclaude★ 4same name
- CodeWithBehnam/cc-docs★ 2same name
- hmj1026/dhpk★ 2same name
- tsubakimoto/skills★ 2same name
20 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- openkata-eval-runnerSkill
- openkata-optimize-skillsSkill
- openkata-review-ruleSkill
- openkata-review-skillSkill
- openkata-rule-conventionsSkill
- openkata-ryu-releaseSkill
- openkata-skill-conventionsSkill
- commit-conventionsSkill
- create-adrSkill
- create-evalsSkill
- create-profileSkill
- create-ruleSkill
- create-skillSkill
- critical-thinkingSkill
- github-create-prSkill
- grill-meSkill
- grill-with-docsSkill
- makefile-conventionsSkill
- spec-workflowSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 25 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Run these two commands and compare output:
- Distinctive: line 30
If the outputs differ, you are inside a worktree.
- Very specific: line 39
If exit code is non-zero, add .worktrees/ to .gitignore before proceeding.
- Distinctive: line 55
If the branch already exists:
- Very specific: line 98
Add .worktrees/ to .gitignore (one-time setup)
- Distinctive: line 99
Remove worktrees after merging — they are temporary
- Distinctive: line 124
Does NOT manage PRs or merges (use create-pr skill)
- Distinctive: line 125
Does NOT handle CI/CD or deployment
- Distinctive: line 126
Does NOT replace branch workflow — extends it with parallelism
“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Worktrees
Worktrees give each parallel task its own filesystem while sharing one repository. Every worktree has a branch; every parallel agent gets its own worktree.
Steps
Pre-flight (mandatory before any worktree creation):
- Run these two commands and compare output:
If the outputs differ, you are inside a worktree. Stop immediately and warn: "You are already inside a worktree. Switch to the main checkout first." Do not proceed.git rev-parse --git-dir git rev-parse --git-common-dir - Run:
If exit code is non-zero, addgit check-ignore -q .worktrees.worktrees/to.gitignorebefore proceeding.
Both checks are mandatory. Never skip them — nested worktrees corrupt repository state.
- Create the worktree — Run:
Convention: name the directory after the task, prefix the branch by type:git worktree add .worktrees/<name> -b <branch-name>
If the branch already exists:git worktree add .worktrees/fix-auth-bug -b fix/auth-bug git worktree add .worktrees/redesign-nav -b feature/redesign-navgit worktree add .worktrees/<name> <existing-branch> - Work in the worktree —
cd .worktrees/<name>and operate normally. Run the project's tests after entering to confirm a clean baseline. - List active worktrees — After creating worktrees,
always run:
This confirms the worktrees are set up correctly and shows the full set of active workspaces.git worktree list - Merge results — When work is complete:
- Push the branch and create a PR, or
- From the main checkout:
git merge <branch-name>
- Remove the worktree — After merging, always run
both commands:
Both are required —git worktree remove .worktrees/<name> git branch -d <branch-name>worktree removedetaches the directory,branch -ddeletes the branch. If the directory was deleted manually, rungit worktree pruneinstead.
Parallel Execution Pattern
For batch operations across multiple tasks, see parallel-execution.md.
Conventions
- Store worktrees in
.worktrees/at the project root - Name directories after the task (not the branch)
- Branch naming: use a type prefix matching your project's
convention (e.g.,
feature/,fix/,release/,experiment/) - Add
.worktrees/to.gitignore(one-time setup) - Remove worktrees after merging — they are temporary
Gotchas
- Same branch twice — Git refuses to check out a branch in two worktrees simultaneously. Use a different branch name or detach HEAD.
- Shared refs — All worktrees share
.git/refs. A tag or remote update in one is visible in all. - Shared stash —
git stashis global. Name stashes:git stash push -m "worktree: description" - Hooks — Git hooks are shared (
.git/hooks). A pre-commit hook runs in whichever worktree triggers it. - IDE state — Open each worktree as a separate project window to avoid conflicts.
- Skipping pre-flight — Agents consistently skip
pre-flight checks when eager to create worktrees. The
guards exist because nested worktrees corrupt state and
unignored
.worktrees/pollutes git status.
Boundaries
- DOES create, list, and remove worktrees
- DOES establish branch naming conventions for worktrees
- DOES demonstrate parallel execution patterns
- Does NOT manage PRs or merges (use create-pr skill)
- Does NOT handle CI/CD or deployment
- Does NOT replace branch workflow — extends it with parallelism
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

