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?

  1. Run /keybindings. It creates or opens ~/.claude/keybindings.json.
  2. Add a block per context, mapping keys to actions written as namespace:action.
  3. Save. Claude Code picks the change up at once and writes any mistakes to the debug log (start it with --debug to 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

Moments

Claude Code best practices | Code w/ Claude

Anthropic

  1. The Claude Code shortcuts most people need are Esc to stop Claude mid-task, Esc twice to rewind, Shift+Tab to cycle…

Your first Claude Code prompt

Claude

  1. Messages typed while Claude works are queued and delivered when its current tool calls finish; Ctrl+X Enter queues a…

See also

About this page

Last updated Nov 6, 2026 by the Vi.ki team. Page text CC BY-SA 4.0.

Edit History

Hotkeys

/
Jump to the search box
? or Ctrl + /
Open this list
Esc
Close this list, the photo viewer, or the account menu

Video

Space or K
Play or pause
← →
Back or forward 5 seconds
J L
Back or forward 10 seconds
0 to 9
Go to 0% to 90% of the video
, .
Previous or next frame, while paused
M
Mute or unmute
C
Captions on or off
F
Full screen on or off
A D
Previous or next moment

Photo viewer

← → or A D
Previous or next photo
↑ ↓ or W S
Previous or next photo
Home End
First or last photo
I
Show or hide the photo's info
Z
Clickless on or off: a pointer over a thumbnail shows it
N
Compare with the last photo: back to the one shown before this, and N again comes back
Q
Move the thumbnails to the next edge: top, bottom, left and round
, or Ctrl + ,
Open or close the viewer's settings
V
Clickless pan: a zoomed photo follows the pointer, rather than being dragged
Shift
Browse on or off
B
Show or hide the button bar
T
Show or hide the thumbnails
1
100% zoom on or off
0
Rate the photo as no opinion; again takes the answer back
+ -
Rate the photo a step higher or lower
F
Full screen: the photo alone. F again puts everything back.
Back to top