git-worktrees
Skill9 starsChanged 6 months agoMITView on GitHub
Rule: worktree = recommendation, not mandate. Regular branch covers 80% of cases. Claude Code has a built-in EnterWorktree tool: - Automatically creates a worktree in a sibling directory - Switches context to the new tree - After completion — merge and cleanup When to use EnterWorktree: 1. Plan contains 5+ steps with high risk of cascading errors 2. User asks to "try it, but keep rollback possible" 3. Parallel task while current one is unfinished
24 other projects use a version of this.
Adopted by
Most recently taken up by
- jeanqussa/hermes-generic-opstheir own version, first seen Nov 8, 2026
- denormans/claude-code-workflowtheir own version, first seen Nov 8, 2026
- kazemcodes/skill-treetheir own version, first seen Nov 8, 2026
- Mahesh-Bishnoi/skillstheir own version, first seen Nov 8, 2026
- bostonaholic/rpikittheir own version, first seen Nov 8, 2026
- gabrielkoerich/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use verification-before-completion, security-review and 7 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.
OpenAISkillverification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Also in 4 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 4 projects that use this
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 4 projects that use this
CloudflareSkillreceiving-code-review
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Also in 3 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
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
- +3 more from openai
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- heyitsnoah/claudesidian★ 2.6ksame name
- jamesrochabrun/skills★ 209same name
- trailofbits/dropkit★ 129same name
- bostonaholic/rpikit★ 19same name
- CarbeneAI/Forge★ 9same name
- gabrielkoerich/skills★ 8same name
- tstapler/dotfiles★ 8same name
- KhaledSaeed18/dotclaude★ 5same name
- vikisingh23/neuraforge-ai★ 4same name
- Mahesh-Bishnoi/skills★ 2same name
14 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 repository164 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- agents/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- claude-md/CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- insight-architectSkill
- agent-teamsSkill
- brainstormingSkill
- claim-decomposerSkill
- context-engineeringSkill
- dispatcherSkill
- hd-mavp-routerSkill
- mentor-modeSkill
- reference-registrySkill
- routing-policySkill
- skill-self-updateSkill
- tdd-workflowSkill
- ab-testSkill
- academic-researchSkill
- advanced-methodology-extensionsSkill
- agent-governanceSkill
- ai-hyp-gateSkill
- algorithm-designSkill
- analystSkill
- archcode-genomicsSkill
- arm-cortex-microcontrollersSkill
- atomizeSkill
- backward-traceabilitySkill
- boyko-constraint-engineSkill
- boyko-epistemic-auditSkill
- boyko-goal-expansion-100Skill
- boyko-knowledge-architectureSkill
- boyko-leverage-mapSkill
- boyko-methodSkill
- boyko-preflightSkill
- boyko-project-radarSkill
- boyko-rippleSkill
- boyko-scientific-consortiumSkill
- boyko-specialistSkill
- boyko-toolcheckSkill
- boyko-triangle-auditSkill
- boyko-why-ladderSkill
- browser-actSkill
- build-autoSkill
- c4-architectureSkill
- career-prepSkill
- changelog-genSkill
- citation-managementSkill
- code-debuggingSkill
- code-materialitySkill
- codex-skepticSkill
- codex-solverSkill
- codex-tracySkill
- combinatorial-creativitySkill
- common-groundSkill
- conductorSkill
- consilienceSkill
- construct-measurement-gateSkill
- convertSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
USE when needing isolated workspace for experiments or parallel development.
- Distinctive: line 82
After completion — merge and cleanup
- Distinctive: line 101
Always git stash before creating worktree if you have uncommitted changes
“Common” is measured: kept by at least 6 in 10 of the 24 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
<!-- BSV — Brief Skill View | поиск: BSV
Скил : git-worktrees
TL;DR : Изолированные ветки без переключения контекста
Вызов : 'worktree', 'изолируй ветку'
НЕ для : Работа в одной ветке
-->name: git-worktrees description: > [STATUS: review] [CONFIDENCE: high] [REVIEWED: 2026-03-13] USE when needing isolated workspace for experiments or parallel development. Triggers: worktree, experiment, parallel branch, isolated copy, isolated branch, parallel work.
Skill: Git Worktrees
When to Load
- Experiment with uncertain outcome (may require rollback)
- Parallel work on 2+ tasks
- Large refactor while needing to keep a working version
Principle
Worktree = isolated working copy. Cheaper than stash/switch, safer than working in one tree.
Decision Matrix: branch vs worktree
| Situation | Branch | Worktree | Why |
| Bug fix in 1-2 files | v | Worktree overhead not justified | |
| Experiment (may not be needed) | v | Clean rollback = delete the folder | |
| Parallel work (2 tasks) | v | No stash/switch needed | |
| Large refactor 5+ files | v | Main branch stays working | |
| Regular feature 3-5 files | v | Worktree = overkill | |
| CI/CD check on another branch | v | Does not interrupt current work |
Rule: worktree = recommendation, not mandate. Regular branch covers 80% of cases.
Workflow
1. Create worktree
# EnterWorktree creates a worktree automatically (Claude Code built-in)
# Or manually:
git worktree add ../project-experiment feature/experiment
cd ../project-experiment2. Work in worktree
- Worktree = full working copy with a separate HEAD
- Can work in parallel in main tree and worktree
- Commits in the worktree go to their own branch
3. Merge result
# From the main tree:
git merge feature/experiment
# Or cherry-pick specific commits:
git cherry-pick <commit-hash>4. Cleanup
git worktree remove ../project-experiment
# Or if branch is no longer needed:
git worktree remove ../project-experiment
git branch -d feature/experimentClaude Code Integration
Claude Code has a built-in EnterWorktree tool:
- Automatically creates a worktree in a sibling directory
- Switches context to the new tree
- After completion — merge and cleanup
When to use EnterWorktree:
- Plan contains 5+ steps with high risk of cascading errors
- User asks to "try it, but keep rollback possible"
- Parallel task while current one is unfinished
Anti-patterns
| Don't do | Why |
| Worktree for every minor edit | Overhead > benefit |
| Forgetting cleanup after merge | Dead directories accumulate |
| Working in worktree without a branch | Detached HEAD = lost commits |
| Multiple worktrees on one branch | Git won't allow it (and rightly so) |
Gotchas
- Always
git stashbefore creating worktree if you have uncommitted changes - Worktree cleanup is manual — delete the directory when done
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.

