Claude Code Keyboard Shortcuts: The Complete 2026 Reference

Every Claude Code keyboard shortcut verified against the official docs (June 2026): the 6 permission modes, the Esc/Esc rewind, readline editing, custom keybindings, vim mode, and terminal fixes.

TL;DR. The five shortcuts that pay for themselves on day one: Esc interrupts Claude without losing context, Esc Esc clears a draft (or opens the rewind menu when the box is empty), Shift + Tab cycles permission modes, Ctrl + R reverse-searches your prompt history, and Ctrl + O toggles the transcript viewer. Everything else below is the long tail, verified against the official Claude Code interactive-mode and permission-mode docs as of June 2026. Inside any session, press ? (in fullscreen rendering) for the exact bindings your build ships, and run /keybindings to rebind them.

Claude Code is Anthropic’s command-line coding agent. It reads, edits, and runs code in your terminal, and it runs Anthropic models only (Opus 4.7 and Sonnet 4.6 as of June 2026). Because it lives in a terminal, almost everything is a keystroke away once you stop reaching for the mouse. This reference is for developers who already run claude and want both hands on the keyboard. If you haven’t installed it yet, start with the Claude Code Beginner Guide, then come back.

Three setup notes that prevent 90% of “this shortcut is broken” reports:

  • Shift + Enter now inserts a newline natively in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal. For VS Code, Cursor, Alacritty, and Zed, run /terminal-setup once to install the binding.
  • On macOS, the Option + <letter> and Alt + <letter> combos need Option configured as Meta (or “Esc+”). One exception: as of Claude Code v2.1.132, Option + T (toggle extended thinking) works on macOS without it.
  • Press ? in the transcript viewer (fullscreen rendering) to confirm the exact set your version ships. Versions and terminals genuinely vary, so treat the official ? panel and the Claude Code interactive-mode docs as ground truth, and this page as the annotated map.

Session-level control

ShortcutWhat it doesWhen to use it
EscInterrupts Claude’s current reply or tool callRedirect mid-turn; the work done so far stays in context
Esc EscClears the input draft (saved to history), or opens the rewind menu when the box is emptyWipe a half-typed prompt, or roll code and conversation back to an earlier checkpoint
Ctrl + CInterrupts a running op; if idle, first press clears input, second press exitsStop a run, clear the box, or fully quit
Ctrl + DExits the session (EOF)One keystroke instead of Ctrl + C twice
Ctrl + OToggles the transcript viewerInspect full tool usage; expands MCP calls that collapse to one line
Ctrl + LRedraws the terminal screenWhen the display is garbled or partly blank; history is kept
Ctrl + TShows / hides the task listTrack up to 5 pending / in-progress / done tasks on multi-step work
Ctrl + BBackgrounds the running taskLong agent or shell run shouldn’t block the UI (tmux: press twice)
Ctrl + X Ctrl + KKills all background subagents in the sessionPress twice within 3 seconds to confirm
Ctrl + G or Ctrl + X Ctrl + EOpens your prompt in $EDITOREdit a long prompt in real Vim / VS Code, then save to send
Ctrl + ZSuspends the whole process to the shellPop back to bash briefly; return with fg

Memorize the difference between Esc and Ctrl + C. Esc interrupts only the current turn — generated code and files Claude has already read stay in context. The double Esc is now context-aware: if you have text in the box it clears that draft (recall it with Up); if the box is empty it opens the rewind / checkpoint menu so you can restore code and conversation from an earlier point.

Permission mode switching

Shift + Tab is the single most useful key in Claude Code. One press advances one mode; the active mode shows in the status bar. As of June 2026 the docs define six permission modes, but only three are in the default cycle:

Shift + Tab cyclesWhat runs without askingBest for
defaultReads onlySensitive work; reviewing each action
acceptEditsReads, file edits, and common filesystem commands (mkdir, touch, rm, mv, cp, sed) inside your working dirIterating on code you’ll review by git diff after
planReads only, then proposes a written planExploring a codebase before letting Claude change it

Three more modes exist but slot into the cycle only when you enable them at startup, or never appear at all:

  • auto — the headline 2026 addition. Claude runs without prompts, but a separate classifier model checks every action first and blocks anything dangerous: curl | bash, force-pushing to main, mass cloud deletes, sending secrets to unknown endpoints. It appears in the cycle once your account meets the requirements (Claude Code v2.1.83+, Sonnet 4.6 / Opus 4.6+; on Team and Enterprise an admin must enable it). It is a research preview, not a safety guarantee.
  • dontAsk — auto-denies anything not in your allow rules. Never in the cycle; set it with claude --permission-mode dontAsk for locked-down CI.
  • bypassPermissions — skips all checks (the old “YOLO”). Only appears after you launch with --dangerously-skip-permissions or --permission-mode bypassPermissions. Use it only inside an isolated container or VM; it offers no protection against prompt injection. For prompt-free work with a safety net, reach for auto instead.

A practical habit: stay in default for unfamiliar repos, flip to acceptEdits for a refactor you’ll review wholesale, and use plan to force Claude to think before it writes. Note that even acceptEdits will not auto-write to protected paths like .git, .zshrc, or .claude in any mode except bypassPermissions.

Input editing (readline-style)

Claude Code’s input box follows readline / Emacs conventions, so most shortcuts that work in bash or zsh work here too.

ShortcutWhat it does
Ctrl + AJump to start of the current line
Ctrl + EJump to end of the current line
Alt + B / Option + ←Jump one word left
Alt + F / Option + →Jump one word right
Ctrl + KDelete from cursor to end of line (stored for pasting)
Ctrl + UDelete from cursor to start of line (Cmd + Backspace maps here on macOS)
Ctrl + WDelete previous word (Ctrl + Backspace on Windows)
Ctrl + YPaste back text deleted by Ctrl + K / Ctrl + U / Ctrl + W
Alt + Y (after Ctrl + Y)Cycle through paste history (needs Option-as-Meta on macOS)

The kill-and-yank trio (Ctrl + W, Ctrl + U, Ctrl + Y) is the real workflow: chop a wrong clause out of a long prompt, then paste it somewhere else, instead of arrow-keying character by character. Multiline-aware versions of Ctrl + A / Ctrl + E move within the current logical line, not the whole draft.

Multiline input

InputWhat it doesCompatibility
\ then EnterNewlineEvery terminal; the reliable fallback
Ctrl + JNewlineAny terminal, no config
Shift + EnterNewlineNative in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal
Option + EnterNewlinemacOS with Option as Meta
Paste a multiline blockPreserves newlinesNeeds bracketed paste enabled

If Shift + Enter does nothing, you are likely in VS Code, Cursor, Alacritty, or Zed — run /terminal-setup once to install the binding. If that still fails, fall back to \ + Enter and move on.

Prefer multiline input for staged requirements, log dumps, or checklists. Cramming everything into one line makes it harder for Claude to extract structure.

History and reuse

ShortcutWhat it does
/ Navigate history; inside a multiline draft they first move the cursor, then step history at the top/bottom edge
Ctrl + P / Ctrl + NSame as /
Ctrl + RReverse-search prompt history (interactive)
Ctrl + S (inside Ctrl + R)Cycle search scope: this session → this project → all projects
Tab (on a grayed suggestion)Accept the prompt suggestion Claude proposes from your git history
/resumeLists resumable sessions to pick from

Ctrl + R with a keyword is the killer feature. Wrote a 200-line migration prompt earlier? Ctrl + R, type migration, then Ctrl + R again to step through older matches, Enter to run. Press Ctrl + S mid-search to widen from the current session out to every project. Faster than digging through notes.

Files, commands, and shell

InputWhat it does
@ + pathReferences a file or directory; Tab autocompletes
/ at the startOpens the command / skill menu (built-ins, skills, plugins, MCP)
! at the startEnters shell mode; the command’s output flows back into context
# at the startWrites a memory line (appends to CLAUDE.md or user-level memory)
Ctrl + V / Cmd + V (iTerm2) / Alt + V (WSL)Pastes a clipboard image; inserts an [Image #N] chip you can reference inline
Drag a file onto the terminalInserts the file path into the input

@ and Tab are a pair: type @, then a few letters, then Tab — completion walks the directory tree. Much faster than memorizing paths.

! is not just “run a command for me.” It’s “let Claude see the output of this command.” !git status, !npm test, !ls -la dist are the common patterns; in shell mode, Tab even autocompletes from your previous ! commands in this project. Exit shell mode with Esc, Backspace, or Ctrl + U on an empty prompt.

Model and mode toggles

On Windows and Linux these are Alt + <letter>. On macOS they are Option + <letter> and (except where noted) need Option configured as Meta: iTerm2 → Profiles → Keys → “Esc+”, or Apple Terminal → Settings → Profiles → Keyboard → “Use Option as Meta key”.

ShortcutWhat it does
Option + P / Alt + PSwitch the model without clearing your prompt
Option + T / Alt + TToggle extended thinking (works on macOS without Option-as-Meta since v2.1.132)
Option + O / Alt + OToggle fast mode
Alt + M (some configs)Alternate binding for the Shift + Tab permission-mode cycle

If a key does nothing, the cause is almost always one of two: Option isn’t set as Meta, or your version doesn’t ship that shortcut. Press ? in the transcript viewer to confirm what your build actually exposes.

macOS terminal-level shortcuts

These belong to your terminal app, not Claude Code — but you’ll use them every day while Claude is running. Keep this section close; it removes half the mouse trips.

Universal macOS terminal

ShortcutWhat it doesWhen to use it
Cmd + CCopy the selectionGrab Claude’s output, error messages, generated commands
Cmd + VPastePush logs, code, or links back into Claude
Cmd + KClear screen and scrollbackStart with a clean buffer before reviewing a diff
Cmd + TNew tabRun a second claude session, or npm run dev next door
Cmd + WClose the current tab or windowTear down a finished session
Cmd + NNew terminal windowWhen you want a separate window, not a tab
Cmd + 1Cmd + 9Jump to tab NMulti-session navigation
Cmd + Shift + [ / ]Previous / next tabWalk through tabs in order
Cmd + + / Cmd + -Zoom font in / outLong prompts you can’t read; presenting / sharing screen
Cmd + 0Reset font sizeBack to default afterwards
Cmd + FSearch scrollbackFind earlier Claude output without Ctrl + R
Cmd + QQuit the terminal appWarning: kills every running claude session at once
Cmd + HHide the terminalFree the screen while an agent run continues
Cmd + MMinimize windowSame idea — clear the screen, keep the run
Cmd + TabSwitch appsStep away while Claude works on a long task
Cmd + ~Cycle through windows of the same appMultiple terminal windows open
Fn pressed twiceStart macOS dictationDictate a prompt instead of typing it
Cmd + .Cancel (some terminals alias this to Ctrl + C)Occasionally handy in GUI-leaning terminals

Cmd + K and Ctrl + L both “clear the screen,” but they mean different things: Cmd + K wipes the scrollback (no scrolling back to recover), while Ctrl + L redraws the current frame (history is still there). Use Cmd + K before a diff review, Ctrl + L mid-agent run.

iTerm2 only

ShortcutWhat it does
Cmd + DSplit pane vertically (left / right)
Cmd + Shift + DSplit pane horizontally (top / bottom)
Cmd + Option + ↑ / ↓ / ← / →Move between split panes
Cmd + Shift + EnterTemporarily maximize the focused pane
Cmd + ;Autocomplete from command history
Cmd + Shift + HPaste history
Cmd + Option + BInstant Replay (rewind the terminal)
Cmd + RClear screen (iTerm2 alias)
Cmd + Shift + SSave current session to a .txt

iTerm2 splits are ideal for “Claude on the left, my logs / tests / prompt draft on the right.”

Warp only

ShortcutWhat it does
Cmd + PCommand Palette
Cmd + RWorkflow search
Ctrl + RCommand history search
Cmd + D / Cmd + Shift + DSplit pane
Cmd + EnterAI Command Suggest (when enabled)
Cmd + Shift + BJump to previous block

Warp’s block mode steps aside for fullscreen interactive UIs like claude. If rendering breaks, run /terminal-setup first; if that doesn’t fix it, disable Warp’s AI input prompt while running Claude Code, or switch to iTerm2.

Apple Terminal only

ShortcutWhat it does
Cmd + ISession Inspector (change cursor color, window title, etc.)
Cmd + SSave scrollback to a file
Cmd + Shift + NNew window from current profile
Cmd + Option + ArrowJump between tabs

Ghostty / Alacritty / Kitty users

These terminals use the same Cmd + <letter> conventions as iTerm2 but with their own defaults. They handle ANSI / true color / Unicode more cleanly, which often means you can skip /terminal-setup entirely. Press Cmd + , to open preferences and check the exact bindings.

Make macOS modifier keys cooperate with Claude Code

If Option + <letter> stops working after switching terminals, 95% of the time the fix is here:

  • iTerm2: Settings → Profiles → Keys → “Left/Right Option key” → Esc+.
  • Apple Terminal: Settings → Profiles → Keyboard → check Use Option as Meta key.
  • VS Code integrated terminal: set terminal.integrated.macOptionIsMeta to true.
  • JetBrains integrated terminal: Settings → Tools → Terminal → check Option as meta key.
  • Warp / Ghostty / Kitty: default to treating Option as Meta — usually no change needed.

You don’t have to restart Claude Code after changing this, but you do need a fresh terminal session for the setting to take effect.

VS Code / JetBrains integration

With the Claude Code IDE extension installed:

ShortcutWhat it does
Cmd + Esc (mac) / Ctrl + Esc (Win/Linux)Launches or focuses the Claude Code panel
Cmd + Alt + K / Ctrl + Alt + KSends the current selection as a reference into Claude’s input
Cmd + S in a diff viewAccepts Claude’s edit
Cmd + Z in a diff viewReverts the last step

The real value of the IDE integration is the diff experience and “select code + ask in one sentence” — faster than copy-pasting code into a bare terminal.

Rebind the keys: /keybindings

If a default fights your muscle memory, you no longer have to live with it. Run /keybindings inside a session to open (or create) ~/.claude/keybindings.json, then remap actions like transcript:toggleShowAll or transcript:exit. This is the clean way to resolve conflicts — for example, if your terminal already claims a Ctrl + <letter> combo for itself.

Power-user input modes

Three modes most people never discover, each worth a try:

  • Vim editing. Turn it on in /config → Editor mode. You get NORMAL/INSERT/VISUAL with the full motion set (w, b, dd, ciw, yy, . to repeat) right inside the prompt box. At the top or bottom edge, j / k fall through to history navigation.
  • Voice dictation. Enable it, then hold Space to record a prompt instead of typing it, or run /voice tap for tap-to-toggle. Useful for dumping a long verbal spec.
  • /btw side questions. Ask a quick question mid-task without polluting the conversation: /btw what was that config file called?. It sees the full session but has no tools, answers in a dismissible overlay, and never enters history. Press c to copy the answer or f to fork it into a real session with tools.

Terminal compatibility cheat sheet

Diagnose by symptom:

  1. Shift + Enter doesn’t insert a newline → run /terminal-setup; fall back to \ + Enter.
  2. Option + <letter> does nothing → Option isn’t set as Meta in your terminal.
  3. Pasting collapses every newline to a space → enable bracketed paste (iTerm2 on by default; Apple Terminal sometimes disables it).
  4. Garbled paste → your terminal isn’t using UTF-8.
  5. Ctrl + <letter> swallowed by the system (e.g. Ctrl + T opens a new tab) → switch terminals or unbind the conflicting global shortcut.
  6. IDE integration is dead in JetBrains → confirm the Claude Code plugin is enabled and claude is on your PATH.

Drill: build muscle memory

  1. Week one: force yourself to use just three — Esc (interrupt), Shift + Tab (mode switch), Ctrl + R (history search).
  2. Week two: add the editing trio — Ctrl + A, Ctrl + E, Ctrl + W.
  3. Week three: layer in Esc Esc (clear draft / rewind) and Ctrl + O (transcript viewer).
  4. Then practice @ references, ! shell mode, and # memory until “type a long prompt” turns into “pull context inline.”

Don’t try to memorize the whole table day one. Three shortcuts a week, applied to real work, beats ten readings of the cheat sheet.

Quality check

  • Are you still clicking the middle of the input box? If yes, Ctrl + A / Ctrl + E haven’t sunk in yet.
  • Are you still re-prompting a drifting agent instead of rewinding? Esc Esc on an empty box (rewind) one step back usually beats arguing with it.
  • Is every write still asking for confirmation? Consider Shift + Tab to auto-accept — but only inside an isolated worktree.

Common mistakes

  • Pressing Ctrl + C twice and exiting the session, losing just-generated work — Esc is enough to interrupt the turn.
  • Telling Claude to “write code” in Plan mode, then getting confused when it refuses — Shift + Tab back to a writeable mode.
  • Concluding Claude Code is broken when Option + P does nothing on macOS — 99% of the time it’s Option not being Meta.
  • Guessing slash commands from memory and getting them wrong — open the / menu and press ? for shortcuts.
  • Cramming a multi-step request into one line — use \ + Enter or Ctrl + J for structure.

FAQ

Q: What is the difference between Esc, Esc Esc, and Ctrl + C? A: Esc interrupts only the current turn; finished code and read files stay in context. Esc Esc is context-aware: with text in the box it clears the draft (recall it with Up); with an empty box it opens the rewind menu to roll back to an earlier checkpoint. Ctrl + C clears the input on the first press and exits on the second.

Q: How do I get the “auto” permission mode in the Shift + Tab cycle? A: Auto mode (the 2026 addition that runs without prompts but classifier-checks each action) appears once your account meets the requirements: Claude Code v2.1.83 or later, a supported model (Sonnet 4.6 or Opus 4.6+), and — on Team or Enterprise — an admin enabling it in Claude Code admin settings. The first time you cycle to it, Claude asks you to opt in. It is a research preview, so keep reviewing sensitive operations.

Q: Why does Option + P do nothing in Claude Code on macOS? A: macOS treats Option as a special key by default, not as Meta. Enable “Use Option as Meta key” in Apple Terminal profiles or set the Option key to “Esc+” in iTerm2 — then Option + P, Option + O, and the Alt + <letter> editing combos work. (Option + T is the one exception that works without this since v2.1.132.)

Q: How do I insert a newline without sending the message? A: \ then Enter, or Ctrl + J — both work in every terminal. Shift + Enter works natively in iTerm2, Ghostty, Kitty, Warp, WezTerm, Apple Terminal, and Windows Terminal; in VS Code, Cursor, Alacritty, or Zed, run /terminal-setup once to install it.

Q: Can I change a shortcut I don’t like? A: Yes. Run /keybindings to open ~/.claude/keybindings.json and remap actions such as transcript:toggleShowAll or transcript:exit. This is the right fix when a terminal-level binding collides with one of Claude Code’s.

Q: How do I recall a previous prompt without retyping? A: Up walks history one entry at a time; Ctrl + R does reverse-incremental search. Inside that search, Ctrl + R again steps to older matches and Ctrl + S widens the scope from this session to this project to all projects.

Tags: #Claude #Claude Code #Tutorial