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 + Enternow inserts a newline natively in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal. For VS Code, Cursor, Alacritty, and Zed, run/terminal-setuponce to install the binding.- On macOS, the
Option + <letter>andAlt + <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
| Shortcut | What it does | When to use it |
|---|---|---|
Esc | Interrupts Claude’s current reply or tool call | Redirect mid-turn; the work done so far stays in context |
Esc Esc | Clears the input draft (saved to history), or opens the rewind menu when the box is empty | Wipe a half-typed prompt, or roll code and conversation back to an earlier checkpoint |
Ctrl + C | Interrupts a running op; if idle, first press clears input, second press exits | Stop a run, clear the box, or fully quit |
Ctrl + D | Exits the session (EOF) | One keystroke instead of Ctrl + C twice |
Ctrl + O | Toggles the transcript viewer | Inspect full tool usage; expands MCP calls that collapse to one line |
Ctrl + L | Redraws the terminal screen | When the display is garbled or partly blank; history is kept |
Ctrl + T | Shows / hides the task list | Track up to 5 pending / in-progress / done tasks on multi-step work |
Ctrl + B | Backgrounds the running task | Long agent or shell run shouldn’t block the UI (tmux: press twice) |
Ctrl + X Ctrl + K | Kills all background subagents in the session | Press twice within 3 seconds to confirm |
Ctrl + G or Ctrl + X Ctrl + E | Opens your prompt in $EDITOR | Edit a long prompt in real Vim / VS Code, then save to send |
Ctrl + Z | Suspends the whole process to the shell | Pop 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 cycles | What runs without asking | Best for |
|---|---|---|
| default | Reads only | Sensitive work; reviewing each action |
| acceptEdits | Reads, file edits, and common filesystem commands (mkdir, touch, rm, mv, cp, sed) inside your working dir | Iterating on code you’ll review by git diff after |
| plan | Reads only, then proposes a written plan | Exploring 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 tomain, 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
allowrules. Never in the cycle; set it withclaude --permission-mode dontAskfor locked-down CI. - bypassPermissions — skips all checks (the old “YOLO”). Only appears after you launch with
--dangerously-skip-permissionsor--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.
| Shortcut | What it does |
|---|---|
Ctrl + A | Jump to start of the current line |
Ctrl + E | Jump to end of the current line |
Alt + B / Option + ← | Jump one word left |
Alt + F / Option + → | Jump one word right |
Ctrl + K | Delete from cursor to end of line (stored for pasting) |
Ctrl + U | Delete from cursor to start of line (Cmd + Backspace maps here on macOS) |
Ctrl + W | Delete previous word (Ctrl + Backspace on Windows) |
Ctrl + Y | Paste 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
| Input | What it does | Compatibility |
|---|---|---|
\ then Enter | Newline | Every terminal; the reliable fallback |
Ctrl + J | Newline | Any terminal, no config |
Shift + Enter | Newline | Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal |
Option + Enter | Newline | macOS with Option as Meta |
| Paste a multiline block | Preserves newlines | Needs 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
| Shortcut | What it does |
|---|---|
↑ / ↓ | Navigate history; inside a multiline draft they first move the cursor, then step history at the top/bottom edge |
Ctrl + P / Ctrl + N | Same as ↑ / ↓ |
Ctrl + R | Reverse-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 |
/resume | Lists 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
| Input | What it does |
|---|---|
@ + path | References a file or directory; Tab autocompletes |
/ at the start | Opens the command / skill menu (built-ins, skills, plugins, MCP) |
! at the start | Enters shell mode; the command’s output flows back into context |
# at the start | Writes 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 terminal | Inserts 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”.
| Shortcut | What it does |
|---|---|
Option + P / Alt + P | Switch the model without clearing your prompt |
Option + T / Alt + T | Toggle extended thinking (works on macOS without Option-as-Meta since v2.1.132) |
Option + O / Alt + O | Toggle 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
| Shortcut | What it does | When to use it |
|---|---|---|
Cmd + C | Copy the selection | Grab Claude’s output, error messages, generated commands |
Cmd + V | Paste | Push logs, code, or links back into Claude |
Cmd + K | Clear screen and scrollback | Start with a clean buffer before reviewing a diff |
Cmd + T | New tab | Run a second claude session, or npm run dev next door |
Cmd + W | Close the current tab or window | Tear down a finished session |
Cmd + N | New terminal window | When you want a separate window, not a tab |
Cmd + 1…Cmd + 9 | Jump to tab N | Multi-session navigation |
Cmd + Shift + [ / ] | Previous / next tab | Walk through tabs in order |
Cmd + + / Cmd + - | Zoom font in / out | Long prompts you can’t read; presenting / sharing screen |
Cmd + 0 | Reset font size | Back to default afterwards |
Cmd + F | Search scrollback | Find earlier Claude output without Ctrl + R |
Cmd + Q | Quit the terminal app | Warning: kills every running claude session at once |
Cmd + H | Hide the terminal | Free the screen while an agent run continues |
Cmd + M | Minimize window | Same idea — clear the screen, keep the run |
Cmd + Tab | Switch apps | Step away while Claude works on a long task |
Cmd + ~ | Cycle through windows of the same app | Multiple terminal windows open |
Fn pressed twice | Start macOS dictation | Dictate 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
| Shortcut | What it does |
|---|---|
Cmd + D | Split pane vertically (left / right) |
Cmd + Shift + D | Split pane horizontally (top / bottom) |
Cmd + Option + ↑ / ↓ / ← / → | Move between split panes |
Cmd + Shift + Enter | Temporarily maximize the focused pane |
Cmd + ; | Autocomplete from command history |
Cmd + Shift + H | Paste history |
Cmd + Option + B | Instant Replay (rewind the terminal) |
Cmd + R | Clear screen (iTerm2 alias) |
Cmd + Shift + S | Save current session to a .txt |
iTerm2 splits are ideal for “Claude on the left, my logs / tests / prompt draft on the right.”
Warp only
| Shortcut | What it does |
|---|---|
Cmd + P | Command Palette |
Cmd + R | Workflow search |
Ctrl + R | Command history search |
Cmd + D / Cmd + Shift + D | Split pane |
Cmd + Enter | AI Command Suggest (when enabled) |
Cmd + Shift + B | Jump 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
| Shortcut | What it does |
|---|---|
Cmd + I | Session Inspector (change cursor color, window title, etc.) |
Cmd + S | Save scrollback to a file |
Cmd + Shift + N | New window from current profile |
Cmd + Option + Arrow | Jump 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.macOptionIsMetatotrue. - 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:
| Shortcut | What it does |
|---|---|
Cmd + Esc (mac) / Ctrl + Esc (Win/Linux) | Launches or focuses the Claude Code panel |
Cmd + Alt + K / Ctrl + Alt + K | Sends the current selection as a reference into Claude’s input |
Cmd + S in a diff view | Accepts Claude’s edit |
Cmd + Z in a diff view | Reverts 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/kfall through to history navigation. - Voice dictation. Enable it, then hold
Spaceto record a prompt instead of typing it, or run/voice tapfor tap-to-toggle. Useful for dumping a long verbal spec. /btwside 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. Presscto copy the answer orfto fork it into a real session with tools.
Terminal compatibility cheat sheet
Diagnose by symptom:
Shift + Enterdoesn’t insert a newline → run/terminal-setup; fall back to\+Enter.Option + <letter>does nothing → Option isn’t set as Meta in your terminal.- Pasting collapses every newline to a space → enable bracketed paste (iTerm2 on by default; Apple Terminal sometimes disables it).
- Garbled paste → your terminal isn’t using UTF-8.
Ctrl + <letter>swallowed by the system (e.g.Ctrl + Topens a new tab) → switch terminals or unbind the conflicting global shortcut.- IDE integration is dead in JetBrains → confirm the Claude Code plugin is enabled and
claudeis on your PATH.
Drill: build muscle memory
- Week one: force yourself to use just three —
Esc(interrupt),Shift + Tab(mode switch),Ctrl + R(history search). - Week two: add the editing trio —
Ctrl + A,Ctrl + E,Ctrl + W. - Week three: layer in
EscEsc(clear draft / rewind) andCtrl + O(transcript viewer). - 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 + Ehaven’t sunk in yet. - Are you still re-prompting a drifting agent instead of rewinding?
EscEscon an empty box (rewind) one step back usually beats arguing with it. - Is every write still asking for confirmation? Consider
Shift + Tabto auto-accept — but only inside an isolated worktree.
Common mistakes
- Pressing
Ctrl + Ctwice and exiting the session, losing just-generated work —Escis enough to interrupt the turn. - Telling Claude to “write code” in Plan mode, then getting confused when it refuses —
Shift + Tabback to a writeable mode. - Concluding Claude Code is broken when
Option + Pdoes 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
\+EnterorCtrl + Jfor 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.
Related
- Every Claude Code Slash Command, Explained
- Claude Code Introduction
- Claude Code Beginner Guide
- Claude Code Workflow
Tags: #Claude #Claude Code #Tutorial