2.1.141: Notification:permission_prompt hook event stops firing during active thinking (regression from 2.1.139)
Summary
In 2.1.141, the Notification hook event with notification_type: permission_prompt does not fire when a permission prompt appears while the assistant is in an active thinking phase. The prompt renders correctly in the TUI; downstream hooks subscribed to Notification never run.
Confirmed working in 2.1.139 with the same project, settings, and hook scripts. 2.1.140 not tested.
Repro
- Configure a
Notificationhook with matcherpermission_prompt:
``jsonc`
"Notification": [{
"matcher": "permission_prompt",
"hooks": [{"type": "command", "command": "/tmp/log-prompt.sh"}]
}]
log-prompt.sh
where is echo "$(date '+%H:%M:%S') fired" >> /tmp/prompts.log`.
- Run any task in extended-thinking mode that triggers a permission prompt mid-reasoning. The unsandboxed-Bash override prompt is reliable because it always appears mid-thinking.
- Observe: prompt renders, user sees it.
/tmp/prompts.loggets no new line. - Downgrade to 2.1.139, repeat.
/tmp/prompts.loggets a new line for every prompt.
PreToolUse and AskUserQuestion hooks fire correctly on 2.1.141 — only Notification:permission_prompt is affected.
Suspected mechanism (from the 2.1.141 binary)
The permission_prompt Notification trigger is gated by a 6-second user-idle check:
const NIK = 6000;
function AR() { return m_.lastInteractionTime; }
function hF3() { return Date.now() - AR(); }
function EF3(H){ return hF3() < H; }
function SF3(H){ return !EF3(H); } // idle ≥ H ms
function KG_(message, notificationType) { // permission_prompt path
...
P1(() => {
if (SF3(NIK)) {
setFired(true);
MHH({ message, notificationType }, q); // ← actual hook fire
}
}, fired ? null : NIK);
}
m_.lastInteractionTime is reset by bt8() (called via u6H(true) → Ci8()). Ci8() is invoked from the SDK control-request handlers:
if (plK(K.request)) Ci8(...) // adjacent to can_use_tool / pendingRequests
if (mlK(_)) Ci8(...) // adjacent to onControlRequestResolved
The release note for 2.1.141 mentions the spinner now warms to amber after 10 seconds during long thinking periods. That feature appears to emit periodic progress/heartbeat control messages on the same channel — each tick matches plK/mlK, calls Ci8 → bt8 → lastInteractionTime = Date.now(). The 6-second idle window never accumulates during thinking, so SF3(6000) stays false and MHH(...) is never reached.
Symbol names may roll in subsequent versions; the structural pattern is KG_(..., "permission_prompt"), gated by SF3(NIK) with NIK = 6000, with lastInteractionTime reset via Ci8() from control-request predicates.
Impact
Any hook subscribed to Notification:permission_prompt silently misses prompts that arrive mid-thinking. The terminalSequence hook output field added in this same release is also effectively unreachable for permission_prompt, since it depends on the parent event firing.
Suggested fix
Exclude progress/spinner heartbeats from the user-interaction reset. Options:
- Narrow
plK/mlKpredicates so spinner heartbeats don't match. - Tag heartbeat control messages and skip
Ci8()for them. - Decouple the
permission_promptNotification gate fromlastInteractionTime— user-input idle is the wrong proxy when the assistant is what's keeping the system "active".
Environment
- claude-code 2.1.141 (Mach-O arm64, macOS 25.5.0)
- Verified working: 2.1.139
- Not tested: 2.1.140
- Terminal: VS Code Insiders integrated terminal + tmux; also reproduces in Ghostty
6 Comments
Same v2.1.142 extension bug not fire for LLM tool calls
Tested 2.1.140 and the Notification:permission_prompt hook fires correctly with the same setup as the original post, so the regression appears to have been introduced in 2.1.141.
v2.1.143 also broken — and the scope has expanded beyond
permission_prompt.Repro confirmed on Claude Code 2.1.143 (CLI, WSL Ubuntu, terminal — not VS Code extension):
notification_type=permission_prompt→ no hook firenotification_type=idle_prompt(per CLI behavior we observed) → no hook fireCross-check on the same workstation:
idle_prompthook fired 4 times in real interactive sessions (timestamps 22:33, 22:55, 22:58, 01:47 — confirmed in/tmp/claude-hooks.logentries withhook_event_name:"Notification",notification_type:"idle_prompt")The original report describes
permission_prompt-only breakage during active thinking on 2.1.141. On 2.1.143 the breakage extends toidle_promptand AskUserQuestion-driven notifications, even when the assistant is not actively thinking (e.g., right after a tool result returns and the prompt appears synchronously).PreToolUse/PostToolUse/Stop/SubagentStop/TaskCompletedall fire normally on 2.1.143 — the Notification family alone is silent.Hook registration is unchanged across versions (matcher=
*, single command pointed at a bash script). Mock JSON injection into the hook script works, so the issue is upstream from the hook entry point.Suggest the suspected mechanism (
lastInteractionTimereset via control-request heartbeats) be re-examined for the broadernotification_typeset, not justpermission_promptmid-thinking. Possible that v2.1.143 widened the gating predicate or applied the same reset path toidle_prompt/elicitation_dialogemission.Environment: WSL Ubuntu, bash hooks at
~/.claude/hooks/notify-hook.sh,settings.jsonregisters Notification with matcher=*. Same binary checksum on two workstations (one home, one office) — same 0-event behavior on both after upgrading to 2.1.143.Same problem here. I am on
v2.1.143I came here just hoping to find a fix.
Confirming the 2.1.143 regression on macOS (Sequoia 25.3, arm64). Tmux-tab-colouring chain that touches
/tmp/claude-attention-<pane>-<pid>onNotification:permission_promptandNotification:elicitation_dialog, cleared byUserPromptSubmit/PostToolUse/SessionEnd. Worked reliably until the auto-update to 2.1.143 this morning.Repro on 2.1.143 with a debug logging hook on Notification (matchers
permission_prompt,elicitation_dialog,idle_prompt, and empty wildcard) showed zeroNotificationentries across twoAskUserQuestioncalls and a/usr/bin/sayinvocation, whilePostToolUsefired six times in the same window. Downgrading the symlink to 2.1.140 immediately restored the integration — including theAskUserQuestionpath, which is currently spun out as #59908 but is part of the same regression at our end.This matches @vimholic's report that the Notification family is silent across the board on 2.1.143, not just
permission_promptmid-thinking. Could this be reopened given the regression has widened beyond the originally-reported scope?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.