claude-code - 💡(How to fix) Fix Distinguish an explicit user interrupt (Esc) from a message that merely arrived mid-turn

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When a user presses Esc to interrupt the agent mid-work, the agent should receive an explicit, unambiguous signal that the user actively interrupted — a deliberate "stop, I need you now" action. Today, from the agent's side, an Esc-interrupt is hard to distinguish from a message that merely arrived while the agent was executing tools. The agent can mostly only infer an interruption from the fact that its tool execution got cut off, which is a weak and ambiguous signal.

Root Cause

When a user presses Esc to interrupt the agent mid-work, the agent should receive an explicit, unambiguous signal that the user actively interrupted — a deliberate "stop, I need you now" action. Today, from the agent's side, an Esc-interrupt is hard to distinguish from a message that merely arrived while the agent was executing tools. The agent can mostly only infer an interruption from the fact that its tool execution got cut off, which is a weak and ambiguous signal.

RAW_BUFFERClick to expand / collapse

Summary

When a user presses Esc to interrupt the agent mid-work, the agent should receive an explicit, unambiguous signal that the user actively interrupted — a deliberate "stop, I need you now" action. Today, from the agent's side, an Esc-interrupt is hard to distinguish from a message that merely arrived while the agent was executing tools. The agent can mostly only infer an interruption from the fact that its tool execution got cut off, which is a weak and ambiguous signal.

Why it matters

During long, multi-step, or autonomous work, the agent constantly has to judge how urgently to react to user input:

  • A message that arrives while the agent is working often means "when you get to it" — the agent should usually finish its current unit of work (and e.g. sweep its task queue) before switching.
  • An explicit Esc-interrupt almost always means "stop, attend to me now" — the user took a deliberate physical action to break in.

Conflating these causes the agent to either over-react (dropping important in-progress work for a non-urgent note) or under-react (treating a genuine interrupt as low-priority). An explicit interrupt signal lets the agent prioritize correctly and predictably, which matters a lot for trust during autonomous runs.

Request

Surface a clear, machine-readable signal to the agent when the user actively interrupts (presses Esc), distinct from "a new message was queued during tool execution." Even a simple marker — e.g. user_interrupted: true vs. the current "the user sent a new message while you were working" framing — would resolve the ambiguity. The interrupt is a strong, deliberate intent signal and it would be valuable to expose it as one.

Note on the obvious edge case

Accidental Esc (a cat on the keyboard, a stray keypress) is easy to handle — the user can just tell the agent it was accidental and to resume. The sensible default is still "Esc = deliberate and important."


Filed at my request and drafted/relayed by my Claude Code agent during a long autonomous session — which felt like a fitting way to surface a piece of agent-UX feedback.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING