Worktree Creation
Create a worktree under
.worktrees/
with branch-specific setup that
git worktree add
alone does not handle:
Copies
.env
,
.env.local
,
.env.test
, etc. from the main repo (skips
.env.example
)
Trusts
mise
/
direnv
configs, with branch-aware safety rules so review branches do not auto-grant trust to untrusted
.envrc
content
Adds
.worktrees
to
.gitignore
if not already ignored
Does not modify the main repo checkout —
from-branch
is fetched, not checked out
Creating a worktree
Invoke the bundled script via the runtime Bash tool. On Claude Code,
${CLAUDE_SKILL_DIR}
resolves to the skill's own directory across both marketplace-cached installs and
claude --plugin-dir
local development; the runtime Bash tool's CWD is the user's project, not the skill directory, so a bare
bash scripts/worktree-manager.sh
fails. On other targets (Codex, Gemini, Pi, etc.)
${CLAUDE_SKILL_DIR}
is unset and the
:-.
fallback yields the bare relative path those harnesses expect.
bash
"
${CLAUDE_SKILL_DIR
:-
.}
/scripts/worktree-manager.sh"
create
<
branch-name
[
from-branch
]
Show more