PermissionRequest hook decision rendered 20+ times in UI for a single tool invocation

Status Fixed / completed
Reported on v2.1.123
Maintainer reply None cached
Activity 3 comments · opened Apr 30, 2026 · closed May 12, 2026

Summary

When a PermissionRequest hook approves a tool call, the UI prints the
Allowed by PermissionRequest hook line 20+ times under the same tool block,
even though the hook script executes only once.

Environment

  • Claude Code: 2.1.123
  • OS: Linux 6.18 (Manjaro)
  • Settings: defaultMode: "auto", skipAutoPermissionPrompt: true (but not auto in this session)

Symptom

For a single Read (or other) tool call, the UI shows:

● Read(.../some/file.js · lines 285-364)
  ⎿  Read 80 lines
  ⎿  Allowed by PermissionRequest hook
  ⎿  Allowed by PermissionRequest hook
  ⎿  Allowed by PermissionRequest hook
  ... (×20+)

Diagnosis

Added per-invocation logging at the top of the hook script:

echo "$(date +%s.%N) pid=$$ ppid=$PPID tool=$(jq -r '.tool_name' <<<\"\$input\")" \
    >> /tmp/read_allow_invocations.log

Result: every tool invocation produces exactly one entry in the log, with
spacing matching the actual tool-call cadence (seconds apart). No bursts of 20+
entries within milliseconds. So the hook script runs once; the UI duplicates the
"Allowed by ..." line many times. This is a UI rendering / event-emission
duplication bug, not a hook execution bug.

Hook config

Standard modern format in ~/.claude/settings.json:

"hooks": {
  "PermissionRequest": [
    { "hooks": [ { "type": "command", "command": "bash ~/.claude/hooks/read_allow.sh" } ] }
  ]
}

Hook returns:

{"hookSpecificOutput": {"hookEventName": "PermissionRequest", "decision": {"behavior": "allow"}}}

Possibly related issues

  • #29212 (closed, not planned) — about hook firing on every permission check.

This report is specifically about the UI duplication on the approve path,
with the underlying hook execution confirmed to be single-shot.

View original on GitHub ↗

3 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/10777
  2. https://github.com/anthropics/claude-code/issues/9942
  3. https://github.com/anthropics/claude-code/issues/11763

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

Suor · 5 months ago

Why close as duplicate? None of those three are open and the issue is fresh, happening for recent Claude version. Also the symptomps are not really the same.

github-actions[bot] · 3 months ago

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.