Checkout Modes
Every phase skill that changes or reviews code (/exec, /qa, /loop,
/testgen) runs in one of three checkout modes. The mode decides where the
work happens and which worktree steps the skill runs or skips.
The mode is chosen only by environment variables that the launcher sets.
It is never inferred from git state. A fresh clone on main with no
../worktrees/ directory is still standalone unless SEQUANT_CHECKOUT is set.
Inferring it would reopen the failure #899 closed, where skills silently worked
in the main checkout because nothing verified the worktree.
| Mode | Entry condition | Where the work happens | What it skips |
|---|---|---|---|
| orchestrated | SEQUANT_ORCHESTRATOR set, SEQUANT_CHECKOUT unset | The worktree in SEQUANT_WORKTREE, checked by sequant worktree verify before use | Pre-flight git checks and worktree creation. The orchestrator created the worktree. |
| standalone | SEQUANT_ORCHESTRATOR and SEQUANT_CHECKOUT unset | A worktree found by sequant worktree resolve, or created by /exec with new-feature.sh | Nothing. |
| in-place | SEQUANT_CHECKOUT=in-place | A feature branch in the current clone ($PWD) | Worktree creation, sequant worktree resolve and verify, the /exec dev-server smoke test unless SEQUANT_SMOKE=1, and /test. |
In-place mode
Section titled “In-place mode”In-place mode is for a checkout that has no worktree to use. A claude.ai cloud
session is the motivating case: a fresh clone of main, with no sibling
../worktrees/, no sequant binary, and no .claude/.local/ overrides.
| Variable | Value | Effect |
|---|---|---|
SEQUANT_CHECKOUT | in-place | Enters in-place mode. Any other non-empty value halts the phase. |
SEQUANT_BASE_BRANCH | branch name | The base branch. Defaults to main. |
SEQUANT_SMOKE | 1 | Runs the /exec dev-server smoke test, which in-place mode otherwise skips. |
SEQUANT_WORKTREE | (must be unset) | Setting it together with SEQUANT_CHECKOUT=in-place halts the phase. The two modes are mutually exclusive. |
Per-skill behaviour
Section titled “Per-skill behaviour”/exec. On the base branch or a detached HEAD, it createsfeature/<N>-<slug>fromorigin/<base>and checks it out. It derives the branch name the waysequant rundoes, with the slug cut at 50 characters. A later localsequant runphase therefore reuses the branch once it is fetched, instead of creating a second one. On any other branch it keeps that branch. It never runsnew-feature.sh,git worktree add, orsequant worktree resolve, and it turns parallel-group isolation off./qa,/loop,/testgen. They treat$PWDas the worktree and skip both the existence guard and the standalone lookup. They halt if the current branch is the base branch or HEAD is detached. They never create a branch.- All of them. They never invoke
/test. Its local overrides live under.claude/.local/, which is gitignored and absent from a fresh clone. - No
ghneeded. A cloud sandbox has noghCLI. The/execentry block takes the issue title as a placeholder the agent fills in, fromghwhere it exists and from the GitHub MCPissue_readtool where it does not, and the PR is opened the same way. The first dogfood session halted on exactly this:gh: command not foundinside the block.
The AC loop, quality gates, mutation record, PR creation and verdict comment
are unchanged. If SEQUANT_ORCHESTRATOR is also set, its non-worktree
behaviours still apply, such as fewer GitHub comments.
Do not export SEQUANT_CHECKOUT in a shell you run sequant run from.
sequant run passes its own environment through to every phase and sets
SEQUANT_WORKTREE. With both set, every phase halts on the mutual-exclusion
check. Set the flag per session, in the launcher that starts the cloud session.
No hook change is needed. The pre-tool.sh commit guard already allows commits
on a non-base branch in the main checkout.
Example
Section titled “Example”# In a fresh clone, on mainSEQUANT_CHECKOUT=in-place claude "/exec 123" # creates feature/123-<slug>, opens a PRSEQUANT_CHECKOUT=in-place claude "/qa 123" # reviews the checked-out feature branchSee also
Section titled “See also”- Worktree Isolation: the worktree strategy the other two modes use
- Run Command: how
sequant runsets the orchestrated variables