worktree
Skill2 starsChanged 9 months agoMITView on GitHub
Use when you need workspace isolation for parallel tasks, risky changes, or multi-feature development without branch switching.
- Installs packages
- Commits and pushes
59 other projects use a version of this.
Adopted by
Most recently taken up by
- venhdev/skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- kortix-ai/sunatheir own version, first seen Nov 8, 2026
- tardigrde/obsidian-agentic-chattheir own version, first seen Nov 8, 2026
- kortix-ai/CompanyOStheir own version, first seen Nov 8, 2026
Used with
Projects with it also use worktree-merge, resolve-conflicts and 10 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.
leessjuSkillworktree-merge
Squash-merge the current worktree branch into the main branch (or a specified target). Analyzes git history and source code to craft a comprehensive commit message.
Also in 3 projects that use this
ralphkraussSkillresolve-conflicts
Resolve git merge conflicts or re-apply changes from a stale branch onto current main. Use when user says "resolve conflicts", "merge conflicts", "rebase branch", "branch is behind", "re-apply changes", "port branch", or a branch is too far behind main to merge cleanly.
Also in 5 projects that use this
SentrySkille2e
Run E2E tests for Sentry JavaScript SDK test applications
Also in 5 projects that use this
hdcolaSkillpr-comments
Fetch unresolved review comments from a GitHub PR or mark comments as resolved. Use this when managing PR review feedback, checking pending comments, or marking review threads as resolved. Supports GitHub URLs or explicit owner/repo/PR-number from anywhere, or PR number auto-detection from within a git repository.
Also in 3 projects that use this
Google CloudSkillcontributing
Guides the developer workflow for contributing to Race Condition. Use when setting up pre-commit hooks, running tests before a PR, understanding code style requirements, or preparing a contribution.
Also in 3 projects that use this
PydanticSkillcoverage
Fetch coverage diff from Codecov for the current branch or a specific PR. Shows uncovered lines, patch coverage, and overall coverage change.
Also in 3 projects that use this
Other versions59 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 59
- Significant-Gravitas/AutoGPT★ 188ksame name
- kortix-ai/suna★ 21ksame name
- kortix-ai/CompanyOS★ 21ksame name
- gitkraken/vscode-gitlens★ 10ksame name
- Zipstack/unstract★ 7.4ksame name
- mistralai/mistral-vibe★ 5.3ksame name
- nubjs/nub★ 4.4ksame name
- raine/workmux★ 3ksame name
- astashov/liftosaur★ 775same name
- nudgebee/nudgebee★ 520same name
49 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 repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- auditSkill
- brainstormSkill
- checkpointSkill
- codereviewSkill
- commitSkill
- debugSkill
- estimateSkill
- finishSkill
- healthSkill
- learnSkill
- lintSkill
- migrate-architectureSkill
- migrate-frameworkSkill
- onboardSkill
- planSkill
- recallSkill
- rememberSkill
- tddSkill
- tutorialSkill
- verifySkill
- write-skillSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 47 edited versions we read keep these.
3
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 11
Create isolated workspaces for parallel development.
- Distinctive: line 22
NOT for: simple single-file changes (just use a branch)
- Very specific: line 111
When @orchestrator dispatches parallel agents:
- Distinctive: line 148
Clean up when done: - Remove worktrees and branches after merge
- Very specific: line 150
Gitignore the worktrees directory: - Add .claude/worktrees/ to .gitignore
“Common” is measured: kept by at least 6 in 10 of the 47 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
/worktree - Git Worktree Isolation
Create isolated workspaces for parallel development. Each task gets its own directory - no branch switching, no stashing, no conflicts.
Target: $ARGUMENTS
When to Use
- Working on multiple features simultaneously
- Risky refactoring that might break things
- Long-running tasks that shouldn't block other work
- Testing a fix while keeping current work intact
- Running parallel agents on different tasks
- NOT for: simple single-file changes (just use a branch)
Workflow
Step 1: Directory Selection
Choose where to create worktrees:
Priority order:
1. Existing worktrees directory (if configured)
2. .claude/worktrees/ (default for Specialist Agent)
3. ../project-worktrees/ (sibling directory)
4. Ask userStep 2: Create Worktree
# Create new branch and worktree
git worktree add .claude/worktrees/$ARGUMENTS -b worktree/$ARGUMENTS
# Verify creation
git worktree listStep 3: Setup Workspace
# Enter worktree
cd .claude/worktrees/$ARGUMENTS
# Install dependencies (auto-detect)
if [ -f "package-lock.json" ]; then npm ci
elif [ -f "yarn.lock" ]; then yarn install --frozen-lockfile
elif [ -f "pnpm-lock.yaml" ]; then pnpm install --frozen-lockfile
elif [ -f "bun.lockb" ]; then bun install
fi
# Verify clean baseline
git statusStep 4: Work in Isolation
The worktree is a full copy of the repo.
- Changes here do NOT affect the main worktree
- You can run tests, builds, anything
- Commits go to the worktree/$ARGUMENTS branchStep 5: Merge or Discard
When done:
# Option 1: Merge back
cd /path/to/main/repo
git merge worktree/$ARGUMENTS
# Option 2: Create PR from worktree branch
gh pr create --base main --head worktree/$ARGUMENTS
# Option 3: Discard
git worktree remove .claude/worktrees/$ARGUMENTS
git branch -D worktree/$ARGUMENTSWorktree Management
List Active Worktrees
git worktree listRemove a Worktree
git worktree remove .claude/worktrees/$NAME
git branch -D worktree/$NAMEClean All Worktrees
git worktree pruneIntegration with @orchestrator
When @orchestrator dispatches parallel agents:
@orchestrator
├── Worktree: feature-a → @builder (component)
├── Worktree: feature-b → @builder (service)
└── Worktree: feature-c → @tester (tests)
Each agent works in its own worktree.
No file conflicts possible.
Merge when all complete.Verification Protocol
Before claiming worktree is ready:
git worktree listshows the new worktree- Working directory is clean (
git statusshows no untracked files from setup) - Dependencies are installed (if applicable)
- Tests pass in the worktree (baseline)
Anti-Rationalization
| Excuse | Reality |
| "Just stash and switch branches" | Stashing loses context and is error-prone. Worktrees keep everything intact. |
| "I'll remember what I was working on" | You won't. Worktrees preserve state explicitly. |
| "Too much disk space" | Worktrees share .git objects. Overhead is minimal. |
| "Merging will be hard" | Merging is the same as any branch. Worktrees don't add merge complexity. |
| "I'll just do tasks sequentially" | Sequential is slower. Parallel worktrees = parallel development. |
Rules
- Always name worktrees descriptively -
worktree/auth-refactornotworktree/temp - Install dependencies after creation - Auto-detect package manager
- Verify baseline before working - Tests must pass in fresh worktree
- Clean up when done - Remove worktrees and branches after merge
- Never work in .git/ - Worktrees are directories, not git internals
- Gitignore the worktrees directory - Add
.claude/worktrees/to.gitignore
Output
──── /worktree ────
Action: [create | list | remove | merge]
Name: $ARGUMENTS
Path: .claude/worktrees/$ARGUMENTS
Branch: worktree/$ARGUMENTS
Status: Ready
Dependencies: Installed
Baseline tests: Passing
Active worktrees:
1. /main/repo (main branch)
2. .claude/worktrees/$ARGUMENTS (worktree/$ARGUMENTS)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.

