Stop hook: add field to distinguish 'turn finished' vs 'waiting for user input/approval'

Status Fixed / completed
Maintainer reply None cached
Activity 1 comment · opened Jul 29, 2026 · closed Jul 29, 2026

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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗