Claude Code Keyboard Shortcuts
Claude Code's main shortcuts are Esc to stop Claude, Esc twice to rewind, Shift+Tab to cycle permission modes, Ctrl+R to search history, Ctrl+O for the transcript, Ctrl+B to background a task and Alt+P (Option+P) to switch model. Shortcuts can be changed in ~/.claude/keybindings.json, opened with /keybindings.
The Claude Code shortcuts most people need are Esc to stop Claude mid-task, Esc twice to rewind, Shift+Tab to cycle permission modes, Ctrl+R to search past prompts, Ctrl+O to open the full transcript and Ctrl+C to cancel or, pressed twice on an empty prompt, quit (Interactive mode). A new line in a prompt is \ then Enter in any terminal, or Shift+Enter in terminals that support it. Almost every shortcut can be changed in ~/.claude/keybindings.json, which /keybindings creates and opens; changes apply without a restart (Keybindings). The shortcuts below are for the terminal; the VS Code extension and the desktop app have their own, listed on Claude Code in VS Code and JetBrains and Claude Code Desktop.
Quick facts
| Stop Claude | Esc |
| Rewind | Esc Esc on an empty prompt, or /rewind |
| Permission modes | Shift+Tab (Alt+M on some Windows setups) |
| New line | \ + Enter, Ctrl+J, or Shift+Enter |
| Shortcut help | ? on an empty prompt |
| Custom shortcuts | ~/.claude/keybindings.json (/keybindings) |
| Vim keys | /config > Editor mode |
| Cannot be rebound | Ctrl+C, Ctrl+D, Ctrl+M, Ctrl+[, Ctrl+I, Ctrl+H |
Sources: Interactive mode, Keybindings, read Nov 6, 2026.
Controlling Claude
| Shortcut | What it does |
|---|---|
Esc |
Stops Claude mid-turn, keeping the work done so far; closes a dialog |
Esc Esc |
On an empty prompt, opens the rewind menu; on a draft, clears it |
Ctrl+C |
Cancels, or clears the input; twice on an empty prompt exits |
Ctrl+D |
Exits (press twice within 800 ms) |
Shift+Tab |
Cycles permission modes: Manual, Accept edits, Plan, and Auto or Bypass when available |
Alt+P / Option+P |
Opens the model picker |
Alt+T / Option+T |
Toggles extended thinking (no effect on Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable) |
Alt+O / Option+O |
Toggles fast mode |
Ctrl+B |
Sends a running command or agent to the background (press twice in tmux) |
Ctrl+X Ctrl+K |
Stops all background subagents (press twice within 3 seconds) |
Ctrl+T |
Shows or hides Claude's task checklist |
Ctrl+O |
Opens the transcript with tool details and the model per message |
Ctrl+Enter or Ctrl+X Ctrl+S |
Sends queued messages now |
Source: Interactive mode, Keybindings, read Nov 6, 2026.
Messages typed while Claude works are queued and delivered when its current tool calls finish; Ctrl+X Enter queues a message so that it never interrupts the turn. The permission modes Shift+Tab cycles through are explained on Claude Code Permissions and Modes, and the rewind menu on Claude Code Checkpoints. On Windows terminals without VT mode, the mode shortcut falls back to Alt+M (Keybindings).
Writing prompts
| Shortcut | What it does |
|---|---|
Enter |
Sends the message |
\ then Enter |
New line in any terminal |
Ctrl+J |
New line in any terminal |
Shift+Enter |
New line in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal; /terminal-setup adds it to VS Code, Cursor, Alacritty and Zed |
Ctrl+R |
Searches earlier prompts |
Up / Down |
Steps through prompt history |
Ctrl+G or Ctrl+X Ctrl+E |
Edits the prompt in your external editor |
Ctrl+S |
Stashes the draft, or brings it back |
Ctrl+V (Alt+V on Windows and WSL, Cmd+V in iTerm2) |
Pastes an image as an [Image #N] chip |
Ctrl+_ |
Undoes the last edit |
Ctrl+A / Ctrl+E |
Moves to the start or end of the line |
Ctrl+K / Ctrl+U / Ctrl+W |
Deletes to the end, to the start, or the previous word |
Ctrl+Y |
Pastes the deleted text back |
Alt+B / Alt+F |
Moves a word back or forward |
Ctrl+L |
Redraws the screen, keeping input and conversation |
Ctrl+Z |
Suspends Claude Code (macOS and Linux) |
Source: Interactive mode, read Nov 6, 2026.
Prefixes
A character at the start of the prompt changes what it does (Interactive mode):
/runs a command or skill (Claude Code Slash Commands).!runs a shell command directly, adds its output to the conversation, and Claude responds to it.@mentions a file path, with tab completion.?on an empty prompt shows the shortcut help.:starts an emoji shortcode.
Vim mode
Vim-style editing is turned on in /config under Editor mode; the old /vim command was removed in version 2.1.92. It offers NORMAL, INSERT and VISUAL modes with familiar motions such as w, b, gg, G and f{char} and text objects. In vim mode Esc switches from INSERT to NORMAL rather than canceling, / in NORMAL mode searches history and ? shows help. Vim keys themselves cannot be remapped in the keybindings file; a sequence such as jj for Esc goes in the vimInsertModeRemaps setting (Keybindings).
How do I change Claude Code keyboard shortcuts?
- Run
/keybindings. It creates or opens~/.claude/keybindings.json. - Add a block per context, mapping keys to actions written as
namespace:action. - Save. Claude Code picks the change up at once and writes any mistakes to the debug log (start it with
--debugto see them).
This example, from Anthropic's page, makes Ctrl+E open the external editor and frees Ctrl+S:
{
"$schema": "https://www.schemastore.org/claude-code-keybindings.json",
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+e": "chat:externalEditor",
"ctrl+s": null
}
}
]
}
Source: Keybindings, read Nov 6, 2026.
Contexts include Global, Chat, Autocomplete, Confirmation, Transcript, HistorySearch, Task, Select, Settings, Plugin and Agents, among 27 listed. Writing null removes a default. Modifiers are ctrl, shift, alt (also meta or option) and cmd, though most terminals never send cmd, so ctrl or meta is safer. Chords are keys separated by spaces, such as ctrl+k ctrl+s, each pressed within 3 seconds of the last. command:<name> binds a key to a slash command: "meta+g": "command:compact" makes Alt+G run /compact. Since version 2.1.280, y and n no longer confirm prompts by default; add them to a Confirmation block to get that back.
Some keys can never be rebound: Ctrl+C and Ctrl+D are fixed, and terminals deliver Ctrl+M as Enter, Ctrl+[ as Esc and Ctrl+I as Tab. Others collide with terminal tools: Ctrl+B is the tmux prefix, Ctrl+A GNU screen's and Ctrl+Z suspends the process (Keybindings).
Frequently asked questions
How do I add a new line in Claude Code? Type \ and then Enter, or press Ctrl+J, in any terminal; Shift+Enter also works in terminals that support it, and /terminal-setup installs it for VS Code, Cursor, Alacritty and Zed.
How do I stop Claude Code while it is working? Press Esc. Claude Code stops the current turn and keeps the work done so far, so you can redirect it; Ctrl+C also cancels.
How do I undo in Claude Code? Press Esc twice on an empty prompt, or run /rewind, to choose an earlier prompt and restore the code, the conversation or both; Ctrl+_ undoes typing in the prompt itself.
How do I switch to plan mode in Claude Code? Press Shift+Tab until the mode reads Plan, or type /plan; on some Windows setups the shortcut is Alt+M.
Where is the Claude Code keybindings file? Claude Code keeps custom shortcuts in ~/.claude/keybindings.json; /keybindings creates or opens it.
How do I paste an image into Claude Code? Press Ctrl+V in the Claude Code prompt (Alt+V on Windows and WSL, Cmd+V in iTerm2); the image appears as an [Image #N] chip.
Sources
- Interactive mode, Claude Code Docs, read Nov 6, 2026
- Customize keyboard shortcuts, Claude Code Docs, read Nov 6, 2026
- Commands, Claude Code Docs, read Nov 6, 2026
- Checkpointing, Claude Code Docs, read Nov 6, 2026
- Claude Code best practices | Code w/ Claude, Anthropic, Jul 31, 2025 (video)
- Your first Claude Code prompt, Claude, May 15, 2026 (video)
Moments
Claude Code best practices | Code w/ Claude
Anthropic
Your first Claude Code prompt
Claude
See also
-
Claude CodeClaude Code is Anthropic's agentic coding tool. It reads a codebase, edits files, runs commands and opens pull requests from the terminal, VS Code, JetBrains IDEs, the Claude desktop app, the browser and Slack, and it comes with every paid Claude plan or a pay-as-you-go Console account. -
Claude Code in VS Code and JetBrainsClaude Code has a VS Code extension (also for Cursor, Kiro and other forks) with inline diffs, plan review and @-mentions, opened with Cmd+Esc or Ctrl+Esc, and a JetBrains plugin for IntelliJ IDEA, PyCharm, WebStorm and other JetBrains IDEs that connects the Claude Code CLI to the IDE's diff viewer. -
Claude Code DesktopClaude Code Desktop is the Code tab of the Claude desktop app for macOS, Windows and Linux (beta). It runs Claude Code sessions side by side, locally, in the cloud or over SSH, with Git worktrees, a visual diff view, a terminal, a browser preview and computer use, on any paid Claude plan with no separate CLI install.
-
Claude Code Permissions and ModesClaude Code has six permission modes (Manual, Accept edits, Plan, Auto, Don't ask and Bypass permissions), cycled with Shift+Tab; since v2.1.283 interactive sessions start in auto mode, and --dangerously-skip-permissions turns every check off and belongs only in a container or VM.
-
Claude Code CheckpointsClaude Code saves a checkpoint of your files before every prompt, so /rewind or Esc pressed twice can restore the code, the conversation or both to an earlier point. Checkpoints cover Claude's own file edits, not changes made only by shell commands or most subagents, so Git is still needed.
-
Claude Code Slash CommandsClaude Code's slash commands are typed at the start of a message, such as /clear, /compact, /model, /init, /rewind and /usage. Anthropic's list had 121 entries on Nov 6, 2026, counting bundled skills and workflows, and your own commands are skills in .claude/skills/ or .claude/commands/.