Feature request: hook event on user interrupt (Esc)

Resolved 💬 2 comments Opened Jun 26, 2026 by shaunak Closed Jun 30, 2026

Problem

Pressing Esc to interrupt/cancel a running turn fires no hook event at all. This makes it impossible for statusLine / hook-based integrations to reflect that the agent stopped — they stay frozen on whatever the last state was (e.g. "thinking") until something else happens.

The closest existing signals don't cover it:

  • Stop / StopFailure do not fire on a user interrupt.
  • The idle_prompt Notification only fires after ~60s of genuine inactivity — so if you interrupt and immediately start typing, it never fires.

Evidence

I instrumented a logger on all 29 non-streaming hook events and did a controlled interrupt. After UserPromptSubmit (which set my "thinking" state), I pressed Esc — and not a single hook event fired for 37+ seconds:

SessionStart
InstructionsLoaded
UserPromptSubmit     <- prompt sent (state -> thinking)
   …Esc interrupt here…
   (no events at all)

Every other state transition my integration relies on rides on an event that does fire (UserPromptSubmit, PreToolUse, Stop, StopFailure, Notification). Interrupt is the one action that emits nothing.

Proposal

Emit a hook event when the user interrupts a turn. Any of:

  • a dedicated TurnInterrupted / TurnCancelled event, or
  • have Stop fire on interrupt with a reason field (e.g. reason: "interrupted"), or
  • have StopFailure fire with reason: "interrupted".

Use case

Building an expressive status-line that shows the agent's state (thinking / reading / running / done / waiting). Everything works except interrupts, which can't be reflected without resorting to a timed staleness heuristic that false-fires on long-but-live turns (big builds, long replies, extended thinking).

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗