Skip to content

Keyboard Shortcuts ​

Verified on 2026-10-04 with Claude Code 2.1.289.

Every shortcut below was checked against Anthropic's documentation. Shortcuts can vary by platform and terminal. Press ? on an empty prompt to see the list for your own setup.

Mac note. Shortcuts that use Alt (Alt+B, Alt+F, Alt+D, Alt+Y, Alt+P) need your terminal set to treat Option as Meta. The setting is under your terminal's keyboard preferences; Anthropic's page "Terminal configuration" lists it for each terminal.

Everyday controls ​

ShortcutWhat it does
Ctrl+CInterrupts a running operation. With nothing running, the first press clears the prompt and a second press exits
EscStops Claude mid-response so you can redirect; Claude keeps the work done so far. Also closes a dialog
Esc EscWith text in the prompt: clears it (and saves the draft so Up brings it back). With an empty prompt: opens the rewind menu to restore code and conversation to an earlier point
Ctrl+DExits Claude Code (press twice). If the prompt has text, deletes the character after the cursor
Shift+TabCycles permission modes
Option+P (Mac) / Alt+PSwitches model without clearing your prompt
Option+T (Mac) / Alt+TTurns extended thinking on or off. No effect on models that always think
Option+O (Mac) / Alt+OTurns fast mode on or off
Ctrl+OOpens or closes the transcript viewer: detailed tool use, and lines that are collapsed by default
Ctrl+TShows or hides Claude's task checklist
Ctrl+BMoves running Bash commands and agents to the background (tmux users press it twice)
Ctrl+X Ctrl+KStops all background subagents in this session. Press twice within 3 seconds to confirm
Ctrl+G or Ctrl+X Ctrl+EOpens your prompt in your default text editor
Ctrl+LRedraws the screen if it looks garbled. Conversation is kept
Ctrl+RSearches previous commands
Ctrl+SStashes the prompt text; press again on an empty prompt to restore it
Ctrl+ZSuspends Claude Code (Unix only); type fg to resume
Ctrl+V (Cmd+V in iTerm2, Alt+V on Windows and WSL)Pastes an image from the clipboard
Up / DownMove the cursor in a multi-line prompt, then step through history
TabAccepts an autocomplete suggestion

Changes from earlier guidance: the model and thinking toggles use Option on Mac, not Cmd. Ctrl+O now opens the transcript viewer rather than a "verbose" switch.

Permission modes ​

Shift+Tab cycles through default (shown as Manual), acceptEdits, plan, and, when available, bypassPermissions and then auto. From auto, the first press goes back to default. See Auto Mode and Permissions. On Windows when VT input mode is not enabled, Alt+M does the same.

Editing text in the prompt ​

ShortcutWhat it does
Ctrl+A / Ctrl+EStart / end of the current line
Alt+B / Alt+FBack / forward one word
Ctrl+KDelete to the end of the line (saved for pasting)
Ctrl+UDelete to the start of the line (saved for pasting)
Ctrl+WDelete back to the previous whitespace, so one press removes a whole file path
Alt+DDelete to the end of the word
Ctrl+YPaste the text you last deleted; Alt+Y afterward cycles through earlier deletions
Ctrl+_ or Ctrl+Shift+-Undo the last edit to the prompt

New lines in a prompt ​

MethodWorks in
\ then EnterAll terminals
Ctrl+JAny terminal, no setup
Shift+EnteriTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal. Other terminals: see Anthropic's "Terminal configuration" page
Option+EntermacOS, after setting Option as Meta
PastePasting multi-line text works directly

Prefixes: the first character of a prompt ​

TypeResult
/Commands and skills. Filter by typing letters
!Shell mode: runs a command directly, adds the output to the session, and Claude responds to it
@File path autocomplete
:Emoji shortcodes such as :tada:
? on an empty promptShows the shortcut help panel

Transcript viewer (Ctrl+O) ​

KeyWhat it does
q, Ctrl+C or EscLeave the viewer
{ / }Jump to the previous or next prompt (fullscreen rendering)
[Write the full conversation to terminal scrollback so your terminal's search works (fullscreen rendering)
vOpen the conversation in your $VISUAL or $EDITOR (fullscreen rendering)

Picking up an earlier session ​

Open the session picker with claude --resume, or /resume inside a session.

KeyWhat it does
Up / DownMove between sessions
Left / RightCollapse or expand grouped sessions
EnterResume the highlighted session
SpacePreview the session
Ctrl+RRename the highlighted session
/ or any letterSearch (you can also paste a pull request URL)
Ctrl+AShow sessions from all projects; press again to go back
Ctrl+BShow only sessions from the current git branch
EscClose the picker

(The first edition listed single-letter keys P, R, A and B for these; the current picker uses the keys above.)

Vim mode ​

Turn it on in /config under Editor mode. The old /vim command was removed in Claude Code 2.1.92. In NORMAL mode, the common keys are:

KeysWhat they do
EscEnter NORMAL mode
i I a A o OInsert before cursor / at line start / after cursor / at line end / new line below / new line above
h j k lLeft, down, up, right
w e bNext word, end of word, previous word
0 $ ^Line start, line end, first non-blank character
gg GStart, end of input
x dd DDelete character, line, to end of line
cc C cwChange line, to end of line, word
yy p PCopy line, paste after, paste before
u .Undo, repeat last change
>> <<Indent, dedent line
v VStart character-wise or line-wise selection

The documentation lists more motions, text objects and visual-mode commands; this table is the common core. You can map jj (or another two-key sequence) to Escape with the vimInsertModeRemaps setting in your user settings.

VS Code extension ​

ShortcutWhat it does
Cmd+Esc / Ctrl+EscToggle focus between editor and Claude
Cmd+Shift+Esc / Ctrl+Shift+EscOpen a new conversation in an editor tab
Cmd+N / Ctrl+NNew conversation. Works only when Claude is focused and the enableNewConversationShortcut setting is on
Cmd+Shift+T / Ctrl+Shift+TReopen the most recently closed Claude tab
Option+K / Alt+KInsert an @-mention of the current file and selection (editor must be focused)
Ctrl+Option+F / Ctrl+Alt+FToggle Focus view, which hides tool calls and thinking
EnterSends the prompt. Turn on the useCtrlEnterToSend setting to require Ctrl/Cmd+Enter

On macOS Tahoe and later, Cmd+Esc may be taken by the system; see Troubleshooting.

JetBrains ​

Cmd+Esc / Ctrl+Esc opens Claude Code from the editor. Cmd+Option+K (Mac) or Alt+Ctrl+K (Linux/Windows) inserts a file reference such as @src/auth.ts#L1-99.

Handy command-line flags ​

CommandEffect
claude -cContinue the most recent conversation
claude -rOpen the session picker; claude --resume <name> resumes a named session
claude -n <name>Start a session with a display name
claude --permission-mode planStart in plan mode (other choices include acceptEdits, auto, manual)
claude updateUpdate Claude Code
claude -vPrint the version

Check that it worked ​

Start claude, type ? on the empty prompt: the help panel opens with the shortcuts for your terminal. Then type a few words and press Ctrl+U: the line clears, and Ctrl+Y brings it back.

Sources ​

Released under CC BY-SA 4.0.