Claude needs input. Get a notification.

Add a focused Claude Code notification hook on macOS, test it without approving a risky action, and troubleshoot silent alerts and duplicate notifications.

On macOS, Claude Code can run a small notification command when it needs your attention. The setup below listens for permission and idle notifications. It does not automatically approve anything, send your transcript elsewhere, or require a new service.

Add a focused Notification hook

Open ~/.claude/settings.json. If it already contains settings, merge this event into the existing hooks object; do not replace the entire file. Keep any notification hooks your workspace app already installed.

{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt|idle_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Open the session to continue.\" with title \"Claude Code needs you\"'"
          }
        ]
      }
    ]
  }
}

The message is deliberately generic. It does not interpolate the prompt, tool input or repository path into a shell command or a lock-screen notification. The event matcher limits this example to two notification types; other events can be added when you have a reason to act on them.

Check the command before testing the hook

Run the same osascript command directly in a terminal. You should see a notification or find it in Notification Center. If it is silent, check macOS notification permissions for the sending app and whether a Focus mode is suppressing alerts.

Then start a fresh Claude Code session and open /hooks. Verify that the Notification entry appears. A visible desktop notification from your manual command proves macOS can display it; it does not yet prove Claude is triggering the hook.

Test a real request without approving it

In a disposable local project, use the normal permission mode and ask for a harmless action that your configuration requires you to approve. Leave that request unanswered and switch away. When the notification arrives, return to the session and decline or cancel the request. There is no need to grant a dangerous permission to test an alert.

Idle notifications and permission notifications have different timing. Give the event time to fire; do not treat the absence of an immediate banner as proof the configuration is broken.

If it stays silent

  1. Validate the settings file as JSON. A trailing comma can prevent it loading.
  2. Confirm /hooks lists the event in this project and session.
  3. Check whether the event you triggered matches permission_prompt or idle_prompt.
  4. Check the hook’s command and Claude Code’s diagnostics for an execution failure.
  5. Retest with the terminal unfocused and notifications allowed.

A finished turn is a separate signal

The Stop event concerns a completed agent turn. Do not use it as a substitute for “needs permission,” and do not interpret either event as proof that tests passed. If you enable both, use different messages so you can tell a result ready for review from a blocked decision.

If you get duplicate alerts, inspect the existing hooks and your terminal or workspace notification settings before adding more commands. XAgents’ Needs you view is another place to find sessions waiting for a decision.

Command references checked October 15, 2026: Claude Code hook setup and Notification event reference. Check your installed CLI’s help if a flag is unavailable.

Common questions

Which Claude Code hook signals that input is needed?

The Notification event can be filtered by notification type. The example here listens for permission_prompt and idle_prompt; Stop is a different event for a finished turn.

Does a notification approve Claude’s request?

No. The notification only calls your attention to the session. Read the request and make the decision in Claude Code.

Keep reading

The XAgents team