Claude Code Keyboard Shortcuts: The Terminal Cheat Sheet You'll Actually Use
Every Claude Code terminal shortcut from the official docs: interrupt, newline, edit prompts, view the transcript, switch permission modes, plus the macOS setup most people miss.
1. What Claude Code Is, and What the Shortcuts Actually Control
Claude Code is Anthropic’s command-line AI coding tool: you type a request in your terminal, and it reads code, edits files, and runs commands. It isn’t a chat box in a browser, so the mouse is close to useless here. Almost everything happens on the keyboard.
Think of it as a very fast intern sitting next to you. The shortcuts are the handful of ways you tap that person on the shoulder: stop for a second, scratch that, show me what you just did, don’t ask me before every edit.
2. Do These Two Things First, or Half the Shortcuts Won’t Fire
2.1 On macOS, map Option to Meta
The docs are explicit about this: Alt+B, Alt+F, Alt+D, Alt+Y, and Alt+P require Option to be configured as the Meta key on macOS. Without it, nothing happens when you press them. The setting lives in your terminal app’s own preferences, and Anthropic documents where to find it in each terminal.
💡 One exception: Option+T (toggle extended thinking) works on macOS without the Meta mapping.
2.2 If you live in Bash, switch the editing feel
The default word-deletion behavior doesn’t match Bash. To make it match, add one line to ~/.claude/settings.json:
{
"keybindingFlavor": "readline"
}
The default is classic, and this setting requires Claude Code v2.1.238 or later.
The docs give a test you can run yourself. Type fix the bug in src/utils/foo.ts in the prompt, then press Ctrl+W. Under readline, the whole src/utils/foo.ts disappears. Under classic, only foo.ts does.
3. Start Here: The Shortcuts You’ll Press Every Day
| Shortcut | What it does | Worth knowing |
|---|---|---|
Esc | Interrupts Claude’s current response or tool call | Finished work is kept; if messages are queued, it moves on to the next one |
Esc Esc | Clears the prompt and saves it to history; on an empty prompt, opens the rewind menu | The rewind menu can roll code and conversation back to an earlier point |
Ctrl+C | Cancels the running operation; if nothing is running, clears the input, and a second press exits | Compared to Esc, this is the emergency stop plus cleanup |
Ctrl+D | Exits the session | With text in the prompt, it deletes the character after the cursor instead |
Ctrl+O | Toggles the transcript view | Shows which model answered and which tools were called |
Ctrl+L | Redraws the screen | For garbled or misaligned output; history is preserved |
Ctrl+R | Reverse-searches your prompt history | Press again to jump to older matches |
Ctrl+B | Sends the running command or subagent to the background | tmux users press it twice, since tmux claims the key first |
Ctrl+Z | Suspends Claude Code | Unix only; type fg to come back |
⚠️ Ctrl+T means two different things: in the normal interface it toggles Claude’s to-do list, and inside the /theme menu it toggles code syntax highlighting. To see background commands and subagents, use the /tasks command instead.
4. Fixing What You Typed: Prompt Editing Keys
This group is inherited from the Bash command line, so learning one teaches you most of the rest.
| Shortcut | What it does |
|---|---|
Ctrl+A / Ctrl+E | Jump to start / end of the current line |
Ctrl+K / Ctrl+U | Delete to end of line / to start of line |
Ctrl+W | Delete the previous word |
Ctrl+Y | Paste back whatever you just deleted |
Alt+Y (right after Ctrl+Y) | Cycle through earlier deletions |
Alt+B / Alt+F | Move the cursor back / forward one word |
Alt+D | Delete the next word |
Ctrl+_ or Ctrl+Shift+- | Undo the last edit in the prompt |
Every deletion above is stored, so a mistake never means retyping — Ctrl+Y brings it back. On macOS, Option+Delete also deletes the previous word; on Windows it’s Ctrl+Backspace.
4.1 Long prompt? Write it in your editor
Press Ctrl+G (or the readline-native Ctrl+X Ctrl+E) and Claude Code opens the current prompt in your default text editor. Save, and the text comes back.
Turn on Show last response in external editor in /config and it also places Claude’s previous response above your prompt as # comments for reference. Those comments are stripped automatically on save.
4.2 Mid-thought and need to ask something else
Press Ctrl+S: the prompt is stashed and the input clears. Press Ctrl+S again on an empty prompt and your text, cursor position, and pasted content all come back exactly as they were.
5. Four Ways to Add a Newline Without Sending
Hit Enter at the end of a line and the message ships. The docs list four alternatives:
| Method | Keys | When to use it |
|---|---|---|
| Escaped newline | \ then Enter | Works in every terminal — remember this one if nothing else |
| Option newline | Option+Enter | On macOS, once Option is mapped to Meta |
| Shift newline | Shift+Enter | Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal |
| Control character | Ctrl+J | Works anywhere, no configuration needed |
For code blocks and logs, just paste — no manual line breaks required.
6. A Few Characters That Are Shortcuts Too
Type these at the start of the prompt and they trigger features directly:
/— opens the command and skill menu; keep typing to filter.!— enters shell mode. The command runs immediately, its output enters the conversation context, and Claude responds to it. SetrespondToBashCommandstofalseto stop the automatic response.@— file path completion. With cross-session messaging enabled, typing at least one letter after@also lists other live sessions on your machine.:— emoji shortcodes. A complete:name:inserts directly; two or more characters bring up suggestions. Requires v2.1.217 or later.?on an empty prompt — opens the keyboard shortcut help panel. With text already typed, it’s just a question mark.
✅ Forgot a key: press question mark on an empty prompt for the help panel, and press it again inside the transcript view (in full-screen rendered mode) for that layer’s shortcuts. Those two entry points cover most of the “I can’t remember” moments.
7. Permission Modes and Models Are One Keypress Away
7.1 Shift+Tab cycles permission modes
Shift+Tab cycles through default (shown as Manual in the interface), acceptEdits, plan, and, where available, bypassPermissions and auto. One more press from auto returns you to default.
On Windows, use Alt+M instead if the Node or Bun runtime hasn’t enabled VT input mode.
In plain terms: switch to acceptEdits when you’re tired of approving every file change, and to plan when you want a proposal before anything gets touched.
7.2 Option+P for models, Option+T for extended thinking
On Windows and Linux these are Alt+P and Alt+T. Switching models does not clear a prompt you’ve already typed. Option+O (Alt+O) toggles fast mode.
8. Vim Mode: Worth Turning On If You Already Think in Vim
Enable it under /config → Editor mode. Switching to the transcript view or opening the /config panel and coming back preserves both the mode and the cursor position.
8.1 Modes and the moves you’ll use
| Keys | What they do |
|---|---|
Esc or Ctrl+[ | Return to NORMAL mode |
i / I / a / A | Insert before cursor / at line start / after cursor / at line end |
w / b / e | Next word / previous word / end of word |
0 / $ / ^ | Line start / line end / first non-blank character |
dd / dw / D | Delete line / word / to end of line |
cc / cw / C | Change line / word / to end of line |
yy / p / u / . | Yank line / paste / undo / repeat last change |
v / V | Character-wise / line-wise visual selection |
Text objects work too: iw, aw, i(, and i{ all pair with d, c, and y.
8.2 Two things that trip people up
- Block selection with
Ctrl+Vis not supported — the docs say so directly. - In NORMAL mode, once the cursor sits at the very start or end,
j/kand the arrow keys switch to browsing prompt history instead of moving the cursor.
If you want jj to return to NORMAL mode, add this to ~/.claude/settings.json:
{
"editorMode": "vim",
"vimInsertModeRemaps": { "jj": "<Esc>" }
}
Only two printable characters mapped to Escape are supported, and it requires v2.1.208 or later. This setting is read from user-level config only — a project’s .claude/settings.json is ignored, so a repo you clone can’t rewrite your keybindings.
9. What Shortcuts Can’t Do for You
- Behavior varies across platforms and terminals; the docs say this in the opening lines. When a key does nothing, suspect the terminal before you suspect yourself.
- Without Option mapped to Meta, essentially every Alt combination is dead on macOS.
- tmux swallows the first
Ctrl+B, which is why tmux users press it twice. - Word-editing keys such as
Ctrl+WandAlt+Fcan’t be rebound inkeybindings.json. They aren’t remappable actions; the only lever iskeybindingFlavor, which swaps the whole behavior set.
10. Common Questions
10.1 Esc or Ctrl+C — which one?
Press Esc to stop it while keeping completed work. Press Ctrl+C to fully cancel and clear the prompt; with nothing running, two presses exit the program.
10.2 Enter keeps sending too early. Now what?
Use \ + Enter, which works everywhere. If your terminal is on the supported list, Shift+Enter feels better. If neither applies, use Ctrl+J.
10.3 How do I find that prompt from last week?
Press Ctrl+R to reverse-search, type a keyword, and press Ctrl+R again to go further back. Tab or Esc accepts it for further editing; Enter runs it. History is stored per working directory, so older sessions from the same project are searchable too.
10.4 How do I see which tools it just called?
Press Ctrl+O for the transcript view. It expands lines that are collapsed by default, such as an MCP call shown as Called slack 3 times. Exit with q, Ctrl+C, or Esc.
10.5 Can I take back a queued message?
Yes. Anything you type and send while Claude is busy joins a queue. Press Up on the first line of the prompt and the queued messages return to the input, one per line, ready to edit or delete.
11. What to Do Next
Practice three today: Esc to interrupt, Ctrl+O to watch the work, and \ + Enter for newlines. Once those are automatic, go back and map Option to Meta on macOS to unlock the whole Alt group.
One last note: Claude Code moves fast. This guide reflects the official Interactive mode documentation as of September 4, 2026. When a key doesn’t match, trust the official page and your local help panel.