Harness Notes

Subagents

Updated 2026-11-24,

On this page

How each harness starts and configures subagents, what they can see and change, which lifecycle hooks run, and how their transcripts are saved and read.

Worktrees: creation, setup, integration and cleanup

Starting one

QuestionCursor Agentchecked at 2026.10.12-d47ca18
Is there one, and how does it start

Yes. The agent launches subagents on its own through its Task tool when a task is complex, guided by each subagent's description; add phrases like "use proactively" to encourage this. You can also ask for one explicitly with /verifier confirm the auth flow is complete or in plain language ("Use the verifier subagent to ..."). There is no @-mention syntax for subagents.

Subagents have been available in the CLI (interactive and headless -p) since March 2026.

Built-in subagents

Two built-ins are documented: Explore, which searches and analyzes the codebase using a faster model so it can run many searches in parallel, and Browser, which drives a browser through MCP tools and filters noisy DOM snapshots and screenshots down to what matters. The agent uses them automatically. In the CLI you can set Explore's model to default, inherit, a specific model, or disabled from /config.

Hook payloads also report general Task subagent types such as generalPurpose and shell, which are not documented as separate built-ins.

Define your own

Create a Markdown file with YAML frontmatter followed by the prompt. Project subagents go in .cursor/agents/ (also read from .claude/agents/ and .codex/agents/), and user subagents go in ~/.cursor/agents/ (also ~/.claude/agents/ and ~/.codex/agents/). When names clash, project beats user, and .cursor/ beats .claude/ and .codex/.

Plugins installed with /plugin can also contribute subagents.

In CLI 2026.10.12, project subagents load from .cursor/agents, .claude/agents and .grok/agents; the documented .codex/agents is not read, and the third-party folders load only while third-party configuration support is on.

What a definition can set

Partly

Documented frontmatter fields are name (defaults to the filename), description (used to decide when to delegate), model (inherit by default, or a model ID with optional bracket parameters such as claude-opus-5[effort=high]), readonly (no file edits or state-changing shell commands), and is_background. The Markdown body is the system prompt. There are no documented fields for a tool allowlist, MCP servers, skills, memory, or sandbox settings.

CLI 2026.10.12 also accepts tools (comma-separated), background (same as is_background) and force-default-model, which the docs don't list.

Cursor may substitute another model if a team admin blocks the configured one, your plan lacks it, or a legacy plan needs Max Mode.

While it runs

QuestionCursor Agentchecked at 2026.10.12-d47ca18
What it sees, and what comes back

A subagent starts with a clean context and does not see your conversation history; the parent must put everything it needs into the task prompt. It inherits the parent's tools, including MCP tools, and in the CLI also your credentials, rules and approval policy. Only its final message comes back to the parent, or an error status if it fails, along with an agent ID you can use to resume it with its context intact.

Several at once

Yes. The agent sends several Task tool calls in one message and they run at the same time; you can prompt for it, for example "Review the API changes and update the documentation in parallel". No concurrency cap is documented, but each subagent uses its own tokens, so five parallel subagents cost roughly five times as much.

Parallel subagents share your checkout by default and can overwrite each other's edits unless you ask for isolation.

Keep working while it runs

Yes. A background subagent returns control immediately and keeps working while you continue; set is_background: true in its definition or let the agent launch it that way. When it finishes, its final message arrives in a completion notification. While it runs, it writes output to ~/.cursor/subagents/, which the parent can read to check progress. Headless -p runs wait for delegated subagents before exiting.

Your checkout or its own copy

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.

Its permissions

Partly

Subagents run under the parent session's approval policy, sandbox setting and Run Everything (--force/--yolo) choice. The only per-definition control is readonly: true, which blocks file edits and state-changing shell commands. A subagentStart hook can allow or deny each launch.

Subagents of subagents

Partly

Yes, one level deep. Since Cursor 2.5, the main agent and its direct subagents can launch subagents, but a subagent started by another subagent cannot launch any more. Nested launches also need Task tool access in the current mode, and hooks or tool policies can block them.

Watching and handing off

QuestionCursor Agentchecked at 2026.10.12-d47ca18
Watch, steer or stop one

In the interactive CLI, each running subagent appears as a live row showing its status, streamed activity and token count, and running subagents also appear in the jobs list. Press Ctrl+O or drill into a row to see the full transcript (prompt, thinking, tool calls, final response). To stop work, interrupt the turn with Esc or Ctrl+C; to redirect a finished subagent, resume it by agent ID with new instructions. Background subagents also write output to ~/.cursor/subagents/.

There is no documented way to message a running subagent directly; steering with Enter goes to the main agent's active turn.

ACP clients that advertise the subagents capability show each subagent as its own child session.

Hand work to a cloud agent

Yes. In the CLI, start any message with & (for example & refactor the auth module and add tests) to send the whole conversation to a Cloud Agent, then pick it up at cursor.com/agents on web or mobile. Handing a single task to a cloud subagent with /in-cloud, or a PR with /autopilot, is documented for the Agents Window in the desktop app, not the CLI.

Cloud subagents use your team's MCP configuration at cursor.com/agents, not your local servers.

/in-cloud and /autopilot are not in the CLI slash-command reference.

Notes and sources

Cursor Agent, 6 sources
  • Shared-checkout parallel edits can overwrite each other; isolation must be requested.
  • /in-cloud routes the next task to a cloud subagent with its own VM and branch; /babysit runs a cloud subagent against a pull request.
  • Cloud subagents use team MCP configuration from cursor.com/agents rather than the local session.
  • Subagent cloud handoff returns a result to the parent and is distinct from the & prompt prefix, which transfers the whole conversation to a Cloud Agent.
Is there one, and how does it start, 2
Built-in subagents, 3
Define your own, 1
What a definition can set, 1
What it sees, and what comes back, 2
Several at once, 2
Keep working while it runs, 2
Your checkout or its own copy, 3
Its permissions, 3
Subagents of subagents, 1
Watch, steer or stop one, 2
Hand work to a cloud agent, 3

Subagent lifecycle hooks

Recorded start and stop events, with their control semantics and availability caveats. A dash means no event is recorded here. General session or tool events do not establish a dedicated subagent hook.

Which moments a hook can attach to, and what it can do there. Event names link to each harness’s documentation. “Block”, “deny” and “modify” change what the agent does; “observe only” can watch but not intervene. Where hook files live is on the Locations page.

MomentCursor AgentHook commands
Hook types
  • command
  • prompt
Subagents
Subagent starts
subagentStart

allow, deny

ask is treated as deny.

Subagent finishes
subagentStop

queue follow-up

The follow-up is used only when the subagent completed.

Notes and sources

Cursor Agent
  • Permission hooks block when output is invalid JSON or does not match the schema; crashes, timeouts and other exit codes fail open unless the hook sets failClosed: true.
  • When several hooks answer, deny beats ask and ask beats allow.
  • Sources run in priority order enterprise, team, project, user; project hooks run only in trusted workspaces.
  • Cloud agents run only command hooks and skip sessionStart, sessionEnd, workspaceOpen, MCP and Tab hooks; no hooks run during early read-only turns.

Subagent transcripts

Child storage and parent links are described separately from the harness’s general session format. Internal and source-observed formats can change between versions; these records do not promise a stable external schema.

QuestionCursor Agentlive-observed; checked at 2026.10.12-d47ca18
Child transcripts and parent links

Partly

Subagent transcripts are written next to their parent at ~/.cursor/projects/<slug>/agent-transcripts/<parentChatId>/subagents/<subagentId>.jsonl, and the subagentStop hook receives the path as agent_transcript_path. Completed subagents keep checkpoints so they can be resumed. A /fork creates a new independent chat in the same ~/.cursor/chats/<hash>/ folder.

Session file format

Partly

The session itself is a SQLite database (store.db) with two tables: meta (hex-encoded JSON with the chat name, mode, model and root blob id) and blobs (content-addressed JSON and protobuf blobs forming a message tree). The JSONL mirror has one object per line: {"role","message":{"content":[...]}} plus {"type":"turn_ended","status"} lines. Neither file format is documented, so treat both as internal and liable to change.

The documented, stable machine format is the headless --output-format json|stream-json stream, not the files on disk.

2026-11-15 packaged-source supplement for CLI 2026.11.13-eacade1 (archive SHA-256 087220ccf1e124dcdf2753601422892042a45a2c577ef0ea25b8a5b0e47bb691): CLI chat store.db still uses SQLite blobs/meta and binary metadata; ACP independently uses acp-sessions/<id>/store.db plus meta.json. The SQLite driver can degrade to an in-memory store after failures, so successful continuation alone does not prove durable writes. The detailed record/blob survey remains pinned to 2026.10.12-d47ca18; no current runtime transcript probe or desktop survey was run.

What is recorded

Partly

store.db keeps the full model context: system prompt, user and assistant messages, tool calls and tool results, reasoning (often stored as redacted reasoning), request ids, and summary archives created by /summarize or automatic summarization. The JSONL mirror keeps user and assistant text (with any thinking text), tool calls as tool_use name and input, and turn-end status, but not tool results or the system prompt. Per-message token usage is not stored in either file.

Token counts are available to afterAgentResponse hooks at run time, not in the saved session.

Read transcripts from code

In print mode, --output-format json emits one final result object on success; stream-json emits NDJSON messages and tool events. A failed run may have no final result. --stream-partial-output adds deltas and duplicate flush events that consumers must distinguish. Session IDs support resume; native ACP has a separately scoped session/load and storage path. The output stream is not the internal SQLite or project transcript schema.

thinking events are left out of print-mode output.

Session record structureCursor Agent
Envelope fieldsid, role, content, providerOptions
Record discriminatorrole
Identifiers and lineageagentId (chat/session id, also the directory name), latestRootBlobId, blob id, message id, toolCallId, parent conversation id (subagents/ path in JSONL transcripts)
OrderingContent-addressed blobs in table blobs(id, data); the conversation is a tree reached from meta.latestRootBlobId (meta table key '0', hex-encoded JSON). A parallel JSONL transcript is append-ordered by line.

Notes and sources

Cursor Agent, 7 sources
Child transcripts and parent links, 3
Session file format, 2
What is recorded, 3
Read transcripts from code, 5