git-worktrees
Installation
SKILL.md
Git Worktrees
This skill is self-contained. Do not load a machine-installed or system worktree skill. Apply standard Git behavior except for the repository rules below.
Repository rules
- Preserve unrelated changes. Do not stash, move, or discard them to create a worktree.
- Do not depend on client hooks. Cursor invokes
scripts/setup-worktree.shthrough.cursor/worktrees.json. Other clients can run the same script after creating a worktree. Inspect the actual environment and machine-local configuration without printing secrets. - Codex does not read
.cursor/worktrees.json; configure its local environment to invokescripts/setup-worktree.sh, or run the script manually. - Keep machine-local configuration local to each checkout. Worktree hooks do
not copy
.env,.env.local,mise.local.toml, or.local.envrcfrom another checkout.