← Blog

Claude Code Keyboard Shortcuts: Complete Reference

October 27, 2026

AI Coding

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+J always 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, but Ctrl+C and Ctrl+D are 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.

ShortcutWhat it does
EnterSend your message (or queue it while Claude is working)
Ctrl+J, or \ then EnterNew line without sending
EscStop Claude's current response or tool call; close a dialog
Esc EscClear a draft, or open the rewind menu when the prompt is empty
Shift+TabCycle permission modes
Ctrl+CInterrupt; if nothing is running, clear the prompt, then press again to exit
Ctrl+DExit (press twice to confirm)
Up / DownMove through prompt history
Ctrl+RReverse-search prompt history
Ctrl+OToggle the detailed transcript viewer
Ctrl+BSend a running command or agent to the background
Ctrl+TShow or hide Claude's to-do checklist
Ctrl+VPaste an image from the clipboard
Ctrl+GOpen your prompt in your default text editor
Ctrl+SStash the current prompt; press again on an empty prompt to restore it
Ctrl+LRedraw 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:

MethodKeysWhere it works
Control sequenceCtrl+JEvery terminal, no setup
Quick escape\ then EnterEvery terminal, no setup
Shift+EnterShift+EnteriTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal out of the box
Option keyOption+EntermacOS, after enabling Option as Meta
PastePaste multi-line textAnywhere; 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-setup once. 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+J or \ then Enter.
  • tmux: add set -s extended-keys on and set -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 Up brings 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

ShortcutBehaviour
Ctrl+CInterrupts a running operation. With nothing running, the first press clears your prompt and the second exits
Ctrl+DFirst press shows a hint, a second press within 800ms exits. If the prompt has text, it deletes the character after the cursor instead
Ctrl+ZSuspends 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.

ShortcutAction
Ctrl+A / Ctrl+EStart / end of the current line
Ctrl+KDelete to end of line
Ctrl+UDelete to start of line (Cmd+Backspace maps here in iTerm2 and Terminal.app)
Ctrl+WDelete back to the previous space, so a whole file path goes in one press
Ctrl+YPaste back what you just deleted
Alt+B / Alt+FBack / forward one word
Alt+DDelete 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:

  1. Press Ctrl+R and type part of an old prompt.
  2. Press Ctrl+R again to step to older matches.
  3. Press Tab or Esc to drop the match into the prompt and keep editing, or Enter to send it straight away.
  4. Press Ctrl+C to 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:

  • Esc switches INSERT to NORMAL. It doesn't cancel your input the way it does in standard mode.
  • In NORMAL mode, / opens history search, the same as Ctrl+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:

ActionmacOSWindows / Linux
Switch modelOption+PAlt+P
Toggle extended thinkingOption+TAlt+T
Toggle fast modeOption+OAlt+O
Paste imageCtrl+V (Cmd+V in iTerm2)Ctrl+V on Linux; Alt+V on Windows and WSL
Delete previous wordOption+DeleteCtrl+Backspace on Windows
Suspend to shellCtrl+ZCtrl+Z on Linux; not on Windows
Cycle permission modesShift+TabShift+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": true to 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:

  • meta means Option on a Mac and Alt elsewhere. cmd only works in terminals that report the Super key, so prefer ctrl or meta.
  • Chords are keys separated by a space, such as ctrl+k ctrl+s. Press each within 3 seconds.
  • null unbinds a default.
  • You can bind slash commands. "meta+g": "command:compact" in a Chat block runs /compact.
  • Some keys are reserved: Ctrl+C, Ctrl+D, Ctrl+M, Ctrl+[, Ctrl+I and Ctrl+H can't be rebound.
  • Watch for multiplexers. Ctrl+B clashes with tmux and Ctrl+A with 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+R and Ctrl+O.
  • For new lines, Ctrl+J is the safe default. Shift+Enter depends on your terminal; /terminal-setup fixes 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.json via /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.