[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.
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.
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/14620
- https://github.com/anthropics/claude-code/issues/11113
- https://github.com/anthropics/claude-code/issues/15897
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.