worktree
Skill96 starsChanged 7 months agoMITView on GitHub
Git worktree lifecycle management. Use when team needs parallel isolated workspaces for multi-stream development, or when an experiment must not touch the main working tree. Creates isolated workspaces, manages branches, handles cleanup. Called by team and cook.
69 other projects use a version of this.
Adopted by
Most recently taken up by
- oberemokis/skillstheir own version, first seen Nov 29, 2026
- artberri/skillstheir own version, first seen Nov 29, 2026
- DGouron/review-flowtheir own version, first seen Nov 29, 2026
- devin-integration-bot/skillstheir own version, first seen Nov 29, 2026
- kostya-epifanov/claude-gantrytheir own version, first seen Nov 29, 2026
- sejas/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use worktree-merge, resolve-conflicts and 9 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
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 4 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
Other versions69 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 69
- Significant-Gravitas/AutoGPT★ 188ksame name
- kortix-ai/CompanyOS★ 21ksame name
- kortix-ai/suna★ 21ksame name
- gitkraken/vscode-gitlens★ 10ksame name
- Zipstack/unstract★ 7.5ksame name
- mistralai/mistral-vibe★ 5.4ksame name
- nubjs/nub★ 4.5ksame name
- raine/workmux★ 3.1ksame name
- astashov/liftosaur★ 793same name
- nudgebee/nudgebee★ 524same name
59 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 repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- llms.txtllms.txt
- adversarySkill
- asset-creatorSkill
- auditSkill
- autopsySkill
- baSkill
- brainstormSkill
- browser-pilotSkill
- completion-gateSkill
- constraint-checkSkill
- context-engineSkill
- context-packSkill
- convergeSkill
- cookSkill
- councilSkill
- dbSkill
- debugSkill
- dependency-doctorSkill
- deploySkill
- designSkill
- diagramSkill
- doc-processorSkill
- docs-seekerSkill
- docsSkill
- fixSkill
- gitSkill
- graftSkill
- hallucination-guardSkill
- improve-architectureSkill
- incidentSkill
- integrity-checkSkill
- journalSkill
- launchSkill
- logic-guardianSkill
- marketingSkill
- mcp-builderSkill
- neural-memorySkill
- onboardSkill
- perfSkill
- planSkill
- preflightSkill
- problem-solverSkill
- quarantineSkill
- rescueSkill
- researchSkill
- retroSkill
- review-intakeSkill
- reviewSkill
- safeguardSkill
- sastSkill
- scaffoldSkill
- scope-guardSkill
- scoutSkill
- sentinel-envSkill
- sentinelSkill
- sequential-thinkingSkill
- session-bridgeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 56 edited versions we read keep these.
4
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
- Very specific: line 118
MUST use .claude/worktrees/ directory for all worktrees
- Very specific: line 119
MUST prefix branches with rune/ namespace
- Distinctive: line 120
MUST NOT exceed 3 active worktrees
- Distinctive: line 121
MUST check for uncommitted changes before cleanup
- Distinctive: line 122
MUST NOT force-delete unmerged branches without explicit user confirmation
- Distinctive: line 138
No stale worktrees left behind
“Common” is measured: kept by at least 6 in 10 of the 56 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
Purpose
Reusable git worktree lifecycle management. Creates isolated workspaces for parallel agent development, manages branch naming, handles cleanup after merge or abort. Extracted from team to be usable by any skill that needs workspace isolation.
Triggers
- Called by
team(L1) for parallel stream isolation - Called by
cook(L1) when user explicitly requests worktree isolation /rune worktree create <name>— manual creation/rune worktree cleanup— manual cleanup of stale worktrees
Calls (outbound)
None — pure git operations via Bash.
Called By (inbound)
team(L1): Phase 2 ASSIGN — create worktrees for parallel streamscook(L1): optional isolation for complex features- User: direct invocation for manual worktree management
Operations
Create Worktree
Input: { name: string, base_branch?: string }
Default base: current HEAD
Steps:
0. Keep worktrees out of git: Bash: git check-ignore -q .claude/worktrees/ || echo ".claude/worktrees/" >> .gitignore
1. Bash: git worktree add .claude/worktrees/<name> -b rune/<name> [base_branch]
2. Verify: Bash: git worktree list | grep <name>
3. Return: { path: ".claude/worktrees/<name>", branch: "rune/<name>" }
Naming convention:
- Branch: rune/<name> (e.g., rune/stream-a, rune/auth-feature)
- Path: .claude/worktrees/<name>
- Max 3 active worktrees (enforced)Worktree directory per runtime: in Claude Code, worktrees live under the .claude/ folder, next to the ones its own claude --worktree sessions create. Compiled skills for every other runtime (Codex, Cursor, Gemini CLI, Grok Build, …) use .rune/worktrees/, so non-Claude projects never grow a .claude/ folder.
List Worktrees
Bash: git worktree list
→ Parse output into: [{ path, branch, commit }]
→ Filter: only rune/* branches (skip main worktree)Cleanup Worktree
Input: { name: string, force?: boolean }
Steps:
1. Check if branch is merged: Bash: git branch --merged main | grep rune/<name>
2. If merged OR force:
Bash: git worktree remove .claude/worktrees/<name> --force
Bash: git branch -d rune/<name> (or -D if force)
3. If NOT merged AND NOT force:
WARN: "Branch rune/<name> has unmerged changes. Use force=true to remove."Cleanup All Stale
Bash: git worktree list --porcelain
→ For each rune/* worktree:
→ Check if branch exists: git branch --list rune/<name>
→ If branch deleted: git worktree prune
→ If branch merged: cleanup (see above)
→ Report: removed [N] stale worktreesSafety Rules
1. NEVER delete a worktree with uncommitted changes without user confirmation
2. NEVER force-delete an unmerged branch without user confirmation
3. MAX 3 active rune/* worktrees — refuse creation if limit reached
4. ALWAYS use .claude/worktrees/ directory — not project root
5. ALWAYS prefix branches with rune/ — easy identification and cleanupOutput Format
## Worktree Report
- **Action**: create | cleanup | list
- **Worktrees**: [count active]
### Active Worktrees
| Name | Branch | Path | Status |
|------|--------|------|--------|
| stream-a | rune/stream-a | .claude/worktrees/stream-a | active |
| stream-b | rune/stream-b | .claude/worktrees/stream-b | merged |Constraints
- MUST use .claude/worktrees/ directory for all worktrees
- MUST prefix branches with rune/ namespace
- MUST NOT exceed 3 active worktrees
- MUST check for uncommitted changes before cleanup
- MUST NOT force-delete unmerged branches without explicit user confirmation
Sharp Edges
| Failure Mode | Severity | Mitigation |
| Worktree left behind after failed merge | MEDIUM | Cleanup All Stale operation + pre-team-merge tag for recovery |
| Branch name collision with existing branch | LOW | Check branch existence before creation, append timestamp if collision |
| Worktree path on Windows with long path | MEDIUM | Use short names, keep under .claude/worktrees/ to minimize path length |
| Deleting worktree with uncommitted agent work | HIGH | Safety Rule 1: always check for uncommitted changes first |
Done When
- Worktree created/listed/cleaned up as requested
- Branch naming follows rune/ convention
- Active worktree count ≤ 3
- No stale worktrees left behind
- Worktree Report emitted
Cost Profile
~200-500 tokens. Haiku + Bash commands. Fast and cheap.
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.

