Prompt blocked by a beforeSubmitPrompt hook is still sent to the model with the next message

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

  1. Create ~/.cursor/block.sh:
    #!/bin/sh
    if grep -q 'BLOCKME'; then
      echo '{"continue":false,"user_message":"blocked"}'
    else
      echo '{"continue":true}'
    fi
    
    and run chmod +x ~/.cursor/block.sh.
  2. Add it to ~/.cursor/hooks.json:
    {
      "version": 1,
      "hooks": {
        "beforeSubmitPrompt": [{ "command": "./block.sh" }]
      }
    }
    
  3. In a new Agent chat, send: BLOCKME the secret word is pineapple. Cursor shows “Submission blocked by hook”, and the model does not reply.
  4. 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 beforeSubmitPrompt to 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

Hey, and thanks for the detailed repro. I can reproduce it exactly as described.

This is a known issue we’re tracking, and I added your report to it. Right now, a blocked prompt does stay in the chat, and the next message in the same chat can pull it into the model context.

For now, there are two ways to prevent a blocked prompt from ending up in context:

  1. After blocking, start a new chat. Nothing from the old chat carries over.
  2. Or click the blocked message, edit it into what you actually want to send, and resend. Editing replaces the blocked text instead of sending it along with the next message.

I get that for a tool like aside-jot, which relies on blocking, neither option is ideal. I can’t give an ETA yet, but I’ll reply in the thread when there’s an update.