# Cursor CLI does not run enterprise or team beforeSubmitPrompt hooks

**URL:** <https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219>\
**Category:** Bug Reports\
**Tags:** cli, hooks\
**Created:** [September 28, 2026, 1:35pm UTC](https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219 "2026-09-28T13:35:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadav\_Claude\_Cohen](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@Nadav\_Claude\_Cohen](https://forum.cursor.com/u/Nadav_Claude_Cohen)\
**Post date:** [September 28, 2026, 1:35pm UTC](https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219/1 "2026-09-28T13:35:28Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [September 28, 2026, 5:09pm UTC](https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219/6 "2026-09-28T17:09:58Z")

</div>

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`:

```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.

---

<div class="post-metadata">

**Author:** ![Ankit\_Silla](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Ankit\_Silla](https://forum.cursor.com/u/Ankit_Silla)\
**Post date:** [November 5, 2026, 5:15am UTC](https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219/10 "2026-11-05T05:15:08Z")

</div>

Hi @Colin ,  
Is this still an issue that enterprise or plugin’s hooks.json never gets triggered for beforeSubmitPrompt or any other?  
Do we need to rely on creating entry at user level (`~/.cursor/hooks.json`) or in the project’s `.cursor/hooks.json`to trigger the hooks?

Context:  
We were thinking of relying on hooks to track the skills present in the plugin we created.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [November 5, 2026, 10:19am UTC](https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219/11 "2026-11-05T10:19:06Z")

</div>

Everything in my post above is still true, specifically for the Cursor CLI.

> [@Cursor CLI does not run enterprise or team beforeSubmitPrompt hooks](https://forum.cursor.com/t/cursor-cli-does-not-run-enterprise-or-team-beforesubmitprompt-hooks/173219/6):
>
> 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 interacti…
