[BUG] PreToolUse hook with permissionDecision: "allow" causes intermittent "undefined is not an object (evaluating 'H.includes')" error
Description
When a PreToolUse hook returns permissionDecision: "allow", Claude Code intermittently crashes with:
Error: undefined is not an object (evaluating 'H.includes')
The permissionDecision: "deny" path works correctly every time. The error appears to be in the client-side rendering code, not in the hook execution itself.
Environment
- Platform: Linux (Ubuntu)
- Claude Code version: 2.0.76
- Node.js version: v22.x
Steps to Reproduce
- Create a PreToolUse hook that returns:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"permissionDecisionReason": ""
}
}
Or install this: https://github.com/fprochazka/claude-code-plugins/tree/3b81c70464f0fcffc89ccef7b457e363b66657e1/plugins/no-background-tasks
- Trigger multiple parallel Bash tool calls
- The first tool that gets "allow" intermittently fails with the error
Hook Script (minimal reproduction)
#!/usr/bin/env python3
import json
import sys
hook_input = json.load(sys.stdin)
# Always allow
output = {
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"permissionDecisionReason": ""
}
}
print(json.dumps(output))
sys.exit(0)
Expected Behavior
The tool should execute normally when the hook returns permissionDecision: "allow".
Actual Behavior
Claude Code throws undefined is not an object (evaluating 'H.includes') intermittently.
<img width="1559" height="404" alt="Image" src="https://github.com/user-attachments/assets/d1ddc009-ba2a-4ec0-b43c-c9135444abec" />
Debug Logs
When the hook works correctly, debug logs show:
Hook result has permissionBehavior=allow
Hook approved tool use for Bash, bypassing permission check
When it fails, the error is not logged in ~/.claude/debug/ - suggesting it's a client-side rendering error.
Notes
- The error is intermittent - sometimes it works, sometimes it fails
permissionDecision: "deny"always works correctly- Adding
permissionDecisionReason: ""(empty string) seems to reduce but not eliminate the error - The minified variable
Hsuggests this is in bundled/minified Claude Code JavaScript
Workaround
None found. The error prevents reliable use of PreToolUse hooks that need to allow tool execution.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗