From Claude Starter Kit
Isolates risky or parallel file-mutating work in a git worktree so the main tree's uncommitted changes are never clobbered. For fan-out agents, throwaway experiments, or any change you may want to discard cleanly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-starter-kit:worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
One rule: **never let risky or parallel work run on top of uncommitted changes in the shared tree.** A git worktree
One rule: never let risky or parallel work run on top of uncommitted changes in the shared tree. A git worktree gives a second working copy of the same repo on its own branch — you experiment or fan out agents there, and the main tree (with your in-progress edits) is physically untouched. Throw the worktree away and nothing you cared about is lost.
Kit adaptation (local, .claude/): this exists because verification/fan-out subagents have discarded a session's uncommitted work by running a destructive git command over the shared tree. Those commands (
reset --hard,clean -f,checkout -- .,restore) are §4.5-gated — but the real fix is to not put them near unsaved work. The Agent tool'sisolation: "worktree"does this automatically for parallel mutating agents; reach for it there.
reset --hard.[ "$(git rev-parse --git-dir)" != "$(git rev-parse --git-common-dir)" ] is true inside one; don't nest.git worktree add ../wt-<name> -b <branch> (new branch) or git worktree add ../wt-<name> <existing>. It shares the object store, so it's cheap.git worktree remove ../wt-<name> (add --force only if you mean to drop its changes).git worktree prune removes stale entries. Never leave orphaned worktrees around.checkout -- . to undo"; the undo is worktree remove.remove + prune when done.npx claudepluginhub byerlikaya/claude-starter-kit --plugin claude-starter-kitRun parallel or risky work without collisions using git worktrees. Triggers on "worktree", "isolate this change", "try this without touching main", "run these agents in parallel safely", "spike/experiment", or whenever multiple subagents or features would edit the same tree at once. Each task gets its own branch + working directory, so concurrent work never clobbers another's files and a failed experiment is thrown away by deleting a folder. Pairs with subagent-orchestration for true parallel building.
Auto-creates git worktrees to isolate changes in dedicated branches. Merge on success, discard on failure — zero damage to main.
Creates or verifies an isolated git worktree before development starts to prevent branch contamination and enable parallel feature work.