Claude Code Keyboard Shortcuts: Complete Reference
October 27, 2026

The Claude Code keyboard shortcuts you'll use most are Esc to stop Claude mid-turn, Esc twice to rewind, Shift+Tab to cycle permission modes, Ctrl+J or \ then Enter for a new line, Ctrl+R to search your prompt history, Ctrl+O for the full transcript, Ctrl+B to push a running command to the background, and Ctrl+C / Ctrl+D to clear or exit. Press ? on an empty prompt and Claude Code shows the shortcut help panel itself.
Everything below is checked against Anthropic's own interactive mode reference, keybindings docs and terminal setup guide as of October 2026. Three things trip people up more than anything else:
- Shift+Enter doesn't make a new line everywhere. It depends on your terminal.
Ctrl+Jalways works. - Option shortcuts do nothing on a fresh Mac terminal until you turn on "Option as Meta".
- Most shortcuts are remappable in
~/.claude/keybindings.json, butCtrl+CandCtrl+Dare not.
One note on scope: this page covers the Claude Code terminal app. If you searched "Claude shortcuts" and meant typed commands like /clear or /model, those are in our Claude Code slash commands guide.
Claude Code shortcuts at a glance
These are the defaults. Keys are written the way the docs write them; on a Mac, "Ctrl" means the Control key, not Command.
| Shortcut | What it does |
|---|---|
Enter | Send your message (or queue it while Claude is working) |
Ctrl+J, or \ then Enter | New line without sending |
Esc | Stop Claude's current response or tool call; close a dialog |
Esc Esc | Clear a draft, or open the rewind menu when the prompt is empty |
Shift+Tab | Cycle permission modes |
Ctrl+C | Interrupt; if nothing is running, clear the prompt, then press again to exit |
Ctrl+D | Exit (press twice to confirm) |
Up / Down | Move through prompt history |
Ctrl+R | Reverse-search prompt history |
Ctrl+O | Toggle the detailed transcript viewer |
Ctrl+B | Send a running command or agent to the background |
Ctrl+T | Show or hide Claude's to-do checklist |
Ctrl+V | Paste an image from the clipboard |
Ctrl+G | Open your prompt in your default text editor |
Ctrl+S | Stash the current prompt; press again on an empty prompt to restore it |
Ctrl+L | Redraw a garbled screen without losing anything |
? | Toggle the shortcut help panel (on an empty prompt) |
Three prefixes change what your message does when typed at the start: / opens commands and skills, ! runs a shell command directly, and @ autocompletes a file path.
How to add a new line in Claude Code
Enter sends. That's the single most common complaint from new users, because most chat apps use Shift+Enter for a line break and people expect the same here.
You have five options, per the docs:
| Method | Keys | Where it works |
|---|---|---|
| Control sequence | Ctrl+J | Every terminal, no setup |
| Quick escape | \ then Enter | Every terminal, no setup |
| Shift+Enter | Shift+Enter | iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal out of the box |
| Option key | Option+Enter | macOS, after enabling Option as Meta |
| Paste | Paste multi-line text | Anywhere; good for code and logs |
When Shift+Enter submits instead
Some terminals don't tell Claude Code that Shift was held. The fix depends on which one you're in:
- VS Code, Cursor, Devin Desktop, Zed and older Alacritty: run
/terminal-setuponce. It writes a Shift+Enter binding into that terminal's config. Run it in the host terminal, not inside tmux. - gnome-terminal and JetBrains IDE terminals (PyCharm, Android Studio): Shift+Enter isn't available. Use
Ctrl+Jor\thenEnter. - tmux: add
set -s extended-keys onandset -as terminal-features 'xterm*:extkeys'to~/.tmux.conf, even if the outer terminal supports Shift+Enter.
Prefer it the other way round, with Enter adding a line and Shift+Enter sending? Remap the chat:newline and chat:submit actions in your keybindings file (covered below).
Esc, Shift+Tab and the session-control shortcuts
These are the keys that change what Claude is doing, not what you're typing.
Esc vs Esc Esc
A single Esc stops Claude's current response or tool call so you can redirect it. Claude keeps the work it has done so far, and any messages you queued go out next. On a permission prompt, Esc declines the action.
Double Esc does two different things depending on the prompt:
- Prompt has text: it clears the draft and saves it to history, so
Upbrings it back. - Prompt is empty: it opens the rewind menu, where you can restore or summarize code and conversation from an earlier point.
That second one is the "undo" most people are looking for. Our guide to reverting changes in Claude Code covers what rewind can and can't roll back.
Shift+Tab cycles permission modes
Shift+Tab steps through default (shown as Manual), acceptEdits, plan, and then bypassPermissions and auto when those are available to you. From auto, the next press goes back to default.
The permission modes docs explain each one. The short version: Manual stops and asks before most file edits, shell commands and network access; acceptEdits also lets file edits and common filesystem commands through without a prompt; plan is for exploring a codebase before changing it. If you want the rules behind each mode, see Claude Code permissions.
On Windows, if your Node or Bun runtime doesn't enable VT input mode, the default switches to Alt+M.
Ctrl+C, Ctrl+D and Ctrl+Z
| Shortcut | Behaviour |
|---|---|
Ctrl+C | Interrupts a running operation. With nothing running, the first press clears your prompt and the second exits |
Ctrl+D | First press shows a hint, a second press within 800ms exits. If the prompt has text, it deletes the character after the cursor instead |
Ctrl+Z | Suspends Claude Code to your shell on macOS and Linux; type fg to resume |
Background tasks and the transcript
Ctrl+B moves a running Bash command or agent to the background, so Claude can keep answering while your test suite or dev server runs. Inside tmux, press it twice, because Ctrl+B is tmux's prefix key. /tasks lists what's running.
Ctrl+O opens the transcript viewer, which shows every tool call in detail, plus a timestamp and the model used on each reply. Press q, Esc or Ctrl+C to close it.
Editing, history search and vim mode
The prompt uses readline-style keys, so if you live in Bash or Zsh most of these will already be in your fingers.
| Shortcut | Action |
|---|---|
Ctrl+A / Ctrl+E | Start / end of the current line |
Ctrl+K | Delete to end of line |
Ctrl+U | Delete to start of line (Cmd+Backspace maps here in iTerm2 and Terminal.app) |
Ctrl+W | Delete back to the previous space, so a whole file path goes in one press |
Ctrl+Y | Paste back what you just deleted |
Alt+B / Alt+F | Back / forward one word |
Alt+D | Delete to end of word |
Ctrl+_ | Undo the last input edit |
Alt+B, Alt+F, Alt+D and Alt+Y need Option set as Meta on a Mac. To delete one word rather than a whole path, use Option+Delete on macOS or Ctrl+Backspace on Windows. These editing keys can't be remapped in the keybindings file.
Search your prompt history with Ctrl+R
History is stored per working directory, and Up reaches prompts from earlier sessions in the same project. Ctrl+R searches it:
- Press
Ctrl+Rand type part of an old prompt. - Press
Ctrl+Ragain to step to older matches. - Press
TaborEscto drop the match into the prompt and keep editing, orEnterto send it straight away. - Press
Ctrl+Cto cancel and get your original input back.
In fullscreen rendering, Ctrl+R opens a search dialog instead, and Ctrl+S there cycles the scope between this session, this project and all projects. If you want the whole earlier conversation rather than one prompt, see how to resume a conversation in Claude Code.
Turn on vim mode
Open /config and set Editor mode to vim, or put "editorMode": "vim" in ~/.claude/settings.json. You get NORMAL, INSERT and VISUAL modes with the usual motions (w, b, gg, f), operators (dd, cw, yy), text objects (ciw, di") and . to repeat.
Two vim-specific behaviours to know:
Escswitches INSERT to NORMAL. It doesn't cancel your input the way it does in standard mode.- In NORMAL mode,
/opens history search, the same asCtrl+R.
Want jj to escape? Add this to ~/.claude/settings.json:
{
"editorMode": "vim",
"vimInsertModeRemaps": { "jj": "<Esc>" }
}
Claude Code ignores this setting in a project's .claude/settings.json, so a repo you clone can't remap your keys.
Mac vs Windows and Linux shortcuts
Most Ctrl shortcuts are identical across platforms. The differences are in the Alt / Option row and a few OS-specific keys:
| Action | macOS | Windows / Linux |
|---|---|---|
| Switch model | Option+P | Alt+P |
| Toggle extended thinking | Option+T | Alt+T |
| Toggle fast mode | Option+O | Alt+O |
| Paste image | Ctrl+V (Cmd+V in iTerm2) | Ctrl+V on Linux; Alt+V on Windows and WSL |
| Delete previous word | Option+Delete | Ctrl+Backspace on Windows |
| Suspend to shell | Ctrl+Z | Ctrl+Z on Linux; not on Windows |
| Cycle permission modes | Shift+Tab | Shift+Tab, or Alt+M on Windows without VT mode |
Fix Option key shortcuts on macOS
If Option+P or Option+Enter does nothing, your terminal isn't sending Option as a modifier. Most macOS terminals don't by default. The fix, per Anthropic's terminal guide:
- Apple Terminal: Settings → Profiles → Keyboard → check "Use Option as Meta Key". If you accepted Claude Code's first-run terminal setup prompt, this is already on.
- iTerm2: Settings → Profiles → Keys → General, then set both Left and Right Option key to "Esc+".
- VS Code terminal: 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.
Option+T is the exception: it works without this setting.
Windows Backspace deletes whole words
If every Backspace on Windows wipes a word, your terminal sends ^H for Backspace and Claude Code reads it as Ctrl+Backspace. Set the environment variable CLAUDE_CODE_BS_AS_CTRL_BACKSPACE=0 and Backspace goes back to one character.
Customize Claude Code keybindings
Run /keybindings to create or open ~/.claude/keybindings.json. Changes apply as soon as you save; no restart.
The file holds a bindings array. Each block names a context (where the binding applies, such as Chat, Global or Transcript) and maps keystrokes to actions like chat:submit or app:toggleTranscript. This example, from the docs, moves the external editor to Ctrl+E and unbinds Ctrl+S:
{
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+e": "chat:externalEditor",
"ctrl+s": null
}
}
]
}
A few rules that save debugging time:
metameans Option on a Mac and Alt elsewhere.cmdonly works in terminals that report the Super key, so preferctrlormeta.- Chords are keys separated by a space, such as
ctrl+k ctrl+s. Press each within 3 seconds. nullunbinds a default.- You can bind slash commands.
"meta+g": "command:compact"in aChatblock runs/compact. - Some keys are reserved:
Ctrl+C,Ctrl+D,Ctrl+M,Ctrl+[,Ctrl+IandCtrl+Hcan't be rebound. - Watch for multiplexers.
Ctrl+Bclashes with tmux andCtrl+Awith GNU screen.
If a binding silently does nothing, start Claude Code with --debug. It logs warnings for typos like ctl+k, unknown action names and duplicate bindings.
FAQ
How do I see all Claude Code shortcuts inside the app?
Press ? on an empty prompt to toggle the help panel. In fullscreen rendering, ? inside the transcript viewer lists the shortcuts available there.
How do I make a new line in Claude Code without sending?
Press Ctrl+J, or type \ and press Enter. Both work in every terminal. Shift+Enter works in iTerm2, Ghostty, Kitty, WezTerm, Warp, Apple Terminal and Windows Terminal, and in VS Code or Cursor after you run /terminal-setup.
What's the shortcut to stop Claude Code?
Esc stops the current response and keeps the work done so far. Ctrl+C also interrupts, and on an idle prompt it clears the input, then exits on a second press.
How do I undo in Claude Code?
Esc twice on an empty prompt opens the rewind menu. For typing mistakes, Ctrl+_ undoes the last input edit.
Can I change Enter to add a new line instead of sending?
Yes. In ~/.claude/keybindings.json, bind enter to chat:newline and another key, such as shift+enter, to chat:submit in the Chat context.
Key takeaways
- Five keys cover most sessions:
Esc,Esc Esc,Shift+Tab,Ctrl+RandCtrl+O. - For new lines,
Ctrl+Jis the safe default.Shift+Enterdepends on your terminal;/terminal-setupfixes VS Code, Cursor and Zed. - On a Mac, enable Option as Meta or half the Alt shortcuts stay dead.
- Remap almost anything in
~/.claude/keybindings.jsonvia/keybindings, except the reserved keys.
Shortcuts make Claude Code faster once it's running. Getting someone else's whole setup running is the harder part, and that's where Taku fits: it mirrors an AI app or workflow someone already got working into a desktop workspace where you can run it, edit it and keep it as your own. Taku is in Beta, and the Mac app is available now.