git-worktrees
Skill9 starsChanged 7 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
12 other projects use a version of this.
Adopted by
Most recently taken up by
- choegyumin/agent-skillstheir own version, first seen Sep 19, 2026
- nafeeur/MaskShifttheir own version, first seen Sep 12, 2026
- KhaledSaeed18/dotclaudetheir own version, first seen Jul 4, 2026
- tomimor/skillstheir own version, first seen Jun 26, 2026
- itallstartedwithaidea/claude-googleadsagenttheir own version, first seen May 21, 2026
- vikisingh23/neuraforge-aitheir own version, first seen May 4, 2026
Used with
Projects with it also use workflow-orchestration, observability and 6 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.
shyamsridhar123Skillworkflow-orchestration
Build multi-agent workflows and graph-based orchestration using Microsoft Agent Framework. Use this skill when creating agent pipelines, connecting multiple agents, implementing human-in-the-loop patterns, streaming, checkpointing, or time-travel debugging.
Also in 3 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 3 projects that use this
OpenAISkillexecuting-plans
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Also in 4 projects that use this
ElasticSkillcreate-skill
Interactively create a new Claude Code skill and add it to the elastic-docs-skills catalog. Use when the user wants to generate a new skill, scaffold a slash command, or build automation for docs tasks.
Also in 3 projects that use this
- +4 more from openai
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- NeoLabHQ/context-engineering-kit★ 1.7ksame name
- xenitV1/claude-code-maestro★ 229same name
- jamesrochabrun/skills★ 214same name
- itallstartedwithaidea/agent-skills★ 39same name
- CarbeneAI/Forge★ 9same name
- KhaledSaeed18/dotclaude★ 5same name
- vikisingh23/neuraforge-ai★ 4same name
- itallstartedwithaidea/claude-googleadsagent★ 2same name
- nafeeur/MaskShift★ 2same name
- tomimor/skills★ 2same name
2 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 repository142 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
- algorithm-designSkill
- analystSkill
- archcode-genomicsSkill
- arm-cortex-microcontrollersSkill
- atomizeSkill
- backward-traceabilitySkill
- boyko-goal-expansion-100Skill
- boyko-knowledge-auditSkill
- boyko-leverage-mapSkill
- boyko-methodSkill
- boyko-preflightSkill
- boyko-project-radarSkill
- boyko-scientific-consortiumSkill
- boyko-specialistSkill
- boyko-triangle-auditSkill
- boyko-why-ladderSkill
- browser-actSkill
- build-autoSkill
- c4-architectureSkill
- career-prepSkill
- changelog-genSkill
- citation-managementSkill
- code-debuggingSkill
- codex-skepticSkill
- codex-solverSkill
- codex-tracySkill
- combinatorial-creativitySkill
- common-groundSkill
- conductorSkill
- consilienceSkill
- construct-measurement-gateSkill
- cross-domainSkill
- data-analysisSkill
- data-breach-blast-radiusSkill
- defuddleSkill
- design-directionSkill
- diagram-generatorSkill
- error-to-lessonSkill
- 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 12 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 12 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.

