skills/wt-switch-create/SKILL.md
Create a new worktrunk worktree (optionally in another repo) and switch this session's working directory into it. Use when launching a session that should work in its own worktree (e.g. `/wt-switch-create my-branch -- <task>`, or `/wt-switch-create my-branch ~/workspace/other-repo -- <task>`), or mid-session to move work into a fresh branch.
npx skillsauth add max-sixty/worktrunk wt-switch-createInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Arguments: $ARGUMENTS. Grammar: <branch> [<repo>] [-- <task>].
Without a --: a path-shaped second token (absolute, ~-relative, ./- or
../-relative, or an existing directory) is the repo, and the task starts
after it. Otherwise the task starts at the second token.
/wt-switch-create my-feature -- fix the parser bug
/wt-switch-create my-feature ~/workspace/other-repo -- fix the parser bug
/wt-switch-create my-feature
First action — before reading any files or running any commands:
cd into it first with a Bash call (the working
directory persists for the rest of the session). EnterWorktree has no
repo parameter — it creates the worktree wherever the session is rooted.EnterWorktree({name: "<branch-name>"}). This re-roots the
session into the new worktree. If a repo was given, confirm the new
worktree landed under it; if not, the cd didn't take — report it and
stop.WorktreeCreate →
wt switch --create <name> --no-cd --format=json, so the new worktree
lands in worktrunk's normal sibling layout (<repo>.<branch>/), not under
.claude/worktrees/.wt switch --create is idempotent: if the branch already exists, this
just re-enters its worktree.EnterWorktree-created worktree (e.g. the
background harness isolated this session), skip EnterWorktree — it
refuses to nest. Reuse the existing worktree and continue. But if a repo
was given and that worktree belongs to a different repo, you can't honor
it — say so and stop rather than running the task in the wrong repo.EnterWorktree fails (not a git repo, invalid branch name, etc.),
report the error and stop — do not fall back to working in the original
directory, since that defeats the purpose.After the cwd switch succeeds, do the task in the new worktree. If there was no task text, confirm the worktree is ready and wait for the next instruction.
Don't remove the worktree yourself. ExitWorktree({action: "remove"}) (if the
user asks to leave) or the session-exit prompt routes through this plugin's
WorktreeRemove hook → wt remove --foreground. A worktree with uncommitted
changes won't be auto-removed without confirmation — that's intended. A branch
with committed-but-unmerged work is retained (with a wt remove -D <branch>
hint) instead of being silently force-deleted.
This command authorizes creating/entering ONE worktree — in the named repo, if one was given — and doing the requested task. Commits, pushes, and merges still each require explicit user permission.
tools
Guidance for Worktrunk (the `wt` CLI) — git worktree management, hooks, and config. Load when editing .config/wt.toml or ~/.config/worktrunk/config.toml; adding, modifying, or debugging hooks (post-merge, post-start, pre-commit, pre-merge, post-switch, etc.); configuring commit message generation or command aliases; or troubleshooting wt behavior. Also answers general worktrunk/wt questions.
tools
CLI output formatting standards for worktrunk. Use when writing user-facing messages, error handling, progress output, hints, warnings, or working with the output system.
development
Worktrunk-specific guidance for tend CI workflows. Adds codecov polling, Rust test commands, labels, and review criteria on top of the generic tend-* skills. Use when operating in CI.
tools
Worktrunk release workflow. Use when user asks to "do a release", "release a new version", "cut a release", or wants to publish a new version to crates.io and GitHub.