PreToolUse hook permissionDecision no longer overrides ask rules; no deprecation warning
Summary
A PreToolUse hook returning permissionDecision: "allow" used to override ask rules in settings.json permissions. As of a recent version, this no longer works — the ask rule now takes precedence and the user is still prompted.
Confirmed by testing the same hook + settings on an older Claude Code session (still running, works) vs v2.1.79 (prompts despite hook returning allow). The regression likely happened in v2.1.78 or v2.1.79.
The workaround is to migrate to a PermissionRequest hook with a different output format (decision.behavior instead of permissionDecision). This works, but the old format silently stopped working with no deprecation warning or migration guidance.
Reproduction
Global settings.json:
{
"permissions": {
"ask": ["Bash(rm:*)"]
}
}
Project settings.local.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/allow-rm.sh"
}
]
}
]
}
}
Hook script (.claude/hooks/allow-rm.sh):
#!/bin/bash
python3 -c "
import sys, json
data = json.load(sys.stdin)
cmd = data.get('tool_input', {}).get('command', '')
if cmd.startswith('rm ') and 'SessionSummaries/' in cmd:
print(json.dumps({
'hookSpecificOutput': {
'hookEventName': 'PreToolUse',
'permissionDecision': 'allow',
'permissionDecisionReason': 'auto-approved'
}
}))
"
Run a matching rm command → user is prompted despite the hook returning allow. On an older version, the same setup auto-approves without prompting.
Expected behavior
Either:
- The old format should continue to work (backward compatibility), or
- A deprecation warning should be emitted when a
PreToolUsehook returnspermissionDecisionfields, pointing to the newPermissionRequesthook format
Workaround
Change hook type to PermissionRequest in settings and update the output format:
{
"hookSpecificOutput": {
"hookEventName": "PermissionRequest",
"decision": {
"behavior": "allow"
}
}
}This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗