Claude Code keyboard shortcuts: the full list
The Claude Code shortcuts that matter most are Esc to stop Claude, Esc twice to rewind, Shift+Tab to change the permission mode, Shift+Enter or Ctrl+J for a new line, Ctrl+V to paste a screenshot, Ctrl+O to see every tool call, and ! at the start of a message to run a shell command yourself.
Daily use
Take this page into your AI
Open in ChatGPT (new tab)Open in Claude (new tab)Most of Claude Code is typing, so a handful of keys save more time than any setting. This page has the ones worth learning on day 1, the ones that surprise people, and the full list to search.
The 6 to learn first
| Key | What it does |
|---|---|
| Esc | Stops Claude at once. The work so far is kept, so you can redirect it. |
| Esc Esc | On an empty prompt, opens the rewind menu to go back to an earlier message, files included. |
| Shift+Tab | Cycles the permission mode: Manual, Accept edits, Plan, Auto. The current mode shows under the prompt. |
| Shift+Enter | A new line instead of sending. If it does not work in your terminal, use Ctrl+J. |
| Ctrl+V | Pastes a screenshot into your message (Alt+V on Windows). |
| Ctrl+O | Shows the full transcript: every tool Claude called and what came back. |
Esc is the one people find last and need most. You do not have to wait for a wrong approach to finish.
Characters that change what a message does
The first character of a message decides how it is read:
/opens the list of commands and skills.!runs the rest as a shell command, by you, not by Claude.! npm testruns your tests, shows the output and adds it to the conversation, and Claude answers it without a second prompt. Because you typed it, there is no permission prompt.@anywhere in a message suggests file paths. Picking one puts the file's contents into your message.?on an empty prompt shows the shortcuts.
Talking while it works
You do not have to wait for a turn to finish. Type a message and press Enter while Claude is working, and it is queued. If Claude is in the middle of tool calls, it reads your message as soon as they finish, in the same turn. Press Up to take queued messages back and edit them, or Ctrl+Enter to send them at once.
Ctrl+B moves a long command, such as a dev server or a test run, to the background, so Claude can carry on while it runs.
On a Mac: Option needs one setting
Shortcuts with Option (Option+P to switch model, Option+T for thinking, Alt+B and Alt+F to jump words) do nothing in most Mac terminals until you tell the terminal to send Option as Meta. In Terminal, turn on Use Option as Meta key in the profile's keyboard settings; in iTerm2, set the Option key to Esc+. Option+T works without it.
Change a shortcut
Run /keybindings to open ~/.claude/keybindings.json. Bindings are grouped by where they apply, such as Chat for the prompt or Global for everywhere. This moves "open in editor" to Ctrl+E and turns off Ctrl+S:
{
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+e": "chat:externalEditor",
"ctrl+s": null
}
}
]
}
Changes apply as soon as you save. The text-editing keys, such as Ctrl+W and Alt+B, cannot be remapped.
Every shortcut
Search by key or by what you want to do, such as "paste" or "new line". Keys can differ by terminal and system; the Mac uses Option where Windows and Linux use Alt.
37 shortcuts
EscControlStops Claude mid-answer or mid-tool so you can redirect it. The work so far is kept. Also closes a dialog, and on a permission prompt it answers No.
Esc EscControlWith the prompt empty, opens the rewind menu to restore code and conversation to an earlier message. With text in the prompt, clears it instead (Up brings it back).
Shift+TabControlCycles the permission mode - Manual, Accept edits, Plan and, where available, Auto. Alt+M on some Windows setups.
Ctrl+CControlInterrupts what is running. With nothing running, the first press clears the prompt and a second press quits.
Ctrl+DControlQuits Claude Code when pressed twice quickly. With text in the prompt it deletes the character after the cursor.
Ctrl+BControlMoves a running command or subagent to the background so you can keep working. In tmux, press it twice.
Ctrl+X Ctrl+KControlStops every background subagent in the session. Press twice within 3 seconds to confirm.
Ctrl+EnterControlSends your queued messages now instead of waiting for the turn to end. Ctrl+X Ctrl+S does the same in terminals that do not pass Ctrl+Enter through.
Option+P / Alt+PControlSwitches model without losing what you have typed. Option on a Mac, Alt on Windows and Linux.
Option+T / Alt+TControlTurns extended thinking on or off, on models where it can be switched.
Option+O / Alt+OControlTurns fast mode on or off.
Ctrl+ZControlSuspends Claude Code to your shell on Mac and Linux. Type fg to bring it back.
Shift+EnterInputStarts a new line without sending. Works as is in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal; /terminal-setup adds it elsewhere.
Backslash + EnterInputStarts a new line in any terminal. Type \ and press Enter.
Ctrl+JInputStarts a new line in any terminal, with no setup.
Ctrl+GInputOpens your prompt in your own text editor, for long prompts or editing a plan. Ctrl+X Ctrl+E does the same.
Ctrl+VInputPastes an image from the clipboard into your message. Cmd+V in iTerm2, Alt+V on Windows and WSL.
Ctrl+SInputPuts what you have typed aside and clears the prompt. Press it again on an empty prompt to bring it back.
Ctrl+RInputSearches the prompts you typed before. Press it again for older matches, Tab to edit the match, Enter to send it.
Up / DownInputMoves through earlier prompts in this project. While messages are queued, Up from the first line takes them back to edit.
TabInputAccepts the highlighted suggestion, such as a command or a file path. On a permission prompt, adds a comment to your answer.
Ctrl+AEdit textMoves to the start of the line.
Ctrl+EEdit textMoves to the end of the line.
Ctrl+KEdit textDeletes from the cursor to the end of the line, kept for Ctrl+Y.
Ctrl+UEdit textDeletes from the cursor to the start of the line, kept for Ctrl+Y. Cmd+Backspace does this in most Mac terminals.
Ctrl+WEdit textDeletes back to the previous space, so one press removes a whole path or --flag=value.
Ctrl+YEdit textPastes back the text you last deleted with Ctrl+K, Ctrl+U or Ctrl+W.
Alt+B / Alt+FEdit textMoves back or forward one word. On a Mac, set Option to act as Meta in your terminal first.
Ctrl+_Edit textUndoes your last edit to the prompt.
/ (commands)PrefixesAt the start of a message, opens the menu of commands and skills. Type letters to filter.
! (shell mode)PrefixesRuns the rest as a shell command yourself, without Claude approving it, and adds the output to the conversation for Claude to answer. Example - ! npm test.
@ (file mention)PrefixesSuggests file paths as you type, and puts the file you pick into your message.
? (help)PrefixesOn an empty prompt, shows the list of shortcuts.
Ctrl+OViewsOpens the full transcript, with every tool call and its result, and the model used for each answer.
Ctrl+TViewsShows or hides Claude's task checklist.
Ctrl+LViewsRedraws the screen if the display gets garbled. Your conversation is kept.
Space (hold)InputDictates by voice while held, once voice dictation is on with /voice.
Questions
- How do I add a new line in Claude Code without sending?
- Press Shift+Enter in terminals that support it (iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal). Ctrl+J works in every terminal, and so does typing \ then Enter. Run /terminal-setup to add Shift+Enter to VS Code, Cursor, Alacritty or Zed.
- Why do the Option shortcuts not work on my Mac?
- Most Mac terminals send Option as a special character, not as a key Claude Code can read. Turn on "Use Option as Meta key" in Terminal, or set Option to Esc+ in iTerm2, and shortcuts such as Option+P and Alt+B start working.
- How do I stop Claude Code without losing the work?
- Press Esc. It stops the current answer or tool call and keeps what was done. Ctrl+C also interrupts, but pressed again on an empty prompt it quits.
- Can I change Claude Code's keyboard shortcuts?
- Yes. Run /keybindings to open ~/.claude/keybindings.json, where you bind keys to actions or set a key to null to turn it off. Changes apply without a restart. The text-editing keys such as Ctrl+W cannot be changed.
Sources