spawn_subagent
Launch a Cursor subagent asynchronously with a prompt, returning a run_id to track progress and observe events for non-blocking task delegation.
Instructions
Launch a Cursor subagent with the given prompt. Returns immediately with a run_id; the subagent runs asynchronously. Model must be in the allowlist. Use get_subagent_events or subscribe to subagent:///events to observe progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (must be under CURSOR_HARNESS_CWD_ROOT). | |
| mode | No | Cursor mode. Defaults to 'agent'. | |
| model | No | Model to use. Allowed: auto, gpt-5.2, claude-opus-5-thinking-high, claude-opus-4-8-thinking-high, composer-2.5. | |
| prompt | Yes | Initial task prompt for the subagent. | |
| sandbox | No | Sandbox mode. Defaults to 'enabled'. | |
| permission | No | Tool-approval posture. 'read' = read-only (forces --mode=ask if mode not set); 'auto' (default) = safe tools auto-approved via --auto-review + --trust; 'trust' = fully autonomous via --yolo + --trust. Choose based on the parent Claude session's own permission mode. | |
| timeout_ms | No | Per-turn timeout in milliseconds. | |
| context_files | No | File paths to reference in the prompt. |