> keyboard shortcuts

Claude Code's interactive prompt has a keyboard layer that makes long sessions fast: interrupt and redirect Claude, rewind to a checkpoint, cycle permission modes, search history, and inspect exactly what ran. A few single-character prefixes double as commands — ! runs a shell command inline, @ references a file, / opens the command menu. macOS users must configure Option as Meta in their terminal for the Alt-key shortcuts to work.

// keyboard shortcuts

8 commands

// faq

What does pressing Esc twice do?

It depends on the prompt. With text in the input, double Esc clears it and saves the draft so Up recalls it. With an empty input, double Esc opens the rewind menu to restore or summarize code and conversation from an earlier checkpoint — the keyboard shortcut for /rewind. A single Esc, by contrast, just interrupts Claude's current turn.

How do I stop Claude without losing my place?

Press Esc to interrupt the current response or tool call mid-turn; the work done so far is kept and you can redirect. Esc closes an open dialog instead of interrupting. Ctrl+C is the harder stop — it cancels the running operation, and a second press on an empty prompt exits Claude Code entirely.

How do I switch permission modes quickly?

Press Shift+Tab to cycle through default (shown as Manual), acceptEdits, plan, and any extra modes you've enabled like auto or bypassPermissions. The active mode shows in the indicator above the prompt. On some Windows runtimes the binding is Alt+M instead.

How do I run a terminal command without leaving Claude?

Start your input with ! to run it as a shell command directly. The command and its output are added to the conversation, and Claude now responds to that output automatically — so ! npm test both runs the tests and explains any failures. Exit shell mode with Esc, Backspace, or Ctrl+U on an empty prompt.

How do I turn on vim keybindings?

Enable vim mode via /config under Editor mode, or set "editorMode": "vim" in settings.json. Esc enters NORMAL mode and i/a/o return to INSERT; NORMAL supports motions (h j k l, w, b) and operators (dd, yy, cc, p, .). You can map a two-key INSERT sequence like jj to Escape with the vimInsertModeRemaps setting.