Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When a beforeSubmitPrompt hook returns {"continue":false}, Cursor blocks the submission and shows “Submission blocked by hook”. The model does not reply. But the blocked prompt stays in the chat, and when I send my next message in that chat, the model receives the blocked prompt as part of the conversation.
Steps to Reproduce
- Create
~/.cursor/block.sh:
and run#!/bin/sh if grep -q 'BLOCKME'; then echo '{"continue":false,"user_message":"blocked"}' else echo '{"continue":true}' fichmod +x ~/.cursor/block.sh. - Add it to
~/.cursor/hooks.json:{ "version": 1, "hooks": { "beforeSubmitPrompt": [{ "command": "./block.sh" }] } } - In a new Agent chat, send:
BLOCKME the secret word is pineapple. Cursor shows “Submission blocked by hook”, and the model does not reply. - In the same chat, send:
What was my previous message?
Expected Behavior
The model doesn’t know about the blocked message. A prompt blocked by beforeSubmitPrompt should never be sent to the model: not then, and not later as conversation history. It should either be removed from the chat or excluded from what is sent.
Operating System
MacOS
Version Information
Version: 3.23.12 (Universal)
VS Code Extension API: 1.128.0
Commit: 2d29876d567da1607532b23bbf2cd5ddbca496f0
Date: 2026-10-01T04:41:16.627Z
Layout: IDE
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 27.0.0
For AI issues: which model did you use?
Opus 5.5
Additional Information
- The hooks log shows the block was applied as expected (“Merged 2 valid response(s) for step beforeSubmitPrompt”, both replies
{"continue":false}). On the next submission in that chat, the model received the earlier blocked text as the previous user message. - Request ID of a blocked submission:
1c91f811-99fa-403e-ac78-d07d524ec46a - I found this while building aside-jot, which uses
beforeSubmitPromptto save>>notes locally without sending them to the model. Tracking issue: Cursor: a blocked jot is sent to the model with the next prompt · Issue #25 · kacxx/aside-jot · GitHub
Does this stop you from using Cursor
No - Cursor works, but with this issue