Resume the newest handoff in an isolated worktree, then load its context. Reuse the documented worktree/branch if it still exists; create a new one only when none is documented or it's gone. Orchestrates branch and session-resume — do not reimplement their internals.
-
Find the handoff. Use session-resume's discovery (shared handoffs/ dir, then legacy in-tree dirs). Prefer newest intentional pause-*.md; fall back to a mechanical auto-*.md only if none exists. Path arg → use it. Date/topic/slug arg → filter by it. No arg → newest intentional handoff. Multiple matches → list the 5 most recent and ask. None → say so, stop. Read the file. Tip: run /pm first for a picture of all in-flight lanes.
-
WIP/worktree safety first. Run git worktree list and read the shared journal ($(bash ~/.claude/coordination/resolve-coord-dir.sh)/journal.md; the in-tree docs/worktree-journal.md is only a tombstone pointer). If another session has uncommitted WIP or an overlapping active worktree, surface it and pause. Never branch on top of another session's WIP.
-
Resume-or-create. Check the handoff + journal for a documented branch/worktree (Branch:/Worktree: line, ## Parked entry, or an "Active" journal entry):
- Worktree present →
cd in, verify git status/git branch, resume. No new branch.
- Branch exists, worktree gone (parked on
origin/<branch> or local-only) → re-add: git worktree add ../<repo>-<slug> <branch> (or /branch <slug> --reuse). Resume on the existing branch.
- Nothing documented, or both gone (shipped & pruned, or the handoff describes new work) → go to step 4.
Unsure which applies → state findings and ask.
-
(New work only) Create the worktree. Derive a slug — prefer an arg, else propose one from the handoff's "next" work (kebab-case, ^[a-z][a-z0-9-]*$; confirm if ambiguous). Invoke branch with it — it owns the path convention, journal entry, and base (default main). Don't hand-roll git worktree add.
-
Project setup, if the repo needs it (fresh/re-added worktree only). Fresh worktrees have no deps/secrets — check CLAUDE.md/the handoff for the convention (e.g. symlink node_modules, copy .env/.dev.vars). Skip if not needed.
-
Load the context. Summarize done / what's-next / first action. Rebuild TodoWrite from any unchecked ## Checklist/## Instructions items, mirror to docs/summaries/CHECKLIST.md in the worktree. Heartbeat: /branch update --working-on "<next task>".
-
Confirm before working. Present the first concrete next step and ask before proceeding — honor any design gate or /branch-before-code rule the handoff carries.