No mechanism to trigger hooks or inject messages into Cursor when agent is idle

Feature request for product/service

Cursor IDE

Describe the request

The Cursor hooks system is entirely reactive. Every hook (sessionStart, stop, beforeSubmitPrompt, etc.) fires in response to agent loop events initiated by the user inside Cursor. There is no external API, file watcher trigger, socket, or CLI entrypoint that allows an outside process to:

  1. Start a new agent session
  2. Submit a prompt programmatically
  3. Signal Cursor that a queued message is ready to be sent

Use case:

A Python process listens for messages from Discord and forwards them to Cursor as agent prompts. When a session is already active, messages can be queued and drained via the stop hook’s followup_message output.

However, when Cursor is idle (no active session), there is no hook that fires and no supported way to trigger one externally, so queued messages are stranded indefinitely until the user manually starts a new session.

What is needed:

  • A CLI command or IPC mechanism to submit a prompt to Cursor from an external process, optionally starting a new session if one is not active
  • A file-watch or named-pipe trigger that Cursor monitors, which starts a session and submits a prompt when a message appears
  • An onIdle or onQueuedMessage hook type that external processes can poke to wake Cursor up

Workaround limitations:

A flag file can track whether a session is active, but even knowing Cursor is idle does not help because there is no supported way to then open a session and send a message into it. The external process is still blocked.

Any workflow that bridges an external event source (Discord, Slack, CI, webhooks, cron) to Cursor as an agent prompt is fundamentally blocked when Cursor is idle. The hooks system covers the inside of a session well but has no inbound surface for external triggers.

I would also prefer to not have a forever-looping ‘checker’ agent message as the solution !

Operating System (if it applies)

MacOS