Feature request for product/service
Cursor IDE
Describe the request
Goal
Keep the main Agent conversation as a thin coordinator. I do not want
Read / Shell / Write / MCP to run (or dump output) in the parent context.
The parent should only plan and delegate. Actual tool use should happen
inside Task subagents (explore, shell, generalPurpose, custom), which
return a short summary.
Desired flow
- User talks to the main Agent.
- Main Agent decides work is needed and would normally call a tool.
- A hook on the PARENT session denies that tool (or never lets it run).
- The same hook (or a follow-up) routes the work to the right subagent:
- codebase search / file reads → explore
- terminal / git / scripts → shell
- multi-file implementation → generalPurpose or a custom agent
- Subagent runs tools in its own context window.
- Parent only receives the subagent final message.
Why today’s hooks are not enough
- I can deny tools in preToolUse / beforeShellExecution, but those events
do not say whether the caller is the parent or an already-running
subagent. If I block Shell globally, I also block the shell subagent. - subagentStart / subagentStop fire on the parent and do not tag later
tool/shell payloads with subagent_id / parent_conversation_id.
Staff have confirmed this: conversation_id linkage is broken
(forum 163054, 166533). - Hooks cannot spawn or resume a subagent. The only workaround is deny +
agent_message (“use the Task tool”), which still burns parent turns and
does not keep tool I/O out of the parent if the model ignores it.
Ask
-
Identity on every tool/shell/MCP/file hook (required)
- is_subagent: boolean
- subagent_id: string | null
- subagent_type: string | null
- parent_conversation_id: string | null (must differ from the child’s
conversation_id)
Then a hook can: allow Task only on the parent; allow Shell/Read/Write
only when is_subagent === true. -
Optional: route from the hook (nice to have)
On preToolUse / beforeShellExecution when is_subagent is false,
allow the hook to return something like:{
“permission”: “deny”,
“delegate”: {
“subagent_type”: “shell”,
“task”: “”,
“resume_subagent_id”: null
},
“agent_message”: “Delegated to the shell subagent.”
}Cursor would start/resume that subagent and feed only the summary back
to the parent. Without (2), (1) still lets us enforce “parent may only
call Task” and “tools only inside subagents.”
Policy I want to encode
- Parent: Task allowed; Shell, Read, Write, MCP, file edits denied.
- explore: Read / grep-style tools allowed; writes denied.
- shell: Shell allowed (with our command matchers).
- generalPurpose: full tools.
Until (1) ships, this policy is unsafe: a deny-all-tools hook would
disable the subagents that are supposed to do the work.
Related
https://cursor.com/docs/hooks.md
https://cursor.com/docs/subagents.md