How to get notified the moment Claude Code needs permission
Claude Code's permission notification, and a Notification hook with the permission_prompt matcher, only fire after the prompt has waited about six seconds. To hear about it the moment Claude asks, add a PermissionRequest hook to ~/.claude/settings.json. Ambient shows an amber needs you pulse at the notch at that same moment, and a click takes you to the waiting tab.
Why the usual alert is late
| Signal | When it fires |
|---|---|
Built-in notification, or a Notification hook with permission_prompt | After the prompt has waited about six seconds |
A PermissionRequest hook | The moment Claude is about to ask you |
A PermissionRequest hook
// ~/.claude/settings.json
{
"hooks": {
"PermissionRequest": [
{
"hooks": [{
"type": "command",
"command": "osascript -e 'display notification \"Claude Code needs your permission\" with title \"Claude Code\"'",
"async": true
}]
}
]
}
}
Keep it silent: a PermissionRequest hook that printed a decision would approve or deny for you. A notification command prints nothing, so Claude still asks you as usual. osascript notifications belong to Script Editor, so allow Script Editor in System Settings › Notifications.
To alert only for shell commands, add "matcher": "Bash"; it matches tool names the same way PreToolUse does. One gap: Claude Code doesn't run PermissionRequest hooks for a sandboxed command's network request, so keep a permission_prompt notification hook if you use the sandbox.
Say what Claude wants to do
The hook receives the request as JSON on its input, with tool_name and tool_input. Save this as ~/.claude/hooks/permission-alert.sh (it needs jq, from brew install jq):
#!/bin/bash
tool=$(jq -r '.tool_name')
osascript -e "display notification \"Claude wants to use $tool\" with title \"Claude Code needs permission\""
Then point the hook's "command" at bash ~/.claude/hooks/permission-alert.sh.
Ambient: the moment it asks, at the notch
Ambient listens to PermissionRequest too. The notch island turns amber at once, a banner says which project needs you and what for (for example Bash: rm -rf build), and a click opens the exact Terminal or iTerm2 tab, tmux pane or Claude desktop chat where Claude is waiting. Ambient doesn't answer for you: you approve in Claude Code itself. If you'd rather approve from the notch, see the apps that can.
Stop babysitting terminals.
Free for macOS 14 and later. Works with Claude Code, Codex and Gemini CLI.
Get AmbientCommon questions
Why does Claude Code's permission notification take six seconds?
Claude Code sends the permission_prompt notification only after the prompt has waited about six seconds. A PermissionRequest hook runs as soon as Claude is about to ask.
Can a hook approve permissions for me?
Yes. A PermissionRequest hook can return decision.behavior as allow or deny. Use it carefully; permission rules in your settings are usually the safer way to pre-approve tools.
Does this work in the VS Code or Cursor terminal?
Yes. Hooks run in any terminal, because they don't depend on the terminal showing notifications.
Sources
- Hooks reference: PermissionRequest, Claude Code docs
- Hooks reference: Notification, Claude Code docs
- Automate actions with hooks, Claude Code docs
More guides: Claude Code sound when done · Claude Code notification apps compared