Skip to content

↑↓ moveEnter openEsc close

Claude Code keyboard shortcuts

Claude Code 2.x · 34 shortcuts · checked Nov 2026 · Source: Anthropic docs

Claude Code is Anthropic's coding agent for the terminal. These keys stop or rewind Claude, switch permission modes, write and edit multi-line prompts, mention files, run shell commands and move through history.

Most used Claude Code keyboard shortcuts

The Claude Code shortcuts worth learning first. The full list follows, grouped by task.

Change model, plan mode and permission modes in Claude Code

Plan mode
Shift+Tab cycles through the permission modes; stop on plan mode to have Claude plan without editing files.
34 shortcuts

Small screen: your system's keys only. Pick another system in the tabs above.

ActionMacWindowsLinux
Stop Claude while it is workingEscEscEsc
Rewind the conversation or codePrompt is emptyEsc,EscEsc,EscEsc,Esc
Cycle permission modes (normal, auto-accept, plan)ShiftTabShiftTabShiftTab
Switch the modelOptionPAltPAltP
Turn extended thinking on or offOptionTAltTAltT
Move a running command to the backgroundA command is runningCtrlBCtrlBCtrlB
Show or hide the to-do listCtrlTCtrlTCtrlT
Show the full transcriptCtrlOCtrlOCtrlO

Input

6 shortcuts
ActionMacWindowsLinux
New line in the promptShiftEnterShiftEnterShiftEnter
Paste an image from the clipboardCtrlVCtrlVCtrlV
Edit the prompt in your text editorCtrlGCtrlGCtrlG
Cancel the input or generationCtrlCCtrlCCtrlC
Exit Claude CodePrompt is emptyCtrlDCtrlDCtrlD
Clear the terminal screenCtrlLCtrlLCtrlL

History

3 shortcuts
ActionMacWindowsLinux
Previous prompt↑↑↑
Next prompt↓↓↓
Search prompt historyCtrlRCtrlRCtrlR

Prompt shortcuts

7 shortcuts
ActionMacWindowsLinux
Show the shortcut listPrompt is emptyShift/Shift/Shift/
Open slash commandsStart of the prompt///
Run a shell command directly (bash mode)Start of the promptShift1Shift1Shift1
Mention a file or folderShift2Shift2Shift2
Accept the suggestion or file pathTabTabTab
New line (works in any terminal)CtrlJCtrlJCtrlJ
New line with Option+Enter| The macOS default in Terminal.app and iTerm2 once Option is set to act as Meta.OptionEnter——

Editing the prompt

10 shortcuts
ActionMacWindowsLinux
Go to the start of the lineCtrlACtrlACtrlA
Go to the end of the lineCtrlECtrlECtrlE
Back one word| On a Mac, set Option to act as Meta in your terminal.OptionBAltBAltB
Forward one word| On a Mac, set Option to act as Meta in your terminal.OptionFAltFAltF
Delete to the end of the lineCtrlKCtrlKCtrlK
Delete to the start of the lineCtrlUCtrlUCtrlU
Delete the previous wordCtrlWCtrlWCtrlW
Paste the text you deletedCtrlYCtrlYCtrlY
Cycle through earlier deleted textRight after Ctrl+YOptionYAltYAltY
Suspend Claude Code to the shell| Type fg to come back. Not on Windows.CtrlZ—CtrlZ
Show the key map: which keys Claude Code uses mostDarker orange = used by more shortcuts

Write and edit prompts in Claude Code: new lines, images and history

Shift+Enter for a new line
Run /terminal-setup once to make Shift+Enter add a new line in terminals that need it, such as VS Code's or iTerm2.

Move and delete text in the Claude Code prompt

Change Claude Code keyboard shortcuts

Key bindings file
Custom bindings go in ~/.claude/keybindings.json, where you can rebind actions or add chords. Ask Claude Code itself to change a key and it will edit the file.
In VS Code and Cursor
With the Claude Code extension installed, Cmd+Esc (Ctrl+Esc on Windows and Linux) opens Claude Code from the editor.

Claude Code keyboard shortcuts: questions

How do I add a new line in a Claude Code prompt?
Type a backslash and press Enter on any terminal. Shift+Enter works in iTerm2, WezTerm, Ghostty and Kitty, and in other terminals after you run /terminal-setup.
How do I stop Claude Code while it is working?
Press Esc once to interrupt it; your conversation stays and you can type a new instruction. Ctrl+C cancels the current input, and pressing it twice exits.

These are the default key bindings in Claude Code 2.x, as published by Anthropic. Shortcuts that need an extension, an add-in or a changed keymap are left out. Where two combinations do the same thing, both are shown.

Single-system lists: Claude Code keyboard shortcuts for Mac, Claude Code keyboard shortcuts for Windows, Claude Code keyboard shortcuts for Linux.

Each shortcut has its own page with the keys for every system, related shortcuts and the same action in other apps. The printable cheat sheet fits the whole list on one or two pages.