Skip to content

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

Description

@kalmanl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions