Skip to content

Keyboard shortcuts ​

Claude Code's interactive REPL is driven by keyboard shortcuts. This page groups the most useful ones and covers how to enter multiline input.

Control ​

ShortcutAction
Ctrl+CInterrupt the current action / clear the input line
Ctrl+DExit Claude Code
EscInterrupt the current turn
Esc EscOpen the rewind menu (when the input is empty)
Ctrl+OOpen the transcript viewer
Ctrl+RReverse-search command history
Ctrl+BBackground the running task
Ctrl+TShow the task list
Shift+TabCycle permission mode (see permission modes)

TIP

Queued messages: if you type and press Enter while Claude is already working, your message queues instead of interrupting — Claude runs it after the current turn finishes. To run a queued message now, press Esc to stop the current turn; Claude picks up the queued one immediately. (Ctrl+C clears the input/queue instead of running it.)

Editing ​

Move and delete fast — no arrow-keying character by character:

ShortcutAction
Ctrl+A / Ctrl+EJump to the start / end of the line
Option/Alt+← / →Jump backward / forward one word
Ctrl+WDelete the previous word
Ctrl+UDelete from the cursor to the start of the line
Ctrl+KDelete from the cursor to the end of the line
Ctrl+GEdit the current prompt or plan in $EDITOR

Vim-style editing is available via /config → Editor mode.

TIP

Changed your mind about a long prompt? Press Ctrl+C once to wipe the whole input instantly — no backspacing letter by letter (a second press exits Claude Code). A terminal's Cmd+A selects the scrollback for copying, not the prompt text, so use these kill-line shortcuts to clear it.

macOS Option keys ​

ShortcutAction
Option/Alt+PSwitch model
Option/Alt+TToggle extended thinking
Option/Alt+OToggle fast mode

Multiline input ​

To submit a message that spans multiple lines, use one of:

MethodNotes
\ then EnterBackslash-continuation; works in any terminal
Ctrl+JInsert a newline without submitting
Shift+EnterNative in Ghostty and iTerm2
/terminal-setupRun once to enable Shift+Enter in VS Code

TIP

Run /terminal-setup after installing to configure your terminal for the best key handling, including Shift+Enter for newlines.

NOTE

Esc Esc only opens the rewind menu when the input line is empty; otherwise Esc interrupts the current turn.

Source: Interactive mode

Released under the MIT License.