What are the Claude Code keyboard shortcuts?
Claude Code keyboard shortcuts are the keys the CLI responds to in a session: Esc to interrupt, Esc Esc to rewind, Shift+Tab to cycle permission modes, Ctrl+O for the transcript, Ctrl+R for history search, Ctrl+J for a new line, plus readline-style editing keys. Type ? on an empty prompt to see them in the app, and run /keybindings to change them.
This page collects the full list from the official interactive mode reference and the keybindings docs, grouped by what you are trying to do. For commands, flags and settings on one page, see the Claude Code cheat sheet.
Shortcuts can vary by platform and terminal. On macOS, the Alt shortcuts below need Option set up as Meta in your terminal, covered further down.
Which shortcuts control a session?
These are the general controls you will use most.
| Shortcut | What it does |
|---|---|
Esc |
Interrupt Claude mid-turn and keep the work so far, or close a dialog |
Esc Esc |
Clear the input draft, or open the rewind menu when the input is empty |
Ctrl+C |
Interrupt; with nothing running, first press clears input, second exits |
Ctrl+D |
Exit (press twice within 800ms); deletes the next character when the prompt has text |
Shift+Tab |
Cycle permission modes (Alt+M on Windows without VT input mode) |
Ctrl+O |
Toggle the transcript viewer with full tool output |
Ctrl+R |
Reverse search through prompt history |
Ctrl+G or Ctrl+X Ctrl+E |
Open the prompt in your default text editor |
Ctrl+L |
Redraw the screen, keeping input and history |
Ctrl+V |
Paste an image from the clipboard (Cmd+V in iTerm2, Alt+V on Windows and WSL) |
Ctrl+B |
Move a running Bash command or agent to the background (press twice in tmux) |
Ctrl+T |
Show or hide Claude's to-do checklist |
Ctrl+S |
Stash the current prompt, press again on an empty prompt to restore it |
Ctrl+Z |
Suspend Claude Code (Unix only); run fg to resume |
Ctrl+X Ctrl+K |
Stop all background subagents (press twice within 3 seconds) |
Ctrl+Enter or Ctrl+X Ctrl+S |
Send queued messages now |
Option+P / Alt+P |
Switch model without clearing your prompt |
Option+T / Alt+T |
Toggle extended thinking |
Option+O / Alt+O |
Toggle fast mode |
Up / Down or Ctrl+P / Ctrl+N |
Move the cursor in multiline input, then step through history |
Tab |
Accept an autocomplete suggestion |
Three of these are worth learning first. Esc stops Claude without losing what it has done, so you can redirect it. Esc Esc on an empty prompt opens the rewind menu, explained in our Claude Code checkpoints guide. Ctrl+B keeps a long test run or dev server going while you keep talking to Claude.
Per the docs, the thinking toggle has no effect on models that always use extended thinking, and it works on macOS without the Option as Meta change.
Which shortcuts edit text in the prompt?
The prompt uses readline conventions, so shell users will feel at home.
| Shortcut | What it does |
|---|---|
Ctrl+A / Ctrl+E |
Start or end of the current line |
Ctrl+K |
Delete to end of line |
Ctrl+U |
Delete from cursor to line start (repeat to clear across lines) |
Ctrl+W |
Delete back to the previous whitespace |
Ctrl+Y |
Paste the text you last deleted |
Alt+Y after Ctrl+Y |
Cycle through earlier deleted text |
Alt+B / Alt+F |
Move back or forward one word |
Alt+D |
Delete to end of word |
Ctrl+_ or Ctrl+Shift+- |
Undo the last input edit |
Word shortcuts treat punctuation such as _, . and / as separators, so Alt+B steps through src/utils/foo.ts one segment at a time. Ctrl+W ignores punctuation and deletes back to the last space, so one press removes the whole path. On macOS, Option+Delete deletes just the previous word; on Windows, use Ctrl+Backspace. These word-editing keys cannot be remapped in the keybindings file.
How do you enter multiline prompts?
Enter sends. To add a line break instead:
| Method | Keys | Where it works |
|---|---|---|
| Quick escape | \ then Enter |
All terminals |
| Control sequence | Ctrl+J |
All terminals, no setup |
| Shift+Enter | Shift+Enter |
Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal |
| Option key | Option+Enter |
macOS, after enabling Option as Meta |
| Paste | Paste directly | Code blocks and logs |
In VS Code, Cursor, Alacritty before 0.16 and Zed, run /terminal-setup once to install a Shift+Enter binding. Inside tmux, Shift+Enter also needs the tmux settings described in our Claude Code terminal setup guide.
What do the prefix keys do?
A few characters change what the prompt does when you type them.
| Key | Effect |
|---|---|
/ at start |
Open the command and skill menu |
! at start |
Shell mode: run a command directly and add its output to the session |
@ |
File path autocomplete |
? on empty input |
Toggle the shortcut help panel |
Shell mode is handy for ! git status or ! npm test. Claude sees the output and responds to it, so you can ask about failures without a second prompt. For the full command list, see our slash commands guide.
Which shortcuts work in the transcript viewer and fullscreen?
Ctrl+O opens the transcript viewer. Inside it:
| Key | What it does |
|---|---|
q, Ctrl+C, Esc |
Exit the transcript view |
Ctrl+E |
Toggle show all content (classic renderer only) |
? |
Shortcut help panel (fullscreen rendering) |
{ / } |
Jump to the previous or next prompt (fullscreen rendering) |
[ |
Write the conversation to native scrollback for Cmd+F or tmux search (fullscreen rendering) |
v |
Open the conversation in $VISUAL or $EDITOR (fullscreen rendering) |
In fullscreen rendering, the conversation scrolls inside the app: PgUp and PgDn move half a screen, Ctrl+Home jumps to the start, and Ctrl+End jumps to the latest message and turns auto-follow back on.
How does vim mode work?
Turn on vim-style editing with /config then Editor mode, or set "editorMode": "vim" in ~/.claude/settings.json. It supports a solid subset of vim: hjkl, w/e/b, 0/$/^, gg/G, f/t motions, d/c/y with text objects like iw and i", visual mode with v and V, u to undo and . to repeat. Block-wise visual mode with Ctrl+V is not supported.
Unlike real vim, Enter still submits in INSERT mode. Use o, O or Ctrl+J for a new line. To map a two-key sequence such as jj to Escape, use the vimInsertModeRemaps setting in your user settings:
{
"editorMode": "vim",
"vimInsertModeRemaps": { "jj": "<Esc>" }
}
How do you make Option shortcuts work on macOS?
Most macOS terminals do not send Option as a modifier by default, so Alt+B, Alt+F, Option+P and Option+Enter do nothing until you change one setting. The terminal configuration docs give the setting for each terminal:
- Apple Terminal: Settings, Profiles, Keyboard, check "Use Option as Meta Key". Running
/terminal-setupdoes this for you. - iTerm2: Settings, Profiles, Keys, General, set Left and Right Option key to "Esc+".
- VS Code: add
"terminal.integrated.macOptionIsMeta": trueto your settings. - Ghostty, Kitty and others: look for an Option-as-Alt or Option-as-Meta setting in the config file.
How do you customize Claude Code keybindings?
Run /keybindings to create or open ~/.claude/keybindings.json. The file holds a bindings array. Each block names a context and maps keystrokes to actions, or to null to unbind a default. Changes are picked up without restarting.
{
"$schema": "https://www.schemastore.org/claude-code-keybindings.json",
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+e": "chat:externalEditor",
"meta+g": "command:compact",
"ctrl+s": null
}
}
]
}
Useful facts from the keybindings reference:
- Contexts include
Global,Chat,Autocomplete,Confirmation,Transcript,HistorySearch,Selectand more. - Actions use a
namespace:actionformat, such aschat:submit,chat:newline,app:toggleTranscriptorhistory:search.command:<name>runs a slash command. - Swap Enter and Shift+Enter by mapping
chat:newlineandchat:submit. - Chords are space-separated, like
ctrl+k ctrl+s, with 3 seconds between keystrokes. - Modifiers:
meta,altandoptionall mean Option on macOS and Alt elsewhere.cmdonly works in terminals that report the Super key, so preferctrlormeta. - Reserved keys that cannot be rebound:
Ctrl+C,Ctrl+D,Ctrl+M,Ctrl+[,Ctrl+IandCtrl+H. - Conflicts:
Ctrl+Bclashes with the tmux prefix,Ctrl+Awith GNU screen, andCtrl+Zis the Unix suspend signal.
Claude Code validates the file and logs problems such as typos in modifiers or action names. Start it with --debug to see the warnings.
Keep your shortcuts and prompts close
Shortcuts save seconds; good prompts save whole sessions. Kipt keeps the prompts you reuse as Markdown in a private GitHub repo you own, with Cmd+K search to pull one up while Claude Code runs in the next window.