← ClaudeAtlas

workflow-worktree-sessionlisted

Use when the user mentions "worktree" to start, switch, or end a worktree session — routes to `EnterWorktree` / `ExitWorktree` so the running claude moves into the worktree without restart. Covers switching into an existing worktree (`git worktree add` then mid-session entry), pivoting current work into a new worktree, and exiting back. Does NOT replace `superpowers:using-git-worktrees` for new feature kickoffs (consent, ignore-check, baseline tests).
lugassawan/swe-workbench · ★ 2 · AI & Automation · score 71
Install: claude install-skill lugassawan/swe-workbench
# Workflow: Worktree Session **Announce at start:** "I'm using the workflow-worktree-session skill to move the session into the worktree." ## Decision tree Read the user's prompt and pick exactly one mode: ### Mode A — Switch into an existing worktree Triggers: user named or pointed at a worktree that already exists ("open the `feat-login` worktree", "switch to `test-enter`", "move into `.worktrees/auth`", "cd into the worktree I made"). 1. Discover the path. Resolve rimba using the detection helper in `workflow-development` Phase 1 (`$RIMBA`). If non-empty, run `$RIMBA list --json` to list worktrees. Otherwise use `git worktree list --porcelain`: ```bash git worktree list --porcelain \ | awk '/^worktree /{path=substr($0,10); branch=""} /^branch /{branch=substr($0,8)} /^$/{print path, (branch ? branch : "(detached)")}' ``` Match the user's name against branch names or directory basenames. If no match is found, tell the user no worktree matched their description and stop — do not call `EnterWorktree` with an empty path. 2. Call `EnterWorktree(path=<absolute-path>)`. 3. Confirm: run `git rev-parse --git-dir --git-common-dir` and verify the two paths differ (linked worktree, not main). Report the new CWD. ### Mode B — Create a new worktree for this task Triggers: "in a fresh worktree", "in a new worktree", "spin up a worktree for this". Defer entirely to `superpowers:using-git-worktrees`. That skill handles consent, `.gitignore` safety check, baseli