Problem
The Stop hook fires both when Claude finishes a turn naturally AND when it pauses waiting for user input or a permission approval. There is no field in the hook's stdin JSON to distinguish between these two cases.
The Notification hook fires for permission prompts, but using both Stop + Notification results in double notifications at the end of a turn (one from each hook).
Use case
I want a single OS notification that says "Claude finished" when done, and a separate one saying "Claude needs approval" only for permission prompts — without duplicates.
Proposed solution
Add a field to the Stop hook stdin payload indicating the reason, for example:
{
"session_id": "abc123",
"stop_reason": "turn_complete" | "awaiting_input" | "awaiting_permission"
}
This would allow hook scripts to conditionally notify based on the stop reason, eliminating the need to combine Stop + Notification hooks with duplicate firing.
Problem
The
Stophook fires both when Claude finishes a turn naturally AND when it pauses waiting for user input or a permission approval. There is no field in the hook's stdin JSON to distinguish between these two cases.The
Notificationhook fires for permission prompts, but using bothStop+Notificationresults in double notifications at the end of a turn (one from each hook).Use case
I want a single OS notification that says "Claude finished" when done, and a separate one saying "Claude needs approval" only for permission prompts — without duplicates.
Proposed solution
Add a field to the
Stophook stdin payload indicating the reason, for example:{ "session_id": "abc123", "stop_reason": "turn_complete" | "awaiting_input" | "awaiting_permission" }This would allow hook scripts to conditionally notify based on the stop reason, eliminating the need to combine
Stop+Notificationhooks with duplicate firing.