worktrees
Git Worktrees
Overview
Git worktrees enable checking out multiple branches simultaneously in separate directories, all sharing the same repository. Create a worktree instead of stashing changes or cloning separately.
Core principle: One worktree per active branch. Switch contexts by changing directories, not branches.
Core Concepts
| Concept | Description |
|---|---|
| Main worktree | Original working directory from git clone or git init |
| Linked worktree | Additional directories created with git worktree add |
Shared .git |
All worktrees share same Git object database (no duplication) |
| Branch lock | Each branch can only be checked out in ONE worktree at a time |
| Worktree metadata | Administrative files in .git/worktrees/ tracking linked worktrees |
Quick Reference
More from neolabhq/context-engineering-kit
sdd:plan
Refine, parallelize, and verify a draft task specification into a fully planned implementation-ready task
550sdd:implement
Implement a task with automated LLM-as-Judge verification for critical steps
525customaize-agent:prompt-engineering
Use this skill when you writing commands, hooks, skills for Agent, or prompts for sub agents or any other LLM interaction, including optimizing prompts, improving LLM outputs, or designing production prompt templates.
512code-review:review-local-changes
Comprehensive review of local uncommitted changes using specialized agents with code improvement suggestions
511sdd:brainstorm
Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative questioning, alternative exploration, and incremental validation. Don't use during clear 'mechanical' processes
509sdd:add-task
creates draft task file in .specs/tasks/draft/ with original user intent
503