From max-sixty-worktrunk
Creates a new worktrunk worktree and switches the session into it, optionally in a different repo. Use when starting a task that needs its own isolated worktree.
How this skill is triggered — by the user, by Claude, or both
Slash command
/max-sixty-worktrunk:wt-switch-create [<branch>] [<repo>] [-- <task>][<branch>] [<repo>] [-- <task>]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Arguments: `$ARGUMENTS`. Grammar: `[<branch>] [<repo>] [-- <task>]`.
Arguments: $ARGUMENTS. Grammar: [<branch>] [<repo>] [-- <task>].
Tokens before the -- are the branch and/or repo: a path-shaped token
(starting with /, ~, ./, or ../) is the repo; any other token is the
branch (docs is a branch name, never the docs/ directory). More than one
branch-shaped token before a -- doesn't fit the grammar — ask. Without a
--, judge where the task starts: leading tokens that read as a branch name
(fix-auth) or a repo path are consumed as such, and the rest is the task;
otherwise the whole input is the task (fix the parser bug has no
branch-shaped lead — all task).
/wt-switch-create my-feature -- fix the parser bug
/wt-switch-create -- fix the parser bug
/wt-switch-create my-feature ~/workspace/other-repo -- fix the parser bug
/wt-switch-create my-feature
Steps 1–3 run on every invocation, before any other work. The invocation is itself the explicit request to create the worktree; a research or read-only task gets one all the same.
Pick the branch name if none was given: short, from the task and consistent with existing worktree names, or, mid-session, from the work being moved; with nothing to derive from, ask.
Create the worktree with a Bash call (omit -C <repo> for this repo):
wt -C <repo> switch --create <branch> --no-cd --format=json
Stdout is JSON whose path field is the worktree's absolute path (status
lines go to stderr). On Branch <branch> already exists: if the user named
the branch, rerun without --create (it enters the branch, creating its
worktree if missing); if step 1 picked the name, pick another and rerun. Any
other failure (not a git repo, invalid name): report it and stop.
Mid-session, carry uncommitted work across: git stash push -u before
creating the worktree, then git -C <path> stash pop after (the stash is
shared across worktrees).
Enter the worktree, then do the task. Call
EnterWorktree({path: "<path from the JSON>"}).
EnterWorktree
re-roots only into a worktree the session is permitted to enter, and that
permitted set is fixed by two factors: the repo your cwd resolves to, and
the session's state. Each rejection is just that set coming up empty or
without the target: no repo resolves (cwd is outside any git repo, e.g. a
non-git parent such as ~/workspace that only holds repos, as in a
background job), which fails with the current directory is not in a git repository; the target belongs to a different repo than the one resolved;
or the session is already rooted in a worktree (or is a pinned agent), a
state that narrows the set to the resolved repo's .claude/worktrees/ and
so excludes even a same-repo wt sibling. All reduce to the same recovery
test: whether you can cd into the worktree, which works when it's inside
an allowed directory (a permissions.additionalDirectories entry such as
~/workspace). So cd <path> and read the result:
Shell cwd was reset notice → it stuck; the worktree is reachable.
Work there, but a bare cd is not a tracked re-root, so the cwd can
revert to the session's launch worktree across turns (and in spawned
subagents); pin commands with git -C <path> / wt -C <path> rather
than trusting the cd to persist.Shell cwd was reset → not reachable. Stop and ask the user to make it
reachable: add the repo, or a parent like ~/workspace, to
permissions.additionalDirectories (durable, every session), or run
/add-dir <path> (this session). Then continue. Don't grind through
absolute paths with cd resetting on every command.The worktree is a normal worktrunk worktree: it persists after the session
ends, shows up in wt list, and is merged or removed with wt merge /
wt remove <branch> like any other. Don't remove it unprompted. If the user
asks to leave mid-session, ExitWorktree({action: "keep"}) returns the
session to its original directory; ExitWorktree cannot remove a worktree
entered by path, so removal is always wt remove <branch>.
The command's mandate is ONE worktree (in the named repo, if one was given) and the requested task inside it. Commits, pushes, and merges still each require explicit user permission.
npx claudepluginhub max-sixty/worktrunkCreates an isolated git worktree on the correct base branch in a gitignored directory. Use for parallel/isolated workspaces without disturbing the current checkout, or running multiple agents on the same repo.
Creates a git worktree for isolated parallel development — new branch in a separate directory with project setup and test baseline. Enables multiple Claude Code sessions on different tasks simultaneously.
Creates isolated git worktrees for feature branches with smart directory selection, gitignore checks, auto project setup detection, and baseline test verification. Use for task isolation from main workspace.