Claude Code keyboard shortcuts
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.
- Stop Claude while it is workingMacEscWindowsEscLinuxEsc
- Rewind the conversation or codeMacEsc,EscWindowsEsc,EscLinuxEsc,Esc
- Cycle permission modes (normal, auto-accept, plan)MacShiftTabWindowsShiftTabLinuxShiftTab
- New line in the promptMacShiftEnterWindowsShiftEnterLinuxShiftEnter
- Cancel the input or generationMacCtrlCWindowsCtrlCLinuxCtrlC
- Search prompt historyMacCtrlRWindowsCtrlRLinuxCtrlR
Change model, plan mode and permission modes in Claude Code
- Switch the modelMacOptionPWindowsAltPLinuxAltP
- Turn extended thinking on or offMacOptionTWindowsAltTLinuxAltT
- Move a running command to the backgroundMacCtrlBWindowsCtrlBLinuxCtrlB
- Show or hide the to-do listMacCtrlTWindowsCtrlTLinuxCtrlT
- Show the full transcriptMacCtrlOWindowsCtrlOLinuxCtrlO
- Plan mode
- Shift+Tab cycles through the permission modes; stop on plan mode to have Claude plan without editing files.
Controlling Claude
8 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Stop Claude while it is working | Esc | Esc | Esc |
| Rewind the conversation or codePrompt is empty | Esc,Esc | Esc,Esc | Esc,Esc |
| Cycle permission modes (normal, auto-accept, plan) | ShiftTab | ShiftTab | ShiftTab |
| Switch the model | OptionP | AltP | AltP |
| Turn extended thinking on or off | OptionT | AltT | AltT |
| Move a running command to the backgroundA command is running | CtrlB | CtrlB | CtrlB |
| Show or hide the to-do list | CtrlT | CtrlT | CtrlT |
| Show the full transcript | CtrlO | CtrlO | CtrlO |
Input
6 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| New line in the prompt | ShiftEnter | ShiftEnter | ShiftEnter |
| Paste an image from the clipboard | CtrlV | CtrlV | CtrlV |
| Edit the prompt in your text editor | CtrlG | CtrlG | CtrlG |
| Cancel the input or generation | CtrlC | CtrlC | CtrlC |
| Exit Claude CodePrompt is empty | CtrlD | CtrlD | CtrlD |
| Clear the terminal screen | CtrlL | CtrlL | CtrlL |
History
3 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Previous prompt | ↑ | ↑ | ↑ |
| Next prompt | ↓ | ↓ | ↓ |
| Search prompt history | CtrlR | CtrlR | CtrlR |
Prompt shortcuts
7 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Show the shortcut listPrompt is empty | Shift/ | Shift/ | Shift/ |
| Open slash commandsStart of the prompt | / | / | / |
| Run a shell command directly (bash mode)Start of the prompt | Shift1 | Shift1 | Shift1 |
| Mention a file or folder | Shift2 | Shift2 | Shift2 |
| Accept the suggestion or file path | Tab | Tab | Tab |
| New line (works in any terminal) | CtrlJ | CtrlJ | CtrlJ |
| 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| Action | Mac | Windows | Linux |
|---|---|---|---|
| Go to the start of the line | CtrlA | CtrlA | CtrlA |
| Go to the end of the line | CtrlE | CtrlE | CtrlE |
| Back one word| On a Mac, set Option to act as Meta in your terminal. | OptionB | AltB | AltB |
| Forward one word| On a Mac, set Option to act as Meta in your terminal. | OptionF | AltF | AltF |
| Delete to the end of the line | CtrlK | CtrlK | CtrlK |
| Delete to the start of the line | CtrlU | CtrlU | CtrlU |
| Delete the previous word | CtrlW | CtrlW | CtrlW |
| Paste the text you deleted | CtrlY | CtrlY | CtrlY |
| Cycle through earlier deleted textRight after Ctrl+Y | OptionY | AltY | AltY |
| Suspend Claude Code to the shell| Type fg to come back. Not on Windows. | CtrlZ | — | CtrlZ |
No shortcuts match. Try fewer words, the key names only, or search every app.
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
- Paste an image from the clipboardMacCtrlVWindowsCtrlVLinuxCtrlV
- Edit the prompt in your text editorMacCtrlGWindowsCtrlGLinuxCtrlG
- Exit Claude CodeMacCtrlDWindowsCtrlDLinuxCtrlD
- Clear the terminal screenMacCtrlLWindowsCtrlLLinuxCtrlL
- Previous promptMac↑Windows↑Linux↑
- Next promptMac↓Windows↓Linux↓
- Open slash commandsMac/Windows/Linux/
- Run a shell command directly (bash mode)MacShift1WindowsShift1LinuxShift1
- Mention a file or folderMacShift2WindowsShift2LinuxShift2
- Accept the suggestion or file pathMacTabWindowsTabLinuxTab
- New line (works in any terminal)MacCtrlJWindowsCtrlJLinuxCtrlJ
- New line with Option+EnterMacOptionEnter
- 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
- Go to the start of the lineMacCtrlAWindowsCtrlALinuxCtrlA
- Go to the end of the lineMacCtrlEWindowsCtrlELinuxCtrlE
- Back one wordMacOptionBWindowsAltBLinuxAltB
- Forward one wordMacOptionFWindowsAltFLinuxAltF
- Delete to the end of the lineMacCtrlKWindowsCtrlKLinuxCtrlK
- Delete to the start of the lineMacCtrlUWindowsCtrlULinuxCtrlU
- Delete the previous wordMacCtrlWWindowsCtrlWLinuxCtrlW
- Paste the text you deletedMacCtrlYWindowsCtrlYLinuxCtrlY
- Cycle through earlier deleted textMacOptionYWindowsAltYLinuxAltY
- Suspend Claude Code to the shellMacCtrlZLinuxCtrlZ
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.