Keyboard shortcuts

General controls

ShortcutDescriptionContext
Ctrl+CCancel current input or generationStandard interrupt
Ctrl+DExit Claude Code sessionEOF signal
Ctrl+LClear terminal screenKeeps conversation history
Up/Down arrowsNavigate command historyRecall previous inputs
Esc + EscEdit previous messageDouble-escape to modify

Multiline input

MethodShortcutContext
Quick escape\ + EnterWorks in all terminals
macOS defaultOption+EnterDefault on macOS
Terminal setupShift+EnterAfter /terminal-setup
Paste modePaste directlyFor code blocks, logs

Quick commands

ShortcutDescriptionNotes
# at startMemory shortcut - add to CLAUDE.mdPrompts for file selection
/ at startSlash commandSee slash commands

Vim mode

Enable vim-style editing with /vim command or configure permanently via /config.

Mode switching

CommandActionFrom mode
EscEnter NORMAL modeINSERT
iInsert before cursorNORMAL
IInsert at beginning of lineNORMAL
aInsert after cursorNORMAL
AInsert at end of lineNORMAL
oOpen line belowNORMAL
OOpen line aboveNORMAL
CommandAction
h/j/k/lMove left/down/up/right
wNext word
eEnd of word
bPrevious word
0Beginning of line
$End of line
^First non-blank character
ggBeginning of input
GEnd of input

Editing (NORMAL mode)

CommandAction
xDelete character
ddDelete line
DDelete to end of line
dw/de/dbDelete word/to end/back
ccChange line
CChange to end of line
cw/ce/cbChange word/to end/back
.Repeat last change

Configure your preferred line break behavior in terminal settings. Run /terminal-setup to install Shift+Enter binding for iTerm2 and VSCode terminals.

Command history

Claude Code maintains command history for the current session:

  • History is stored per working directory
  • Cleared with /clear command
  • Use Up/Down arrows to navigate (see keyboard shortcuts above)
  • Ctrl+R: Reverse search through history (if supported by terminal)
  • Note: History expansion (!) is disabled by default

See also