Feature: Add OnPermissionRequest hook event

Resolved 💬 3 comments Opened Jan 19, 2026 by ojdx Closed Jan 23, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Summary

Add a hook event that fires when Claude Code prompts the user for permission approval.

Use Case

Currently building a workflow that logs Bash commands via PostToolUse hooks to learn which permissions are frequently requested, then suggests adding them to settings.local.json on session shutdown. This reduces repetitive approval prompts over time.

However, PostToolUse only fires after approval. A dedicated OnPermissionRequest hook would enable:

  • Logging which permissions are requested (before approval/denial)
  • Custom auto-approval logic based on context
  • Building permission learning into workflows
  • Tracking denied permissions to understand friction points

Current State

  • PreToolUse and PostToolUse hooks exist
  • No hook fires when a permission prompt is shown to the user

Proposed

{
  "hooks": {
    "OnPermissionRequest": [{
      "matcher": "Bash",
      "hooks": [{ "type": "command", "command": "log-permission-request.sh" }]
    }]
  }
}

Hook input could include:

  • tool_name - which tool is requesting permission
  • tool_input - the parameters (e.g., the bash command)
  • permission_type - what kind of permission is being requested
  • outcome (if post-decision variant) - whether it was approved/denied

Alternatives Considered

Currently using PostToolUse on Bash to log commands after execution, but this misses:

  • Commands that were denied
  • The permission request itself (only see what was approved)

View original on GitHub ↗

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