Feature request: PermissionPrompt hook event for desktop notifications

Resolved 💬 2 comments Opened Apr 3, 2026 by Saif0089 Closed May 12, 2026

Problem

There's currently no hook event that fires specifically when Claude Code is about to show a permission prompt to the user. The existing PreToolUse hook fires for all tool calls — including auto-approved ones — making it impossible to build accurate "permission needed" desktop notifications.

Use Case

I want to receive a macOS desktop notification (via terminal-notifier) only when Claude Code is waiting for my permission approval. This is especially useful when:

  • Running Claude Code in VS Code and switching to another app while it works
  • Long-running tasks where Claude works autonomously but occasionally needs approval
  • Multi-monitor setups where the terminal/IDE isn't always visible

What I Tried

I set up a PreToolUse hook that checks the tool name against my allow list in settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "",
        "hooks": [{ "type": "command", "command": "/path/to/notify.sh" }]
      }
    ]
  }
}

The problem: PreToolUse fires before Claude Code's internal permission logic runs. The hook has no way to know whether the tool will be auto-approved or will prompt the user. This results in false notifications for auto-approved tools and no way to filter them.

Proposed Solution

Add a new hook event — PermissionPrompt (or PermissionRequest) — that fires only when Claude Code is about to display a permission prompt to the user. The hook input should include:

{
  "tool_name": "Bash",
  "tool_input": { "command": "rm -rf /tmp/something" },
  "permission_mode": "normal",
  "session_id": "...",
  "hook_event_name": "PermissionPrompt"
}

This would enable:

  • Desktop notifications exactly when permission is needed
  • External approval APIs (future)
  • Permission logging/auditing
  • Custom auto-approval logic based on context

Bonus: External Approval

If the hook could also respond with an approval/denial (similar to how PreToolUse can return allow/deny), this would enable approving permissions from desktop notifications, mobile apps, or web dashboards — without needing to switch back to the terminal.

Environment

  • macOS (Darwin 25.3.0)
  • Claude Code CLI + VS Code extension
  • Using terminal-notifier for macOS notifications
  • The Stop hook works perfectly for "task complete" notifications

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗