From developer-workflow
Create, enter, and remove git worktrees following sibling-directory placement rules with branch-name mirroring, source-branch verification, and post-creation file copying. Use when the user asks to create a worktree, start work in a worktree, work on a feature in isolation, set up a sibling checkout, mentions `git worktree`, or invokes the EnterWorktree harness tool. Also use when removing or cleaning up worktrees.
How this skill is triggered — by the user, by Claude, or both
Slash command
/developer-workflow:worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Enforces a consistent sibling-directory layout for git worktrees and bakes in source-branch verification so the main checkout never gets polluted.
Enforces a consistent sibling-directory layout for git worktrees and bakes in source-branch verification so the main checkout never gets polluted.
Worktrees live as siblings of the repo, never inside it:
<parent>/<repo>/ ← main checkout
<parent>/<repo>.worktrees/<branch>/ ← worktrees here
For gitflow-style branch names (fix/foo, feat/bar), the slash is preserved in the path: <repo>.worktrees/fix/foo. For flat branch names, just <repo>.worktrees/branchname.
Run these steps without prompting unless one of them fails. The end state is: a sibling worktree exists, untracked config has been synced, and the agent is operating inside the worktree via EnterWorktree.
Resolve inputs. Get <branch> from the user. If they didn't name a source, default to the branch currently checked out in the main checkout.
Run create-worktree from the main repo root:
# POSIX / Git Bash
bash ${CLAUDE_PLUGIN_ROOT}/skills/worktree/scripts/create-worktree.sh <branch> [source-branch]
# PowerShell
& "$env:CLAUDE_PLUGIN_ROOT/skills/worktree/scripts/create-worktree.ps1" <branch> [source-branch]
The script:
git fetch so remote-only source branches and stale refs are resolved correctly<parent>/<repo>.worktrees/<branch><branch> exists locally, checks it out into the new worktree<branch> is new, branches from <source-branch> (local refs/heads/<source> if present, else refs/remotes/origin/<source>)<branch> is new and lacks oneSync untracked config into the new worktree:
bash ${CLAUDE_PLUGIN_ROOT}/skills/worktree/scripts/sync-untracked.sh <worktree-path>
& "$env:CLAUDE_PLUGIN_ROOT/skills/worktree/scripts/sync-untracked.ps1" <worktree-path>
Default patterns: .env, .env.*, .envrc (anywhere in the tree, excluding .git/, node_modules/, vendor/). Copies preserve relative paths.
Pass --include-deps (-IncludeDeps in PowerShell) only when the user explicitly wants node_modules/ and vendor/ mirrored. Skip it if the worktree's purpose involves changing package.json / composer.json — re-running pnpm install / composer install in the worktree is the right move there, and a stale copied tree just hides the diff. The sync uses a real recursive copy (never hardlinks/symlinks), so a subsequent install in the worktree won't corrupt the main checkout's dependency tree; copies are fast on CoW filesystems (ReFS, APFS, btrfs) and pay full cost on ext4/NTFS.
Enter the worktree. Call EnterWorktree with path=<absolute-path-from-step-2>. Never pass name — that triggers the default .claude/worktrees/ location, which violates the placement rule.
Begin work in the worktree. No further confirmation needed unless the user asked for one.
Confirm intent. Removing a worktree deletes its working tree on disk.
Run remove-worktree from the main repo root:
bash ${CLAUDE_PLUGIN_ROOT}/skills/worktree/scripts/remove-worktree.sh <branch-or-path>
& "$env:CLAUDE_PLUGIN_ROOT/skills/worktree/scripts/remove-worktree.ps1" <branch-or-path>
The script:
git worktree list--force / -Force)git worktree remove<repo>.worktrees/fix/ after removing fix/foo)If the harness is tracking the session, prefer ExitWorktree action=remove over the script — the harness owns its session state.
Run git worktree list from any checkout. Worktrees that don't live under <repo>.worktrees/ violate the placement rule and should be moved or removed.
fix/foo) → directory mirrors: <repo>.worktrees/fix/foo<repo>.worktrees/branchnameThe create script detects gitflow usage by checking for any local branch containing /.
cd into the worktree from the agent — use EnterWorktree so the harness tracks the sessionname to EnterWorktree — always pass path<repo>/.claude/worktrees/ — the default harness location violates the rule.env, .envrc) won't carry over without itnpx claudepluginhub mattlindell/photon-plugins --plugin developer-workflowCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.