Notify only when Claude is waiting on you (drop per-turn Stop flood) - #12
Merged
Conversation
The hook fired on Stop (once per turn), so an autonomous multi-step task produced 5-10 pushes when only the final 'over to you' matters. Stop has no field distinguishing done-waiting from stopped-mid-workflow (per hooks docs), so it's unfilterable — dropped it. Notification's idle_prompt is the real 'handed control back' signal and self-filters intermediate stops; the script now reads notification_type and denylists pure-noise sub-types (auth_success, elicitation_*). Denylist, not allowlist, so a missing field fails loud not silent. StopFailure kept. Event matrix + one real push verified on the box. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The hook pushed on the Stop event, which fires once per turn — so a single autonomous multi-step task (implement → PR → CI → merge) produced 5-10 pushes, when the user only needs the one "over to you" moment. Per the current hooks docs, Stop has no field distinguishing "done, waiting for you" from "stopped mid-workflow, resuming," so it can't be filtered — the only fix is to stop using it.
What
Notify only when Claude is genuinely waiting on you or a turn errored:
Stophook — the source of the per-turn flood.Notification, which carriesidle_prompt(Claude handed control back and is idle waiting for your next prompt — the real "your turn" signal; it self-filters intermediate autonomous stops) andpermission_prompt. The script now readsnotification_typeand denylists the pure-noise sub-types (auth_success,elicitation_complete,elicitation_response). Denylist (not allowlist) so a missing/renamed field fails loud (still pushes) rather than silently swallowing every alert.StopFailure(API errors).Verified
Event-matrix tested on the box with a stubbed curl (no phone spam):
idle_prompt/permission_prompt/missing-type/StopFailure→ push;auth_success/elicitation_response/Stop→ silent. Then one realidle_promptpush confirmed end-to-end delivery.make checkgreen; box script == rendered repo template (parity verified). README daily-use corrected (it claimed a ping "when it finishes").🤖 Generated with Claude Code