Claude Code Git Worktree Skill for Isolated Feature Branches
Create an independent checkout for a feature while keeping the original worktree's uncommitted edits available.
中文Install in Claude Code
Use a local Git checkout, an unused branch name and a target directory. A scratch repository is enough for the example.
- Get the complete `cli-tool/components/skills/development/using-git-worktrees` directory from the pinned GitHub checkout.
- Copy it under the target project's `.claude/skills/`. Confirm `.claude/skills/using-git-worktrees/SKILL.md`, open Claude Code at the project root, and call `/using-git-worktrees`.
Example task
Keep an unstaged documentation edit in the original checkout. Create a sibling worktree on a new `csv-preview` branch and report both worktree states.What to check
The original checkout still contains its documentation edit. The new directory points at its own branch and has a recorded baseline check.
Original SKILL.md on GitHub · Updated
Frequently asked question
Why test the baseline before edits?
An observed baseline helps attribute a later failure to the change or to the existing checkout state.