Add setting to require confirmation before exiting on multiple Ctrl-C presses
Problem
When pressing Ctrl-C multiple times in quick succession (muscle memory from killing processes like yarn dev or Python servers), Claude Code exits immediately without confirmation. This causes loss of the current chat session, which can be very disruptive mid-conversation.
Many CLI users are trained to press Ctrl-C, sometimes repeatedly to force-kill stubborn processes. In Claude Code, the intent is usually just to cancel the current operation and return to the prompt - not to exit entirely.
Proposed Solution
Add a toggleable configuration option (e.g., requireExitConfirmation) that would allow the user to:
- Show a confirmation prompt like "Press Ctrl-C again to quit" with a longer timeout window, OR
- Disable the double-Ctrl-C exit behavior entirely, requiring Ctrl-D to exit
Use Case
Users who frequently work with dev servers and other CLI tools have muscle memory for rapid Ctrl-C. Accidentally exiting Claude Code mid-session loses valuable context.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗