Going parallel

Working on a branch without leaving your session

Move the whole session onto an isolated branch, merge it back in one command, and undo the merge if you change your mind.

/worktree new billing-migration

Your session — edits, checkpoints, history — moves to an isolated branch.

/worktree done

The work merges back and the worktree is cleaned up.

/undo

Right after a merge, reverts it in one step.

Why bother

Your working tree is the thing you can't afford to have corrupted. A worktree gives the risky work its own checkout, so an experiment that goes badly is a branch you delete rather than a mess you have to unpick.

Background agents already use one each — that's how several of them work at once without racing. This is the same mechanism, for you.

The commands

Code
/worktree new <name>              start one, from the current branch
/worktree new <name> --from main  start one from a specific ref
/worktree switch <name>           move between them
/worktree switch main             back to where you started
/worktree merge                   merge back, stay in the worktree
/worktree done                    merge back, clean up, return
/worktree rm <name>               throw it away unmerged
/worktree prune                   reclaim ones left by crashed runs

Your session moves with you

This is the part that isn't just git worktree. /worktree new takes the conversation, the checkpoints, and the history with it. Restart csc later and the session resumes into its worktree — you don't have to remember where you were.

Merging, and changing your mind

/worktree done merges and cleans up. If the merge was a mistake, /undo straight afterwards reverts it in one step: your branch goes back, and the worktree comes back with it.

Cleaning up

Crashed runs and abandoned experiments leave worktrees behind. /worktree prune reclaims anything no longer referenced. It's safe to run whenever the list looks longer than it should.

Turning it off for agents

Agents isolate by default. If your project can't work in a secondary checkout — some build systems hard-code absolute paths — turn it off:

JSON
{ "agents": { "worktrees": false } }

If it doesn't work

/worktree new fails. Uncommitted changes that conflict with the base ref, usually. Commit or stash first.

The merge conflicts. It's an ordinary git conflict. Resolve it in the files, then /worktree done again.

A worktree I deleted is still listed. /worktree prune clears stale entries left by a crash.

Next