[hookify] Add "ask" action type to prompt user for approval (maps to permissionDecision: "ask")
Feature request
The hookify plugin currently supports two action types:
warn— shows message, allows operationblock— hard deny, no override possible
Claude Code's native hook system supports a third permissionDecision value: "ask", which prompts the user to approve or deny the specific operation. Hookify should expose this as action: ask (or action: confirm).
Use case
I have a hookify rule that guards systemctl enable/disable/stop/start commands. These should require my explicit approval per-command, but:
warnis too weak — the model can reason past itblockis too strong — I can't approve legitimate operations without editing the rule file or running the command manually with!
What I need is: show me a prompt, I click approve or deny. That's exactly what permissionDecision: "ask" does natively.
Proposed change
In the hookify rule engine (core/rule_engine.py), when a matching rule has action: ask, return:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "ask"
},
"systemMessage": "<rule message>"
}
Rule file example
---
name: confirm-systemctl
enabled: true
event: bash
pattern: systemctl\s+(enable|disable|stop|start)\s+
action: ask
---
You are changing a systemd service state. Confirm this is approved.
Why this matters
The warn action relies on the model's self-discipline to follow the warning message. As documented in issue #46991, the model can reason past warnings by deciding conversation context implies approval. The ask action would put the decision in the user's hands via a native Claude Code permission prompt, which the model cannot bypass.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗