Harness Notes

Worktrees

Updated 2026-11-22,

On this page

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

QuestionCursor Agentchecked at docs-2026-10-27
Create or enter

The Agents Window creates or moves a task into a worktree. IDE Worktree Skills provide /worktree; the retained CLI documentation records -w/--worktree [name].

Agents Window, IDE skills and CLI are distinct entry points.

CLI flags retained from the existing versioned Forking contract.

Starting state

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.

Session isolation

Agents Window can start or move a task into a separate checkout. In the IDE, /worktree runs the rest of that chat in an isolated checkout.

Subagent isolation

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 agent --worktree [name], which creates a worktree under ~/.cursor/worktrees/<repo>/<name>.

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.

Setup and environment files

Configure .cursor/worktrees.json with setup-worktree, setup-worktree-unix or setup-worktree-windows. Each accepts command arrays or a script path; OS-specific keys take precedence. Setup can copy environment files using ROOT_WORKTREE_PATH.

Review and integrate changes

Review in the Agents Window, keep working there, or commit/open a PR from that checkout. IDE /apply-worktree brings changes into the main workspace; /best-of-n compares isolated runs without merging them automatically.

Exit and cleanup

Partly

IDE /delete-worktree removes a checkout. Cursor 3.5+ documents periodic machine-wide cleanup controlled by cursor.worktreeCleanupIntervalHours and cursor.worktreeMaxCount (default 25). This audit has not established its protections for dirty files or unpushed commits.

The cleanup settings describe the Cursor host version, not a CLI release version.

CLI, tools and APIs

Partly

CLI -w/--worktree [name] is retained in the fork audit; setup configuration is documented for CLI, IDE and Agents Window. A public worktree-management SDK/API contract is not established here.

CLI flags retained from the existing versioned Forking contract.

Commands

No commands recorded.

Notes and sources

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
CLI, tools and APIs, 4