← ClaudeAtlas

use-worktreelisted

Creates a sibling git worktree at <repo>.worktrees/<slug> — an isolated workspace for starting branch work off the main checkout, or a detached checkout of a PR head to review.
atomgunlk/skills · ★ 0 · Code & Development · score 72
Install: claude install-skill atomgunlk/skills
# use-worktree Isolate work in a sibling worktree, leaving the main checkout untouched. Reach for this over a native worktree tool (`EnterWorktree`) when the worktree must live **outside** the repo as `<repo>.worktrees/<slug>`: nothing to add to `.gitignore`, and it lands in the same place whether invoked from the main checkout, a subdirectory, or another worktree. For a throwaway workspace with harness-managed cleanup, the native tool is the better fit. ## Are you already isolated? Check before creating anything: ```bash git rev-parse --git-dir ``` A path ending in `.git/worktrees/<name>` means you are already in a worktree — that is your isolated workspace, work in it. A path ending in plain `.git` means you are in the main checkout, so continue below. Create a second worktree only for a deliberately separate checkout, e.g. reviewing a PR while your feature work stays put. ## Create one Run the bundled script by absolute path, chained with `&&` so a failed run cannot be mistaken for a landing: ```bash WT=$(~/.claude/skills/use-worktree/scripts/create-worktree.sh <branch> [base] [slug]) && cd "$WT" && git rev-parse --git-dir ``` - `branch` — new branch, e.g. `feat/abc-1234-foo` (required) - `base` — fork point (optional; default: origin's default branch) - `slug` — worktree dir name (optional; default: branch with `/`→`-`) - `--reuse` — `<branch>` already exists (aborted run, resumed work): check it out here instead of creating it - `--detach <commitish>` — no new