Feature Request: Allow hook to approve commands, otherwise ask user

Resolved 💬 4 comments Opened Jul 19, 2025 by MrGreenTea Closed Jul 25, 2025

Right now I use a simple script to apply some conservative heuristics to gh commands and approve read only ones. I wanted to be asked for less safe commands. This does not currently seem to be possible.

How I do it:

  • Add Bash(gh:*) as allowed tool (otherwise I would be asked to allow it before my PreToolUse hook is called)
  • Have a PreToolUse hook with Bash matcher that checks if we're running some gh call.
  • Log {"decision": "approve"} for things like gh issue list / Log {"decision": undefined} for things like gh issue create

What I want it to do is that I interactively asked to confirm if I want to allow the tool call if decision is undefined. Currently this does not work. It just gets approved as well :/

I don't know if this is a change to PreToolUse or PreToolAproval should be added. Would love to discuss this. It would be really great and make claude way more usable for me. I don't want to take care of a giant list of Bash(gh repo view) entries in my allow list. Or maybe add a their "decision": "interactive" state?

View original on GitHub ↗

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