How each harness creates an isolated checkout, what it starts from, and what happens to the changes afterward. Worktrees isolate files; conversation forks and subagent context are separate. Unknown answers mark gaps in the recorded evidence, not proof that a capability is absent.
Forking: conversation history and file isolation
Subagents: delegation and workspace isolation
| Question | Codex CLIchecked at 0.164.0 | Claude Codechecked at 2.1.310 | Cursor Agentchecked at docs-2026-10-27 | OpenCodechecked at v2-docs-2026-10-27 | pichecked at retained-extension-audit | Antigravity CLIchecked at 1.5.14 |
|---|---|---|---|---|---|---|
| Create or enter | Start a local session with CLI/TUI source inspected at 0.164.0. Desktop Worktree mode is a separate host surface. | Use | The Agents Window creates or moves a task into a worktree. IDE Worktree Skills provide Agents Window, IDE skills and CLI are distinct entry points. CLI flags retained from the existing versioned Forking contract. | In Code Mode, call | Not documented The retained audit describes running pi or a subagent extension with a selected working directory. Built-in managed-worktree creation has not been established here; create a checkout externally when needed. | Partly Google documents CLI subagent worktrees under the worktrees directory in app data. Direct interactive CLI creation remains unverified. |
| Starting state | The inspected CLI/TUI creation paths pass no base override, so the manager creates a detached checkout of the source checkout's current The host-local | The default | Not documented This audit does not establish a common starting revision or dirty-change carryover rule across Cursor CLI, Agents Window and IDE Worktree Skills. | Not documented The tools reference delegates worktree strategy to project configuration; this audit does not establish the base revision or dirty-file carryover for every strategy. | Not documented The externally created checkout determines the starting revision and carried files. No pi-specific base selection contract is recorded. | Partly Since 1.5.5 an isolated worker’s Git worktree includes staged, unstaged and untracked changes. Explicit selection of the base ref remains unverified. |
| Session isolation | New sessions can run in a managed worktree. The inspected 0.165.0 TUI resume picker adds a Repo filter alongside Cwd and All when several local worktrees exist, listing sessions from matching directories across linked worktrees. The Cwd filter and | The whole session can enter a worktree, and | Agents Window can start or move a task into a separate checkout. In the IDE, | After creating a checkout, use | Not documented Launch pi in an externally prepared checkout. A session fork changes conversation history; it does not establish a separate filesystem checkout. | Partly The /fork command reuses the existing checkout. Launching a top-level CLI conversation in a harness-created worktree remains unverified. |
| Subagent isolation | Partly The inspected built-in spawn path prepares a child config using the parent turn's This describes the traced built-in path, not every custom host, remote provider or extension. | Request worktree isolation or set | Partly By default, subagents edit the parent's checkout directly, so parallel subagents can overwrite each other. If you ask for isolation ("... each in its own environment"), each subagent gets its own branch, either in a Git worktree on the same machine or in a cloud VM with a fresh clone, and its changes stay on that branch until the parent merges them. In the CLI you can also isolate the whole session with In CLI 2026.10.12, per-subagent isolation sits behind a feature flag that is off by default, so it may not be available in every CLI session. Retained from the Subagents audit checked 2026-10-15; not re-probed for this page. | Subagents run in the parent session's directory and edit your checkout directly; there is no automatic per-subagent worktree or sandbox, so there is nothing to merge. Worktrees exist as separate session tools ( Retained from the Subagents audit checked 2026-10-15; not re-probed for this page. | Not documented The retained example subagent extension uses the parent directory or an explicitly supplied per-task | Google documents Git worktrees for subagents and swarm workers given an isolated repository copy. From 1.5.5 it also documents isolated copies outside Git, with size and entry limits. |
| Setup and environment files | Not documented Provision dependencies and local environment files in the new checkout. The inspected manager materializes committed files; this audit has not established an automatic dependency setup or ignored-file copying mechanism for CLI worktrees. Do not infer desktop setup behavior from the CLI manager or from shared root settings. | Install dependencies in the fresh checkout. | Configure | Not documented Project worktree configuration selects the strategy. Automatic dependency installation, environment-file copying and custom strategy setup semantics have not been traced for this page. | Not documented Provision dependencies and local environment files in the selected checkout. No managed-worktree setup contract is recorded for the audited core/example extension. | |
| Review and integrate changes | Partly Review the detached checkout and preserve the result on a branch or in commits before integrating it with normal Git operations. The inspected creation path returns a checkout with no branch; it does not establish a desktop Apply or automatic merge contract. | Partly Changes stay on the worktree branch for review and integration. Keeping a checkout preserves its files and branch; removing it can discard that work. The documented lifecycle does not promise automatic integration. | Review in the Agents Window, keep working there, or commit/open a PR from that checkout. IDE | Not documented The tools reference describes creation, movement and removal; this audit does not establish an automatic merge or apply-back contract. Review and integrate the resulting checkout according to the configured strategy. | Not documented Use the integration workflow of the externally managed checkout. No automatic apply-back or merge contract is recorded. | |
| Exit and cleanup | CLI settings explicitly disable automatic cleanup. The TUI worktree browser supports explicit removal through the manager: it refuses the current checkout and ignored local files, then calls The manager's removal checks are source evidence, not a runtime-tested guarantee about unpushed commits or desktop cleanup. | Interactive exit checks for local work and new commits before offering keep/remove; a clean unnamed worktree can be removed automatically. Named sessions, submodules and inability to verify state affect cleanup. See the source for the full rules; no cleanup runtime probe was run. 2.1.311 publisher fixes an isolated subagent worktree being removed while a background subagent it spawned is still working there. This supplements the 2.1.310 documentation baseline; no cleanup runtime probe. | Partly IDE The cleanup settings describe the Cursor host version, not a CLI release version. | Partly
| Not documented Cleanup of externally managed checkouts belongs to that workflow. This audit does not establish pi-specific retention or removal safeguards. | Not documented The worktree location is documented. Cleanup triggers and ownership remain unverified. |
| CLI, tools and APIs | Partly CLI entry points create the checkout locally before using App Server. App Server The traced CLI caller and protocol are distinct. Custom hosts and hosted worktree services remain outside this audit. | The CLI supports | Partly CLI CLI flags retained from the existing versioned Forking contract. | Code Mode exposes | Not documented The retained extension accepts a per-task |
Commands
From your shell
Commands you run in a terminal or script, outside a session.
| Task | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.296 |
|---|---|---|
| Set up | ||
| Create | Start a new local session in a managed detached Git checkout. Explicit session forks also accept --worktree. 1 noteSource inspected at 0.164.0; no worktree lifecycle runtime probe. | Create or reopen a session worktree; alias -w. |
Inside a session
Slash commands you type into an open session.
| Task | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.296 |
|---|---|---|
| Use | ||
| Open the manager | Browse managed worktrees and choose actions, including explicit removal. 1 noteSource inspected at 0.164.0; no worktree lifecycle runtime probe. | — |
Notes and sources
Codex CLI, 14 sources
- Source inspection at rust-v0.164.0 (6aaac694803004a63c6f393d153c96d22521a6b9). No lifecycle runtime probe; desktop, hosted services and custom/cloud providers are outside the traced paths.
Create or enter, 4
Starting state, 4
Subagent isolation, 2
Setup and environment files, 1
Review and integrate changes, 1
Exit and cleanup, 4
CLI, tools and APIs, 3
Claude Code, 2 sources
- Publisher documentation reviewed against the 2.1.310 baseline; implementation unavailable and no lifecycle runtime probe.
Create or enter, 1
Starting state, 1
Session isolation, 1
Subagent isolation, 1
Setup and environment files, 1
Review and integrate changes, 1
CLI, tools and APIs, 1
Cursor Agent, 6 sources
- Documentation reviewed 2026-10-27; retained subagent answers keep their original source/version boundaries. No lifecycle runtime probe.
Create or enter, 4
Starting state, 1
Session isolation, 1
Subagent isolation, 3
Setup and environment files, 1
Review and integrate changes, 1
Exit and cleanup, 1
OpenCode, 4 sources
- Documentation reviewed 2026-10-27; retained subagent answers keep their original source/version boundaries. No lifecycle runtime probe.
Create or enter, 1
Starting state, 1
Session isolation, 1
Setup and environment files, 1
Review and integrate changes, 1
Exit and cleanup, 1
CLI, tools and APIs, 1
pi, 1 source
- Retained pi core/example-extension audit from 2026-10-15; no exhaustive extension audit or runtime probe.