Most people drive Claude Code like it’s a chat box.
Ask a Claude Code user what happens when you press Esc twice on an empty prompt, and most of them shrug.
Claude Code isn’t failing.
Out of the box, macOS terminals don’t send the signal Claude Code is listening for, which is why these appear broken on a fresh Mac install.
This requires Claude Code v2.1.18 or later.
Most people drive Claude Code like it’s a chat box. Type a prompt, hit Enter, wait, repeat. It works, but you’re using a terminal application the way you’d use a web page.
Ask a Claude Code user what happens when you press Esc twice on an empty prompt, and most of them shrug. It opens a rewind menu that rolls your code and your conversation back to an earlier point in the session. I found it by accident, about three weeks in, after Claude had spent twenty minutes confidently refactoring a file in a direction I didn’t want. I was about to git checkout the whole thing. Two keystrokes would have done it cleanly, and they’d been sitting there the entire time.
That’s the pattern with this tool. The features exist, they’re documented, and nobody mentions them.
Everything below comes from Anthropic’s official interactive mode documentation, grouped by when you’d actually reach for it rather than dumped alphabetically. One thing to know up front: shortcuts vary by platform and terminal, and a few of them behave differently depending on where you’re running Claude. Learn – How to Install AI Apps with Winget on Windows 11
The Five That Change How You Work
Shift+Tab — cycle permission modes. The big one. It cycles through default , acceptEdits , plan , and any other modes you’ve enabled, like auto or bypassPermissions . One key takes you from “ask before every edit” to “just go,” then to plan mode when you want Claude thinking before it touches anything. On some configurations it’s Alt+M instead.
Esc — Interrupt Claude. Stops the current response or tool call mid-turn so you can redirect, and Claude keeps the work it’s already done. Reach for this the moment you see Claude heading somewhere wrong. Don’t use Ctrl+C for it.
Advertisements
Esc Esc — clear draft, or rewind. Two behaviours depending on context. If your prompt has text in it, double-Esc clears the input and saves the draft to history so Up brings it back. If the input is empty, it opens the rewind menu, which restores or summarizes code and conversation from a previous point. That second one is a checkpoint system, not a text undo.
Advertisements
Ctrl+B — background a running task. Moves Bash commands and agents into the background so you can keep working while they run. Long build, slow test suite, dev server: background it instead of sitting there watching. Tmux users have to press it twice, and there’s a good reason for that (see the conflicts section below).
Ctrl+O — Toggle the transcript viewer. Shows detailed tool usage and execution, and expands MCP calls that otherwise collapse to a single line like “Called Slack 3 times.” When you want to know what Claude actually did rather than what it summarized, this is the window.
General Controls
Shortcut What it does Ctrl+C Interrupts a running operation. If nothing’s running, first press clears the prompt, second press exits Claude Code Ctrl+D Exit the session (EOF signal) Esc Interrupt Claude mid-turn, keeping work done so far Esc Esc Clear the input draft, or open the rewind menu when the input is empty Shift+Tab Cycle permission modes Ctrl+O Toggle transcript viewer Ctrl+T Toggle the task list in the terminal status area Ctrl+B Background running tasks Ctrl+R Reverse-search command history Ctrl+L Redraw the screen, keeping input and history Ctrl+G or Ctrl+X Ctrl+E Open your prompt in your default text editor Ctrl+X Ctrl+K Stop all running background subagents. Press twice within 3 seconds to confirm Ctrl+V / Cmd+V (iTerm2) / Alt+V (Windows, WSL) Paste an image from the clipboard, dropping an [Image #N] chip at the cursor Alt+P / Option+P Switch model without clearing your prompt Alt+T / Option+T Toggle extended thinking Alt+O / Option+O Toggle fast mode Up / Down or Ctrl+P / Ctrl+N Move the cursor, then navigate the command history once you hit the first or last visual row
Two worth singling out. Ctrl+G opens your $EDITOR , which is the fix for writing anything longer than a sentence without fighting a cramped terminal input. And Ctrl+L has bailed me out repeatedly when a stray build log mangled the display; it redraws everything and loses nothing. You may like to know what is AGENTS.md? How to Create One for Claude Code, Codex, Cursor & Other AI Coding Agents
Advertisements
Shortcuts You Can’t Rebind, and Terminal Conflicts
This section explains most of the “shortcut doesn’t work” complaints you’ll see, and it’s the part almost no other guide covers.
A few keys are hardcoded regardless of what you put in your config. Ctrl+C (interrupt/cancel) and Ctrl+D (exit) can’t be remapped. Ctrl+M is identical to Enter, because terminals send the same carriage return for both. Caps Lock never reaches terminal applications at all.
Then there are the conflicts:
Shortcut Conflicts with Ctrl+B tmux prefix — press it twice to send it through Ctrl+A GNU screen prefix Ctrl+Z Unix process suspend (SIGTSTP)
If you’re inside tmux or screen and a shortcut does nothing, this is almost always the reason. Claude Code isn’t failing. The multiplexer is eating the keystroke before it ever arrives. Over SSH, Alt-based chords get swallowed too, so use the Escape-prefix alternatives when you’re on a remote box.
macOS: Why Half Your Alt Shortcuts Don’t Fire
The Option/Alt shortcuts ( Alt+B , Alt+F , Alt+Y , Alt+M , Alt+P ) need Option configured as Meta in your terminal. Out of the box, macOS terminals don’t send the signal Claude Code is listening for, which is why these appear broken on a fresh Mac install.
iTerm2: Settings → Profiles → Keys → General → set Left/Right Option key to “Esc+”
Settings → Profiles → Keys → General → set Left/Right Option key to “Esc+” Apple Terminal: Settings → Profiles → Keyboard → check “Use Option as Meta Key”
Settings → Profiles → Keyboard → check “Use Option as Meta Key” VS Code: set "terminal.integrated.macOptionIsMeta": true
One exception: as of v2.1.132, the extended thinking toggle ( Option+T ) works on macOS without any of this.
Text Editing
These are readline bindings, so they’ll feel familiar from any shell.
Shortcut Action Ctrl+A Move to start of the line Ctrl+E Move to end of line Ctrl+K Delete to end of line, storing the text Ctrl+U Delete from cursor to line start. On macOS, Cmd+Backspace maps to this in iTerm2 and Terminal.app Ctrl+W Delete previous word. On Windows, Ctrl+Backspace also works Ctrl+Y Paste text deleted with Ctrl+K, Ctrl+U, or Ctrl+W Alt+Y (after Ctrl+Y ) Cycle paste history Alt+B / Alt+F Move back / forward one word
The Ctrl+K → Ctrl+Y pair is the one to build muscle memory around. Kill a chunk of text, paste it elsewhere, all without touching your system clipboard.
Multiline Input: Five Ways
Writing a multi-paragraph prompt without accidentally firing it halfway through is a rite of passage.
Method Shortcut Where it works Quick escape \ + Enter All terminals Control sequence Ctrl+J Any terminal, zero config 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 Just paste Code blocks, logs
In VS Code, Cursor, Devin Desktop, Alacritty, or Zed, Shift+Enter won’t work until you run /terminal-setup to install the binding. That one command resolves the single most common complaint people have about the input box. Read more about – 7 AI Trends That Will Shape the Rest of 2026
Quick Command Prefixes
Prefix What it does / Opens the command and skill menu ! Shell mode: runs the command directly, adds output to the session, and Claude responds to it @ File path autocomplete
Shell mode deserves more attention than it gets. Type ! npm test and it runs immediately, no interpretation or approval step. As of v2.1.186, Claude automatically responds to the output once it lands, so you run your tests and get an explanation of the failures without sending a second prompt. Exit shell mode with Escape , Backspace , or Ctrl+U on an empty prompt.
Reverse Search with Ctrl+R
The full flow:
Ctrl+R starts the search Type your query, and matches highlight the term Ctrl+R again cycles through older matches Ctrl+S cycles the scope: this session, this project, all projects Tab or Esc accepts the match for editing; Enter accepts and runs it Ctrl+C cancels and restores your original input
It pulls from the 100 most recent unique prompts in the selected scope, with duplicates collapsed to the newest. The scope-cycling with Ctrl+S is the part people miss, and it means you can retrieve a prompt you wrote in a completely different project.
Transcript Viewer
Once you’ve opened it with Ctrl+O :
Key Action ? Toggle the shortcut help panel (needs fullscreen rendering) Ctrl+E Toggle show-all-content { / } Jump to previous/next user prompt, like Vim paragraph motion [ Dump the full conversation to your terminal’s native scrollback, so Cmd+F and tmux copy mode can search it v Open the conversation in $VISUAL or $EDITOR q , Ctrl+C , Esc Exit transcript view
Vim Mode
Enable it via /config → Editor mode.
You get the motions you’d expect: h / j / k / l , w / e / b for words, 0 / $ / ^ for line positions, gg / G for the start and end of input, f / F / t / T for character jumps. Editing works too: dd , dw , cc , cw , yy , p , u to undo, . to repeat. Text objects like iw , aw , i" , i( compose with d , c , and y as normal.
Four things to know before you switch:
Block-wise visual mode ( Ctrl+V ) is not supported. That’s the main gap.
) is not supported. That’s the main gap. In NORMAL mode, if the cursor can’t move further, j / k and the arrows navigate command history instead.
/ and the arrows navigate command history instead. Esc in vim mode switches INSERT to NORMAL. It does not cancel Claude’s turn, which catches people out.
in vim mode switches INSERT to NORMAL. It does cancel Claude’s turn, which catches people out. Most Ctrl+key shortcuts still pass through to the keybinding system, so Ctrl+T toggles your task list even in NORMAL mode. But ? shows vim’s help, not Claude Code’s.
The /btw Overlay
/btw lets you ask a quick question without adding it to the conversation history. The detail that makes it genuinely useful is that you can run it while Claude is already working. It runs independently and doesn’t interrupt the main turn.
Side question: see your full conversation, but have no access to tools. They answer from what’s already in context, so Claude can’t read files or run commands to respond. Anthropic frames it as the inverse of a subagent: /btw has full context and no tools, a subagent has full tools and empty context.
Once the answer appears, the overlay has its own keys:
Key Action Space , Enter , Esc Dismiss and return to the prompt Up / Down Scroll the answer Left / Right Step between this answer and earlier /btw answers from the session c Copy the answer as raw Markdown f Fork into a new session, inheriting the parent conversation plus this exchange, with full tool access x Clear the list of earlier /btw exchanges
That c key is worth internalizing. Selecting text with the mouse in a terminal gives you the hard-wrapped rendering, complete with broken line breaks. c gives you the clean source Markdown.
Prompt Suggestions
When you open a session, a grayed-out example appears in the input, pulled from your project’s git history so it reflects files you’ve actually been working on. After Claude responds, suggestions keep coming based on the conversation.
Tab or Right arrow places the suggestion in the prompt, Enter submits it, and typing anything dismisses it. They’re skipped after the first turn and in plan mode. To kill them entirely:
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false
Customizing Your Own Shortcuts
If the defaults fight your muscle memory, remap them. Run /keybindings to create or open ~/.claude/keybindings.json . This requires Claude Code v2.1.18 or later.
The file is an object with a bindings array. Each block targets a context and maps keystrokes to actions:
{ "$schema": "https://platform.claude.com/docs/schemas/claude-code/keybindings.json", "bindings": [ { "context": "Chat", "bindings": { "ctrl+e": "chat:externalEditor", "ctrl+u": null } } ] }
Setting an action to null unbinds it, which is how you kill a default that your fingers keep triggering by accident. Changes are detected and applied automatically; no restart needed. Adding the $schema line gets you autocompletion and validation in any editor with JSON Schema support, which is worth the one line.
If a binding isn’t firing, run /doctor . It surfaces every keybinding warning at once, including duplicates in the same context, and it’s the fastest way to diagnose why a shortcut is misbehaving.
Frequently Asked Questions