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