What problem does it solve?
Git worktrees eliminate the pain of switching branches or stashing changes when multiple tasks must be developed concurrently, ensuring each task has an isolated workspace with a clean checkout.
Core Features & Use Cases
- Parallel, isolated development: Creates separate directories for each checked-out branch so concurrent work never overwrites another task’s uncommitted changes.
- Clean test baselines: Produces fresh, artifact-free environments to validate builds and tests from a predictable checkout.
- Subagent-friendly orchestration: Enables multi-agent workflows where an orchestrator dispatches tasks to subagents, then merges results back while pruning worktrees to avoid disk bloat.
Use case example: While a feature branch is in progress, you need to hotfix an urgent bug and also run regression tests for the feature—worktrees let you do both without switching contexts or mixing file states.
Quick Start
Use the git-worktrees skill to create a dedicated worktree directory for each concurrent task, run the required commands (like install and tests) inside that directory, and then remove the worktree after merging.