Claude Code keyboard shortcuts

Claude Code runs in a terminal, so this page gives one set of keys for every system and shows the macOS variant where the documentation prints one, as in Option + P / Alt + P for switching models. It covers the prompt, dialogs, the transcript viewer, fullscreen rendering, agent view and the vim editor mode; slash commands and CLI flags are left out. On macOS most Alt shortcuts need Option set as Meta in the terminal.

259 shortcuts in 20 sections. Checked row by row against Claude Code Docs on . Edited by Jay.

Session controls 14

ActionShortcut
Interrupt or clear the promptStops a running operation; when idle, one press empties the prompt and a second quits.Ctrl+C
Exit the sessionThe first press only shows a hint; press again within 800 ms to quit.Ctrl+D
Stop the response or close a dialogWork done so far is kept and queued messages go out next; on a permission prompt it declines.Esc
Clear the draft or rewindWith text typed it clears and saves the draft; on an empty prompt it opens the rewind menu.EscthenEsc
Cycle permission modesSteps through default, acceptEdits and plan; Alt + M replaces it on Windows runtimes without VT input mode.Shift+TaborAlt+M
Switch modelOption + P on macOS, Alt + P on Windows and Linux; the text in your prompt stays.Option+PorAlt+P
Toggle extended thinkingDoes nothing on models that always think; on macOS it works without setting Option as Meta.Option+TorAlt+T
Toggle fast modeOption + O on macOS, Alt + O on Windows and Linux.Option+OorAlt+O
Toggle transcript viewerShows tool calls in detail, with a timestamp and the model name on every assistant message.Ctrl+O
Toggle the task checklistShows or hides Claude's to-do list in the status area; running shells and subagents are under /tasks.Ctrl+T
Redraw the screenRepaints a garbled or half-blank display without losing the prompt text or the conversation.Ctrl+L
Redraw from a Mac terminalOnly where the terminal forwards the key; iTerm2 and Terminal.app wipe their own display and Claude Code repaints it.Cmd+K
Suspend Claude CodeUnix only: the process drops to your shell and fg brings it back.Ctrl+Z
Cancel automatic continueWhile the usage-limit wait lines show; Esc needs an empty prompt.EscorCtrl+C

Prompt input 19

ActionShortcut
Send the promptWhile Claude is working, the message is queued instead of interrupting the turn.Enter
New line with a backslashType a backslash and then press Enter; this works in every terminal.\thenEnter
New line in any terminalInserts a line break without sending and needs no terminal setup.Ctrl+J
Insert a new lineNative in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal; other terminals need setup.Shift+Enter
New line on macOSNeeds Option set as Meta in the macOS terminal.Option+Enter
Accept autocomplete suggestionInserts the highlighted suggestion while the list is showing, for example a file path after @.Tab
Dismiss autocomplete menuEsc
Previous autocomplete suggestionUp
Next autocomplete suggestionDown
Cursor up or previous promptMoves within a multi-row prompt first; from the first row it recalls the previous history entry.UporCtrl+P
Cursor down or next promptMoves within a multi-row prompt first; from the last row it steps forward through history.DownorCtrl+N
Accept prompt suggestionPuts the suggested prompt into the input; Enter then submits it.TaborRight
Paste image from clipboardCmd + V is for iTerm2 and Alt + V for Windows and WSL; an [Image #N] chip marks the spot.Ctrl+VorCmd+VorAlt+V
Open prompt in text editorEdits the prompt in your default editor; the second form is the readline-native binding.Ctrl+GorCtrl+XthenCtrl+E
Stash or restore the promptSets the typed text aside and empties the prompt; pressed again on an empty prompt, it brings the text back.Ctrl+S
Dictate by voiceNeeds voice dictation enabled; hold to record, or tap after running /voice tap.Space
Queue the messageSends the draft so that it waits for the current turn to end instead of interrupting.Ctrl+XthenEnter
Send queued messages nowQueued messages and the draft go out at once; terminals without extended keys need the second form.Ctrl+EnterorCtrl+XthenCtrl+S
Take back queued messagesWith the cursor on the top row, queued entries return to the input for editing.Up

Editing text 13

On macOS, Alt + B, Alt + F, Alt + D, Alt + Y and Alt + P reach Claude Code only after the terminal is set to send Option as Meta.

ActionShortcut
Go to start of lineIn a multiline prompt it stays on the same logical line.Ctrl+A
Go to end of lineStays on the current logical line when the prompt has several lines.Ctrl+E
Move back one wordA word is a run of letters and digits; on macOS the terminal must send Option as Meta.Alt+B
Move forward one wordLands at the end of the current word, or of the next one when between words.Alt+F
Cut to end of lineThe removed text is stored and can be pasted back with Ctrl + Y.Ctrl+K
Cut back to line startRepeat it to clear across lines; macOS terminals such as iTerm2 map Cmd + Backspace to it.Ctrl+U
Cut back to previous whitespaceOne press takes out a whole path or a --flag=value token.Ctrl+W
Delete previous wordOption + Delete on macOS, Ctrl + Backspace on Windows; punctuation such as . and / ends a word.Option+DeleteorCtrl+Backspace
Cut to end of wordRemoves up to the end of the current or next word and keeps it for Ctrl + Y.Alt+D
Delete character after cursorApplies only while the prompt has text; on an empty prompt the same key exits.Ctrl+D
Paste deleted textBrings back whatever Ctrl + K, Ctrl + U or Ctrl + W last removed.Ctrl+Y
Cycle paste historyPress right after Ctrl + Y to step through earlier deletions; needs Option as Meta on macOS.Alt+Y
Undo last input editBrings back the earlier prompt text together with its cursor position.Ctrl+_orCtrl+Shift+-

Typed prefixes 5

ActionShortcut
Run a command or skillAt the start of the prompt it lists built-in commands, skills and plugin commands; letters filter the list./
Enter shell modeThe line runs in your shell and its output joins the conversation.!
Mention a file pathOpens file path autocomplete; press Tab to accept a match.@
Insert an emoji shortcodeA full :name: inserts the emoji; two or more characters open suggestions.:
Toggle shortcut help panelOnly on an empty prompt; with text already typed it just inserts the character.?

Transcript viewer 12

ActionShortcut
Show transcript shortcutsOpens the key help panel inside the viewer; needs fullscreen rendering.?
Jump between user promptsPrevious or next prompt, like a vim paragraph motion; fullscreen rendering only.{or}
Search the transcriptFullscreen rendering: Enter keeps the match, Esc cancels and returns to where you were./
Next or previous matchStill works once the search bar has been closed.norN
Scroll one linePart of the less-style navigation that fullscreen rendering adds to transcript mode.jorkorUporDown
Go to top or bottomgorGorHomeorEnd
Scroll half a pageCtrl+UorCtrl+D
Scroll a full pageCtrl+BorCtrl+ForSpaceorb
Toggle show all contentClassic renderer only; fullscreen rendering has no such toggle.Ctrl+E
Write conversation to scrollbackPuts the whole conversation into the terminal's own scrollback so native search can reach it.[
Open conversation in editorUses a temp file and the editor named in $VISUAL or $EDITOR; fullscreen rendering only.v
Exit transcript viewEach of the three keys is rebindable through the transcript:exit action.qorCtrl+CorEsc

Fullscreen scrolling and selection 18

On a MacBook keyboard, Fn with the arrow keys sends Page Up, Page Down, Home and End. Ctrl + Fn + Right does not reach Claude Code on macOS, so jumping to the bottom has no working chord there by default.

ActionShortcut
Scroll half a screenScrolls the conversation inside the app when fullscreen rendering is on.Page UporPage Down
Go to start of conversationCtrl+Home
Go to latest messageAlso switches auto-follow back on.Ctrl+End
Scroll with the mouse wheelScroll
Select textSelected text is copied on mouse release unless Copy on select is turned off.Drag
Select a wordFollows iTerm2 word boundaries, so a path or a URL is picked up whole.Double-click
Select the lineTriple-click
Extend selection leftShift+Left
Extend selection rightShift+Right
Extend selection upThe view scrolls with it at the top edge.Shift+Up
Extend selection downThe view scrolls with it at the bottom edge.Shift+Down
Extend selection to line startShift+Home
Extend selection to line endShift+End
Copy selected textNeeded when Copy on select is off; Cmd + C requires a terminal with the kitty keyboard protocol.Ctrl+Shift+CorCmd+C
Copy the active selectionWhile text is selected in fullscreen rendering it copies rather than interrupting.Ctrl+C
Place cursor in the promptClick
Expand a collapsed tool resultClick again to collapse; the tool call and its result open together.Click
Open a link or file pathCmd on macOS, Ctrl on Linux and Windows; a plain click does not open links.Cmd+ClickorCtrl+Click

Permission prompts and dialogs 20

Letter keys from the keybindings reference (j, k, s, i, f, r, g, b) are pressed without Shift: Claude Code reads key names case-insensitively and a capital is written with Shift, as in Shift + G.

ActionShortcut
Confirm the dialogDialogs use the same action to accept even when they ask no yes-or-no question.Enter
Decline the actionOn a permission prompt this answers No without a comment.Esc
Previous dialog optionUp
Next dialog optionDown
Toggle dialog selectionSpace
Comment on a permission answerWith Yes or No focused it opens a comment field; a second press closes the field.Tab
Allow for the whole sessionOn file permission prompts that offer the option; with a comment field open it closes the field.Shift+Tab
Toggle fast mode in /fast dialogTab
Close the dialogEither key pressed twice closes most dialogs rather than quitting; the hint after the first press says which.Ctrl+CthenCtrl+CorCtrl+DthenCtrl+D
Next dialog tabSwitches tabs while the tab row has focus; in /help and /sandbox it also works from the content.TaborRight
Previous dialog tabShift+TaborLeft
Move between tab row and contentA list inside the tab answers keys only while it has focus.UporDown
Next list optionApplies to generic lists such as the /model picker and the rewind menu.DownorjorCtrl+N
Previous list optionUporkorCtrl+P
Page up through optionsPage Up
Page down through optionsPage Down
First list optionHome
Last list optionEnd
Accept list selectionEnter
Cancel list selectionEsc

Pickers and settings panels 15

ActionShortcut
Lower effort in model pickerLeft
Raise effort in model pickerRight
Use model for this session onlyActs on the model highlighted in the picker.s
Lower effort on the sliderThe slider opens when /effort is run with no arguments; needs v2.1.284 or later.Left
Raise effort on the sliderRight
Toggle ultracodeOnly when the /effort slider offers ultracode; the switch covers this session.Tab
Use effort for this session onlys
Toggle plugin selectionSpace
Install selected pluginsi
Favorite the selected pluginFavorites are listed close to the top of the Installed tab.f
Search settingsPuts the settings panel into search mode./
Change the selected settingOpens a submenu when the setting has one.EnterorSpace
Retry loading usage dataAvailable after the usage data failed to load.r
Close the settings panelEach change is saved the moment you make it, so closing loses nothing.Esc
Toggle syntax highlightingOnly inside the /theme picker; decides whether code in responses is coloured.Ctrl+T

Background tasks and shell mode 5

A binding written with a comma, such as Ctrl + X, Ctrl + K, is two keystrokes: press the second within 3 seconds of the first or Claude Code cancels the chord.

ActionShortcut
Background the running taskMoves a running Bash command or agent to the background; tmux users press Ctrl + B twice.Ctrl+BorCtrl+XthenCtrl+B
Stop all background subagentsPress twice within 3 seconds to confirm; it also turns off artifact auto-replies for the session.Ctrl+XthenCtrl+K
Background session and open agent viewOnly on an empty prompt; the session keeps running, and in an attached session the same press detaches.Left
Leave shell modeWorks on an empty prompt after the ! prefix switched the input to shell mode.EscorBackspaceorCtrl+U
Complete a shell commandIn shell mode, finishes a partial command from earlier ! commands in the project.Tab

Reviewing diffs 8

ActionShortcut
Scroll file list upDiff panel in fullscreen rendering, once the changed-file list overflows.Alt+UporCtrl+Up
Scroll file list downAlt+DownorCtrl+Down
Cycle the comparison baseGoes from this session to all uncommitted changes, then to everything since the branch split.Ctrl+XthenB
Select a changed fileDiff dialog of the classic renderer; inside an open diff the same keys scroll.UporDown
Open the file's diffEnter
Scroll an open diffPage UporPage Down
Back to list or close dialogEsc
Focus the source pickerThen pick Current or a turn view; inside a file's diff, Tab reaches the ask button instead.Tab

Earlier diff viewer 11

ActionShortcut
Previous diff sourceThis viewer opens outside fullscreen rendering only after the cc-plugin-diff mod is disabled.Left
Next diff sourceRight
Previous file or line upMoves through the file list, or scrolls one line in the detail view.Upork
Next file or line downDownorj
Half viewport upPage Up
Half viewport downPage Down
Full viewport upShift+Spaceorb
Full viewport downSpace
Top of the diffgorHome
Bottom of the diffShift+GorEnd
Close viewer or return to listFrom the detail view it goes back to the file list first.Esc

Side question overlay 9

ActionShortcut
Dismiss the answerCloses the /btw overlay; running /btw with no question reopens it.SpaceorEnterorEsc
Scroll the answerUporDown
Show older side answersThe bracket is for terminals that do not report Shift with arrow keys; needs v2.1.257 or later.Shift+Leftor[
Return toward current answerShift+Rightor]
Cycle through side answersTaborShift+Tab
Copy answer as MarkdownCopies the raw source text, which mouse selection of the wrapped terminal output would not give.c
Fork into a subagentThe fork inherits the conversation plus this exchange and has full tool access; local sessions only.f
Clear earlier side questionsx
Detach to agent viewOnly in an attached background session; the side question keeps running.Left

Agent view 22

ActionShortcut
Move between rowsUporDown
Move a screenful of rowsPage UporPage Down
First or last rowHomeorEnd
Attach or submit inputAttaches to the selected session, or sends the input's text when it is not a filter.Enter
Attach to selected sessionRight
Attach to session 1 to 9Counts within the focused session's directory.Alt+1-9
Toggle the peek panelSpace
Browse subagents or apply suggestionOn an empty input it lists all subagents; otherwise it applies the highlighted suggestion.Tab
New line in dispatch inputShift+Enter
New line in dispatch inputCtrl+J
Dispatch and attach at onceOnly in terminals where the ? overlay lists the key.Ctrl+Enter
Edit dispatch prompt in editorOpens $VISUAL or $EDITOR; it follows the chat:externalEditor binding.Ctrl+G
Switch session groupingGroups sessions by state or by directory.Ctrl+S
Pin or unpin sessionCtrl+T
Find sessions by nameCtrl+F
Rename selected sessionCtrl+R
Jump between group headersCtrl with the same arrows is bound as well by default.Alt+UporAlt+Down
Reorder selected sessionShift+UporShift+Down
Stop or delete sessionThe first press stops the session; a second within two seconds deletes it.Ctrl+X
Close peek, clear input or exitAfter backgrounding a session with the Left key, the final press returns to that conversation.Esc
Clear input or exitOne press empties the input; two presses leave agent view.Ctrl+C
Show agent view shortcuts?

Vim mode switching 9

ActionShortcut
Enter NORMAL modeFrom INSERT or VISUAL; with vim mode on, Esc no longer cancels the input.EscorCtrl+[
Insert before cursori
Insert at line startI
Insert after cursora
Insert at line endA
Open line belowo
Open line aboveO
Character-wise selectionStarts VISUAL mode; motions then extend the selection.v
Line-wise selectionV

Vim normal mode navigation 19

ActionShortcut
Cursor left, down, up, righthorjorkorl
Move one character rightSpace
Next wordw
End of worde
Previous wordb
Start of line0
First non-blank character^
End of line$
Start of inputgg
Start of last lineG
Find character forwardThe cursor lands on the next occurrence of the typed character.f{char}
Find character backwardF{char}
Jump before next characterStops one position short of the match.t{char}
Jump after previous characterT{char}
Repeat last character jump;
Repeat character jump in reverse,
Browse prompt historyOnly when the cursor sits at the start or end of the input and has nowhere left to go.jorkorUporDown
Open history searchActs like Ctrl + R; the empty search shows a hint for reaching the command menu instead./
Show the help menu?

Vim normal mode editing 23

ActionShortcut
Delete characterx
Replace character under cursorr{char}
Substitute characterRemoves the character under the cursor and switches to INSERT mode; needs v2.1.211 or later.s
Substitute lineEmpties the line and switches to INSERT mode; needs v2.1.211 or later.S
Delete linedd
Delete to line endD
Delete by word motionThe second letter is the motion: w for a word, e to its end, b backward.dwordeordb
Delete through or up to characterdf removes the matched character too, dt stops just before it.df{char}ordt{char}
Delete line and its neighbourdj takes the line below as well, dk the line above.djordk
Delete to first or last linedgg / dG
Operate back to line startDeletes, changes or yanks from the cursor to the line start; needs v2.1.281 or later.d0orc0ory0
Change linecc
Change to line endC
Change by word motioncworceorcb
Yank lineYank means copy; both forms take the whole line.yyorY
Yank by word motionyworyeoryb
Paste after cursorp
Paste before cursorP
Indent line>>
Dedent line<<
Join linesJ
Undo last changeu
Repeat last change.

Vim text objects 7

ActionShortcut
Inner or around wordUsed after an operator such as d, c or y.iworaw
Inner or around WORDA WORD is delimited by whitespace only.iWoraW
Inside or around double quotesi"ora"
Inside or around single quotesi'ora'
Inside or around parenthesesi(ora(
Inside or around bracketsi[ora[
Inside or around bracesi{ora{

Vim visual mode 11

ActionShortcut
Delete selectiondorx
Yank selectiony
Change selectioncors
Replace selection from registerp
Replace selected charactersEvery character in the selection becomes the typed one.r{char}
Change case of selection~ toggles case, u makes lowercase and U uppercase.~oruorU
Indent or dedent the selection>or<
Join selected linesJ
Swap cursor and anchoro
Select a text objectAny text object from the NORMAL mode list selects that span here.iworaw
Switch selection type or exitBlock-wise selection with Ctrl + V is not supported.vorV

Notes

Keys that depend on the terminal

Claude Code reads keys through the terminal, so a few bindings depend on what the terminal sends. On macOS, Alt + B, Alt + F, Alt + D, Alt + Y and the model switch need Option configured as Meta, while Option + T works without it. Shift + Enter is native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal; Ctrl + J and a backslash followed by Enter insert a new line in any terminal. Inside tmux, Ctrl + B is the prefix key, so press it twice to background a task.

Classic renderer and fullscreen rendering

Several keys change with the renderer. In the classic renderer Ctrl + R searches history inline and Tab or Esc accepts a match; in fullscreen rendering the same key opens a dialog where Esc cancels and Ctrl + S cycles the scope. The transcript viewer opened with Ctrl + O gains search and less-style scrolling in fullscreen rendering, while Ctrl + E for showing all content exists only in the classic renderer. The page keys, Ctrl + Home, Ctrl + End and mouse selection belong to fullscreen rendering.

Rebinding and reserved keys

Running /keybindings opens ~/.claude/keybindings.json, where bindings are grouped by context such as Chat, Confirmation or Transcript, and changes apply without a restart. Ctrl + C and Ctrl + D are hardcoded and cannot be rebound. The text editing shortcuts have no actions in that file, and vim keys are not remappable there either; the one vim remap is a two-key INSERT sequence mapped to Escape through the vimInsertModeRemaps setting.

Questions

Where are the slash commands like /compact and /clear?

On the Claude Code prompts reference page, which lists the full in-session command set. This page covers keyboard shortcuts, typed prefixes and the vim editor mode only.

How do I type a new line in Claude Code without sending the prompt?

Ctrl + J works in any terminal without configuration, as does a backslash followed by Enter. Shift + Enter is native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal, and Option + Enter works on macOS once Option is set as Meta.

Why do the Alt shortcuts not work in Claude Code on macOS?

The terminal has to send Option as Meta before Alt + B, Alt + F, Alt + D, Alt + Y and Alt + P reach Claude Code; the terminal configuration page of the Claude Code docs gives the setting for each terminal. Toggling extended thinking with Option + T works without that setting.

How do I revert a change Claude Code made?

Press Esc, Esc on an empty prompt to open the rewind menu, which restores or summarizes code and conversation from an earlier point. With text in the prompt the same keys clear the draft instead.

Which key switches Claude Code between permission modes?

Shift + Tab cycles through default, acceptEdits and plan, then bypassPermissions and auto when those are available. On Windows runtimes that do not enable VT input mode the default is Alt + M.

Can Claude Code's keyboard shortcuts be changed?

Yes. /keybindings creates or opens ~/.claude/keybindings.json, where each context maps keystrokes to actions and null unbinds a default. Ctrl + C and Ctrl + D stay fixed, and the text editing and vim keys are not covered by that file.

Sources and checks

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

9 rows from the earlier version of this page were removed in that check: duplicates, and bindings the documentation does not list or lists differently.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.