ContextCode BetaGoing 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 review retry-a retry-b -- cargo test

Parallel checks and ranked diffs for the candidates that pass.

/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 review <candidate> [candidate ...] -- <check command>
/worktree merge                   merge back, stay in the worktree
/worktree done                    merge back, clean up, return
/worktree rm [--force] <name>      remove one, with --force for unmerged work
/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.

Compare candidates before you merge

If you have several versions of a change, get their names from /worktree list and give each the same remote check.

Code
/worktree review retry-a retry-b -- cargo test

ContextCode Beta checks the candidates in parallel. A candidate needs a successful exit and no reported new failures to make the review. A failed or refused check appears with its reason. Passing candidates are ordered by check time, then by the size of the diff. Each preview shows the checked tree, including eligible uncommitted changes present when it ran.

Every candidate stays in its worktree. You decide which change to merge. If no candidate can be checked, use /microcompiler why <command> to see whether the command can run remotely. See Run build, test, and lint checks.

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