Claude Code keyboard shortcuts
Claude Code spends most of its time waiting for a decision, running a tool, or holding a prompt. These keys cover those moments, including interrupts, rewinds, mode changes, multiline input, and terminal-style editing.
Start with Session control before memorizing prompt editing. Those keys decide whether Claude keeps working, stops safely, or gives you the terminal back.
Session control
Esc is the normal way to stop Claude mid-turn and keep finished work. Ctrl+C cancels input or generation, and exits only after two presses.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Interrupt Claude mid-turnKeeps the work done so far. | Esc | Esc | Esc |
| Clear input draft, or open the rewind menu when input is empty | EscEsc | EscEsc | EscEsc |
| Cancel current input or generationFirst press clears the prompt when nothing is running; second press exits. | CtrlC | CtrlC | CtrlC |
| Exit the session | CtrlD | CtrlD | CtrlD |
| Redraw the terminal screen, keeping history | CtrlL | CtrlL | CtrlL |
| Move a running Bash command to the background | CtrlB | CtrlB | CtrlB |
| Stop all running background agentsPress the sequence twice within three seconds to confirm. | CtrlXCtrlK | CtrlXCtrlK | CtrlXCtrlK |
| Toggle Claude's task checklist | CtrlT | CtrlT | CtrlT |
| Stash or restore the current prompt | CtrlS | CtrlS | CtrlS |
| Suspend Claude Code to the shellUnix only. Run fg to resume. | CtrlZ | CtrlZ | CtrlZ |
| Cycle through permission dialog tabsUse either arrow key to move between tabs. | LeftRight | LeftRight | LeftRight |
| Switch models without clearing the prompt | AltP | OptionP | AltP |
| Toggle fast mode | AltO | OptionO | AltO |
Modes and thinking
Change permission and thinking modes while the session stays open.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Cycle permission modesCycles default, acceptEdits, plan, and any enabled modes such as auto or bypassPermissions. | ShiftTab | ShiftTab | ShiftTab |
| Toggle extended thinking | Tab | Tab | Tab |
| Enable vim-style editingRun /vim once; Esc then switches to NORMAL mode and i to INSERT. | Not documented | Not documented | Not documented |
Input and history
Move through prompts, edit the current line, search history, and open the transcript or external editor.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Navigate command historyDown moves forward. In multiline input the arrows move the cursor first. | Up | Up | Up |
| Reverse search through prompt historyTab or Esc accepts a match for editing; Enter runs it. | CtrlR | CtrlR | CtrlR |
| Toggle the transcript viewer | CtrlO | CtrlO | CtrlO |
| Open the current prompt in your external editor | CtrlG | CtrlG | CtrlG |
| Undo the last input editCtrl+Shift+- does the same. | Ctrl_ | Ctrl_ | Ctrl_ |
| Move cursor back one wordRequires Option as Meta on macOS. | AltB | AltB | AltB |
| Move cursor forward one wordRequires Option as Meta on macOS. | AltF | AltF | AltF |
| Move cursor to the start of the current line | CtrlA | CtrlA | CtrlA |
| Move cursor to the end of the current line | CtrlE | CtrlE | CtrlE |
| Delete from the cursor to the end of the line | CtrlK | CtrlK | CtrlK |
| Delete from the cursor to the start of the line | CtrlU | CtrlU | CtrlU |
| Delete the next wordRequires Option as Meta on macOS. | AltD | AltD | AltD |
| Paste the most recently deleted text | CtrlY | CtrlY | CtrlY |
| Cycle through deleted-text historyPress after Ctrl+Y. Requires Option as Meta on macOS. | AltY | AltY | AltY |
Multiline input
Add a line break without sending the message, whether the terminal supports Shift+Enter or not.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| New line with backslash then EnterWorks in all terminals. | \Enter | \Enter | \Enter |
| New line with a line feed | CtrlJ | CtrlJ | CtrlJ |
| New line on macOS defaults | Not documented | OptionEnter | Not documented |
| New line after running /terminal-setupNative in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal. | ShiftEnter | ShiftEnter | ShiftEnter |
Prompt prefixes
The first character of an empty prompt changes what the line does.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Run a slash command | / | / | / |
| Run the line as a shell command in the session | ! | ! | ! |
| Add the line to CLAUDE.md memory | # | # | # |
| Reference a file, agent, or MCP resource | @ | @ | @ |
Display and help
Open the in-session help and control how Claude's response is displayed while you work.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Toggle syntax highlighting in the theme picker | CtrlT | CtrlT | CtrlT |
| Toggle the shortcut help panel on an empty prompt | ? | ? | ? |
| Start or stop voice dictationRequires voice dictation to be enabled. | Space | Space | Space |
| Toggle transcript viewer shortcut helpUse inside the transcript viewer. | ? | ? | ? |
| Write the full conversation to terminal scrollbackAvailable in fullscreen transcript rendering. | [ | [ | [ |
| Open the transcript in your editorAvailable in fullscreen transcript rendering. | V | V | V |
Make the useful keys stick
Claude Code is at its best when you can interrupt it without panic and edit the next instruction without breaking the session. Keep the control keys close until that part feels ordinary, then let the longer list grow with your work.
You do not need this whole page in your head. Pick two shortcuts that remove a repeated hand movement, use them until they feel ordinary, and come back for the next pair.