Cursor CLI does not run enterprise or team beforeSubmitPrompt hooks

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

cursor-agent reads an enterprise hooks.json and then never runs its beforeSubmitPrompt hook. No error, no warning, nothing in the output. The same config works in the IDE, so this is CLI only.

Steps to Reproduce

  1. Install an enterprise hooks.json at /Library/Application Support/Cursor/hooks.json with a beforeSubmitPrompt command hook that writes a marker file.
  2. Run cursor-agent and send a prompt.
  3. The marker file is never written. The hook does not run.

The config itself is fine. It loads and parses with no errors reported.

Expected Behavior

An enterprise hooks.json that defines beforeSubmitPrompt runs that hook on every prompt submission in cursor-agent, the same as it does in the IDE. The docs list Enterprise as the highest priority scope and state that all matching hooks from every source run.

Operating System

MacOS

Version Information

cursor-agent 2026.09.26-dd393fe, macOS arm64

Additional Information

Cause

The loading side is not the problem. I confirmed the enterprise config is read and parsed correctly, and that once the hook executor is reached it picks up enterprise hooks and runs them.

The problem is in between. In the shipped bundle (9352.index.js) the call to executeHookForStep for beforeSubmitPrompt sits behind a pre-check that does not consult every configured hook scope. For an enterprise or team config that pre-check fails, so the executor is never called and the event is skipped.

Also: --print mode

In cursor-agent -p, beforeSubmitPrompt does not fire at all. Anything scripted or running in CI gets no prompt hooks.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Nadav_Claude_Cohen, thanks for the report, and for tracking down where it’s skipped.

You’re right on both counts. In interactive cursor-agent, beforeSubmitPrompt currently only fires when a user-level or project-level hooks.json also defines that event, so an enterprise-only (or team-only) beforeSubmitPrompt never runs. In -p / --print mode, beforeSubmitPrompt isn’t emitted at all right now. Both are already being tracked, and I’ve added your report to them.

In the meantime, for interactive sessions you can unblock the enterprise hook by adding a pass-through beforeSubmitPrompt entry at user level (~/.cursor/hooks.json) or in the project’s .cursor/hooks.json:

{
  "version": 1,
  "hooks": {
    "beforeSubmitPrompt": [
      { "command": "echo '{\"continue\": true}'" }
    ]
  }
}

Once that entry exists, the CLI runs every configured beforeSubmitPrompt hook, including the enterprise one. A block from the enterprise hook still wins, because any continue: false stops the submission. This workaround does not help -p mode.