Cursor CLI doesn't send all events defined in hooks

Hey team,

We added hooks in .cursor to send all events using OTEL to a dedicated observability platform. Looking at the logs we generate, i can see the using the IDE works perfectly for our use case, but when working with cursor-agent (cursor cli), it sends only beforeShellExecution & afterShellExecution. All other events are omitted for some reason.

hooks.json (under .cursor directory) :

{

  "version": 1,

"hooks": {

"beforeSubmitPrompt": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"afterAgentResponse": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"afterAgentThought": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"beforeShellExecution": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"afterShellExecution": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"beforeMCPExecution": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"afterMCPExecution": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"beforeReadFile": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"afterFileEdit": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"stop": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"beforeTabFileRead": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ],

"afterTabFileEdit": [

      {

"command": "python3.12 .cursor/hooks/hook_handler.py"

      }

    ]

  }

}

The Python script works fine as i mentioned that all events are being fired correctly if using the IDE.

CLI version:
2026.01.02-80e4d9b
OS:
MacOS

Any suggestions please?

Thanks!

Hey, thanks for the report.

This is the expected current behavior. Cursor CLI (cursor-agent) has partial hook support right now, and only the beforeShellExecution and afterShellExecution events fire. Full hook parity with the IDE, including beforeSubmitPrompt, afterAgentResponse, afterFileEdit, and so on, is on our roadmap.

You can follow the discussion here: Hooks for Cursor CLI

The team is working on expanding hook support in the CLI. We don’t have an ETA yet, but it’s actively planned.

Does it mean that Hooks features will be officially supported for Cursor CLI?
Currently, what’s the status of the implementation? What are the way to configure it, is it exactly same as Cursor IDE? I can’t find anything about Cursor CLI Hooks in docs…

Thanks a lot!

Thanks a lot! looking forward to use this feature!

Current implementation we tried to use is the same as Cursor IDE.

Hey! Yes, official hook support in the CLI is an active part of the team’s roadmap.

Current status:

  • Cursor CLI only supports the beforeShellExecution and afterShellExecution hooks
  • The config is the same as in the IDE. Use .cursor/hooks.json in your project, or ~/.cursor/hooks.json globally
  • Full support for all hook events, like in the IDE, is in development. There’s no ETA yet

The latest CLI announcement (Jan 8, 2026) included a hooks performance improvement, 10 to 20x faster with parallel execution: Cursor CLI (Jan 8, 2026): New commands and performance improvement

You can follow the discussion here: Hooks for Cursor CLI (aka cursor-agent)

Any updates on this by chance? would love if this worked consistently, especially in —print mode :confused: .

Hey, quick status update since January.

Hook support in the CLI has expanded. These hooks now work in the CLI: beforeShellExecution, afterShellExecution, afterFileEdit, postToolUse, stop, and sessionStart. The afterAgentResponse and afterAgentThought hooks still don’t work in the CLI, the team knows about this gap.

For --print mode there’s a useful workaround: the --output-format stream-json flag streams structured JSON events to stdout, including thinking deltas, the full assistant message, and a final result event with token usage and the request ID. It’s basically the same data you’d get from hooks, just via stdout.

Related thread with details: Hooks afterAgentResponse / afterAgentThought not firing in headless CLI

Which exact hook events do you need in --print mode? That’ll make it easier to suggest the best workaround.