Skip to content

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.

ModeEntry conditionWhere the work happensWhat it skips
orchestratedSEQUANT_ORCHESTRATOR set, SEQUANT_CHECKOUT unsetThe worktree in SEQUANT_WORKTREE, checked by sequant worktree verify before usePre-flight git checks and worktree creation. The orchestrator created the worktree.
standaloneSEQUANT_ORCHESTRATOR and SEQUANT_CHECKOUT unsetA worktree found by sequant worktree resolve, or created by /exec with new-feature.shNothing.
in-placeSEQUANT_CHECKOUT=in-placeA 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 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.

VariableValueEffect
SEQUANT_CHECKOUTin-placeEnters in-place mode. Any other non-empty value halts the phase.
SEQUANT_BASE_BRANCHbranch nameThe base branch. Defaults to main.
SEQUANT_SMOKE1Runs 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.
  • /exec. On the base branch or a detached HEAD, it creates feature/<N>-<slug> from origin/<base> and checks it out. It derives the branch name the way sequant run does, with the slug cut at 50 characters. A later local sequant run phase therefore reuses the branch once it is fetched, instead of creating a second one. On any other branch it keeps that branch. It never runs new-feature.sh, git worktree add, or sequant worktree resolve, and it turns parallel-group isolation off.
  • /qa, /loop, /testgen. They treat $PWD as 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 gh needed. A cloud sandbox has no gh CLI. The /exec entry block takes the issue title as a placeholder the agent fills in, from gh where it exists and from the GitHub MCP issue_read tool where it does not, and the PR is opened the same way. The first dogfood session halted on exactly this: gh: command not found inside 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.

Terminal window
# In a fresh clone, on main
SEQUANT_CHECKOUT=in-place claude "/exec 123" # creates feature/123-<slug>, opens a PR
SEQUANT_CHECKOUT=in-place claude "/qa 123" # reviews the checked-out feature branch