From worktree
Create an isolated git worktree for feature work or build step isolation. Use when starting feature work, before risky build steps, or when parallel isolation is needed. Agent-first: no interactive prompts for directory selection.
How this skill is triggered — by the user, by Claude, or both
Slash command
/worktree:createThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create an isolated git worktree for the branch specified in `$ARGUMENTS`.
Create an isolated git worktree for the branch specified in $ARGUMENTS.
Invoked as: $ARGUMENTS
git rev-parse --git-dir 2>/dev/null || echo "NOT_A_GIT_REPO"git rev-parse --show-toplevel 2>/dev/null || echo "unknown"git worktree list 2>/dev/null || echo "(none)"git rev-parse --git-dir. If it fails or returns NOT_A_GIT_REPO, stop with: "Not a git repository. Aborting."git rev-parse --git-dir contains /worktrees/. If it does, stop with: "Already inside a worktree. Run worktree:create from the main repository root."$ARGUMENTS:
<branch-name>.--base <branch> is present, capture <base>.<branch-name> is empty, stop with: "Usage: /worktree:create [--base ]"git rev-parse --verify <branch-name> 2>/dev/null. If it succeeds (exit 0), stop with: "Branch '' already exists. Choose a different name or delete the existing branch first."git check-ignore -q .worktrees 2>/dev/null. Note the exit code (0 = ignored, non-zero = not ignored)..worktrees/ does not exist, create it: mkdir -p .worktrees..worktrees/ is gitignored (exit code 0 from step 1). If it is NOT already ignored:
.gitignore exists: test -f .gitignore..gitignore exists, check if it already contains .worktrees: grep -q '\.worktrees' .gitignore..gitignore doesn't exist), append .worktrees/ to .gitignore: echo '.worktrees/' >> .gitignore.git check-ignore -q .worktrees && echo "ignored" || echo "warning: .worktrees not ignored". If not ignored, print a warning but continue.--base <base> was provided: git worktree add -b <branch-name> .worktrees/<branch-name> <base>git worktree add -b <branch-name> .worktrees/<branch-name>ls .worktrees/<branch-name>/. If the directory is missing or empty, stop with: "Worktree directory not found after creation."Run all dependency installs inside .worktrees/<branch-name>/. Check for lockfiles/manifests in order and run the corresponding install command. If an install command fails, print a warning and continue — do NOT abort.
Check in this order:
pnpm-lock.yaml exists → run pnpm install (in worktree dir)yarn.lock exists → run yarn install (in worktree dir)package-lock.json exists → run npm install (in worktree dir)package.json exists (and none of the above lockfiles) → run npm install (in worktree dir)Cargo.toml exists → run cargo build (in worktree dir)poetry.lock exists → run poetry install (in worktree dir)requirements.txt exists → run pip install -r requirements.txt (in worktree dir)go.mod exists → run go mod download (in worktree dir)Run each applicable install as: (cd .worktrees/<branch-name> && <install-command>) && echo "OK: <install-command>" || echo "WARN: <install-command> failed (continuing)"
After dependency setup, check if .caw/ exists at the repo root: test -d .caw && echo "exists" || echo "not found". If it exists, copy it to the worktree: cp -r .caw/ .worktrees/<branch-name>/.caw/. Note: .caw/ is copied one-directionally at creation time. Observations added inside the worktree are not synced back. Only code changes are merged via worktree:merge.
Print the final summary in this exact format:
Worktree ready at .worktrees/<branch-name> (branch: <branch-name>)
Details:
Path: .worktrees/<branch-name>
Branch: <branch-name>
Base: <base branch or "HEAD">
Deps: <summary of install results, or "none detected">
.caw/: <"copied" or "not present">
If any warnings occurred during Phase 2 or Phase 4, list them after the summary block.
npx claudepluginhub jaebit/claudemate --plugin worktreeCreates isolated git worktrees for parallel feature development, with automated directory selection and safety checks to prevent accidental commits.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.