Confirm-exit or Ctrl+C debounce to prevent accidental session loss

Open 💬 1 comment Opened Jun 3, 2026 by christianbrobeck-blip

Problem

A second Ctrl+C exits Claude Code immediately, with no confirmation. After
a long interactive session (hours of context, plans, file edits in flight)
a misfired double-tap loses everything that wasn't already committed.

The current behavior:

  • 1st Ctrl+C → interrupts the running operation (or clears the prompt)
  • 2nd Ctrl+C → exits immediately

Ctrl+C is documented as a reserved shortcut that cannot be rebound,
so there's no user-side workaround.

Ask

Either of the following would solve it:

  1. confirm_exit setting in ~/.claude/settings.json (default false) —

when true, after the 2nd Ctrl+C Claude Code prompts "type 'exit' to
confirm" or similar, instead of dropping immediately.

  1. Ctrl+C debounce threshold — require the two presses to land within

e.g. 500 ms to count as "exit"; if the second press is later, treat it
as another interrupt instead. Either fixed or settable as
interrupt_double_press_ms in settings.json.

Either way, the safety side is "user has to take a deliberate second
action to actually exit," which matches the muscle memory most other
TTY tools have (e.g. nano, vim).

Impact

Low effort to add (small UX behavior change, no architectural shift).
High value — losing a session to a one-character misfire is bad damage
for an LLM tool where the session state is the product.

View original on GitHub ↗

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