Keyboard Shortcut
Ctrl+D — exit on an empty line
Sends an end-of-file signal on an empty input line, exiting Claude Code — the same convention most shells use.
If you're used to closing a shell session with Ctrl+D, the same instinct works here: on an empty input line, it signals there's nothing more coming and exits.
It won't do anything useful with text still in the input box — clear the line first (or use Ctrl+C) if you want to exit rather than send a partial message.
Functionally this ends up equivalent to Ctrl+C on an empty line; which one you reach for is mostly muscle memory from whatever shell you already use.
Press Ctrl+D on an empty input line to exitFrequently asked questions
What does Ctrl+D — exit on an empty line do in Claude Code?
Sends an end-of-file signal on an empty input line, exiting Claude Code — the same convention most shells use.
How do I use it?
Try: Press Ctrl+D on an empty input line to exit
Any caveats to know about?
Functionally this ends up equivalent to Ctrl+C on an empty line; which one you reach for is mostly muscle memory from whatever shell you already use.
Is this covered in the Claude Code Toolkit?
Yes — Ctrl+D — exit on an empty line and patterns like it are part of the full command, hook, and template pack included with a Claude Code Toolkit subscription.
Want the full command, hook, and template pack?
This is one pattern out of the full Claude Code Toolkit — subscribe for the complete set, plus everything we add going forward.
Subscribe to the toolkit — $79/mo