Where does the bug appear (feature/product)?
Cloud Agent (GitHub, Slack, Web, Linear)
Describe the Bug
On Cursor-managed Cloud Agents, subagentStart and subagentStop project hooks never run when the agent spawns a subagent with the Task tool. The docs (Hooks → Cloud agent support) list both as supported in cloud agents.
Other hooks from the same .cursor/hooks.json run normally on the same VM, in the same chat: beforeShellExecution, afterShellExecution, preToolUse, postToolUse, beforeReadFile, and stop.
We ran two independent tests on fresh cloud agents with a passive probe on all 18 documented agent hook events. Result:
| Spawn | subagentStart |
subagentStop |
Parent preToolUse for the Task call |
|---|---|---|---|
Foreground, generalPurpose |
never | never | never |
Foreground, explore |
never | never | never |
Background, generalPurpose |
never | never | never |
Other observations from the same test:
- The children’s own tool hooks do fire. Each child logs
preToolUse/beforeShellExecution/postToolUseunder its ownconversation_id(abc-…id that differs from the parent’s). - A child fires no
stopand nobeforeSubmitPrompt.stopfired only for the parent turn. - The hook payload of a child has no field that links it to the parent (no
parent_conversation_id, nosubagent_id, no task text).transcript_pathisnullfor the parent and for every child. - Inside a child, the agent metadata socket (
/v1/meta-data/agent/id) returns the parent’s agent id, not the child’s. - The spawn tool call shows
agentId: bc-…andmachine: sameMachine. So on cloud a subagent seems to be a separate child agent on the same VM. This may be why the subagent lifecycle hooks are skipped (possibly since “Subagents on their own machines”, Aug 19).
As a result, a cloud agent’s hooks cannot observe or gate subagents. Any workflow that records subagent start/stop or blocks certain subagent types works locally but silently does nothing in cloud agents.
Steps to Reproduce
- Commit this
.cursor/hooks.json(the script must be committed and executable):
{
"version": 1,
"hooks": {
"subagentStart": [{ "command": ".cursor/hooks/trace.sh subagentStart" }],
"subagentStop": [{ "command": ".cursor/hooks/trace.sh subagentStop" }],
"preToolUse": [{ "command": ".cursor/hooks/trace.sh preToolUse" }],
"postToolUse": [{ "command": ".cursor/hooks/trace.sh postToolUse" }],
"beforeShellExecution": [{ "command": ".cursor/hooks/trace.sh beforeShellExecution" }],
"stop": [{ "command": ".cursor/hooks/trace.sh stop" }]
}
}
- Commit
.cursor/hooks/trace.sh(mode 755):
#!/usr/bin/env bash
# Passive probe: saves the hook payload, prints nothing, always exits 0.
mkdir -p /tmp/hooktrace
cat > "/tmp/hooktrace/$(date +%s%N)-$1.json"
exit 0
- Start a new Cloud Agent on that branch with this prompt:
1. Run: echo control
2. Use the Task tool to spawn a foreground generalPurpose subagent: "Run: echo child-A"
3. Use the Task tool to spawn a foreground explore subagent: "Read .cursor/hooks.json and reply with the number of keys under hooks."
4. Use the Task tool to spawn a background subagent: "Reply with the word OK." Wait until it has finished.
5. Run: ls /tmp/hooktrace
- Look at the file list from step 5.
Expected Behavior
One subagentStart and one subagentStop for each of the three subagents, with the documented payload (subagent_id, subagent_type, task, status, …).
Actual Behavior
There are files for beforeShellExecution, preToolUse, postToolUse, stop, and the children’s own tool hooks. There are zero subagentStart and zero subagentStop files. There is also no preToolUse for the Task call itself.
Operating System
MacOS
Version Information
Version: 3.22.12 (Universal)
VS Code Extension API: 1.128.0
Commit: 3a92974361033b2051526321308c2740fe5912c0
Date: 2026-09-26T04:55:12.125Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0
Cloud Agent (Cursor-managed VM): hook payloads report "cursor_version": "1.0.0" (looks like a placeholder).
For AI issues: which model did you use?
Not model-specific. Seen with claude-opus-5-5-high (parent agent and generalPurpose subagents) and composer-2.5 (explore subagent).
For AI issues: add Request ID with privacy disabled
- Test 2 (all 18 hooks traced) — parent: bc-00c63660-f7d2-4a1b-8315-36ea8bf7dd26
- children: bc-0df15be6-fc6c-5b61-8549-d4f70d8c0442 (generalPurpose, foreground)
- bc-877fc796-d4f7-529a-bd0f-2f6dab7e3703 (explore, foreground)
- bc-4c5a87de-ded7-520f-a07a-8866cdcc1306 (generalPurpose, background)
- children: bc-0df15be6-fc6c-5b61-8549-d4f70d8c0442 (generalPurpose, foreground)
- Test 1 — parent: bc-59599119-0dda-4b45-b663-cb314004c755
- child: bc-269f5187-99e6-551c-8469-cbe40cae28a0 (generalPurpose, foreground)
Request ID: d2ef66e2-4b95-43c3-bf16-0857b5540431
Does this stop you from using Cursor
Yes - Cursor is unusable