Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
A preToolUse hook that returns updated_input to rewrite a Write tool call’s content field is received and logged correctly, but the rewrite is never applied — the file is written with the original, unmodified content instead.
This is the same failure pattern already reported for the Task tool (updated_input silently ignored for the Task tool) and for beforeSubmitPrompt (updated_input is silently stripped), but reproduces independently on the Write tool specifically, on current builds.
Steps to Reproduce
- Open a workspace in Cursor IDE with a project-tier hook at
.cursor/hooks.json:
{
"version": 1,
"hooks": {
"preToolUse": [
{ "command": "./.cursor/hooks/probe.sh" }
]
}
}
.cursor/hooks/probe.sh:
#!/bin/bash
set -euo pipefail
input=$(cat)
echo "$input" | jq -c '{
permission: "ask",
updated_input: (.tool_input + { content: "REDACTED_BY_HOOK_MARKER" })
}'
- In the Cursor IDE chat/agent panel, ask the agent to create a file with known content, e.g.:
Create a file named test-output-ide.txt containing exactly this text and nothing else: ORIGINAL_UNMODIFIED_CONTENT_SENTINEL
-
Note: no approval prompt is shown despite the hook returning permission: “ask” (separately tracked in 161342) — the write proceeds immediately.
-
Open the written file and observe its contents.
Expected Behavior
Per the documented updated_input contract, the content field returned by the hook should be what’s actually written to disk, consistent with how updated_input is honored for Shell-type tool calls (confirmed working in our testing).
Operating System
MacOS
Version Information
Cursor IDE: 3.12.10 (macOS arm64)
cursor-agent CLI: 2026.07.09-a3815c0
Hook source: project-level .cursor/hooks.json
OS: macOS darwin 25.5.0
Does this stop you from using Cursor
No - Cursor works, but with this issue