Expose is auto-run active in env var or hook input

Feature request for product/service

Cursor CLI

Describe the request

Expose is auto-run active in env var or hook input for preToolUse, subagentStart, beforeShellExecution, beforeMCPExecution, beforeReadFile or some of them.

Hi @ofir-drift,

Thanks for the feedback. It would help a lot if you could share more details about your use case. Specifically:

  • What would having this feature enable you to do?
  • What are you currently unable to accomplish without it?

I built a notification system around the cursor hooks.

One of the features is to notify me that the agent requires a permission, I pass back {“permission”:“ask”} always.

I don’t want the notification to run when “auto-run” is enabled, I guess the current flow is agent requires perm → call hook → hook returns “ask” → is auto-run enabled → run or wait for user input.

I see 2 possible solutions for this:

  1. Enable the hook to know is auto-run enabled or not. via hook input or env var
  2. Don’t call the permission ask hooks if auto-run enabled.

I think knowing either auto-run enabled or not in the hook context will be more feature complete (solution 1)

Using hooks for notifications but wanting to suppress them when auto-run handles approvals automatically is a clean pattern.

Today, hooks don’t receive any information about the current auto-run state, so there’s no way to conditionally skip your notification logic. Your solution 1 (adding it to the hook input) would be the most flexible approach.

Thanks @mohitjain

Would this change will be introduced soon?

We’ll be tracking this post for the demand by users for this feature. No ETA yet.