Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
preToolUse hook stdin omits the documented agent_message field for Shell tool calls.
Docs (https://cursor.com/docs/hooks.md) show preToolUse input including agent_message (e.g. “Installing dependencies…”). On Cursor 3.13.25 (macOS), live Shell preToolUse payloads do not include agent_message at all.
The chat UI still shows the Shell title (“Ran …” / tool description), and that value exists internally as bubble toolFormerData.params.commandDescription in state.vscdb, but hooks cannot read it from stdin.
Also: tool_input.description is stripped from the hook payload (only command, cwd, timeout remain). Docs example uses tool_input.working_directory; live payload uses tool_input.cwd instead.
Steps to Reproduce
- Add a preToolUse Shell hook that dumps stdin, e.g. in ~/.cursor/hooks.json:
{
“version”: 1,
“hooks”: {
“preToolUse”: [
{
“command”: “/path/to/dump.sh”,
“matcher”: “Shell”
}
]
}
}
dump.sh:
#!/bin/bash
cat >> /tmp/pretooluse.jsonl
echo ‘{“permission”:“allow”}’
-
In Agent chat, run a Shell tool that has a visible chat title/description (e.g. description “Run local test suite”, command
bun test). -
Open /tmp/pretooluse.jsonl and inspect the JSON object for that call.
Expected Behavior
preToolUse stdin should include agent_message when available (as documented), matching the human-readable Shell title shown in chat.
Ideally tool_input.description should also be forwarded for Shell tools instead of being stripped.
Operating System
MacOS
Version Information
IDE:
Version: 3.13.25
VSCode Version: 1.128.0
Commit: 31e8d61c448c7472e371505838a0fe34083dad50
For AI issues: which model did you use?
grok-4.5 (also reproduced on normal Agent Shell tool calls; appears hook-side, not model-specific)
For AI issues: add Request ID with privacy disabled
N/A (hooks stdin issue; no single chat completion Request ID required to reproduce)
Additional Information
Actual live preToolUse payload (redacted) from Cursor 3.13.25:
{
“conversation_id”: “…”,
“generation_id”: “…”,
“model”: “grok-4.5”,
“tool_name”: “Shell”,
“tool_input”: {
“command”: “/Users/…/.bun/bin/bun test …”,
“cwd”: “”,
“timeout”: 30000
},
“tool_use_id”: “…”,
“cwd”: “”,
“session_id”: “…”,
“hook_event_name”: “preToolUse”,
“cursor_version”: “3.13.25”,
“workspace_roots”: [“…”],
“user_email”: “…”,
“transcript_path”: “…/agent-transcripts/….jsonl”
}
Missing vs docs/chat UI:
- no
agent_messagekey - no
tool_input.description - chat still shows the Shell title; value exists internally as commandDescription on the tool bubble in ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
Impact: hooks that need the same human-readable Shell label as the chat UI cannot use the documented field and must scrape local SQLite/transcripts as a workaround.
Does this stop you from using Cursor
No - Cursor works, but with this issue
