Skip to main content
Claude Code uses a context-sensitive keybinding system. Shortcuts are organized by the UI context in which they apply — some work everywhere, others only when a specific dialog or panel is focused.

Default keybindings

Global

These shortcuts are active everywhere, regardless of focus.
KeybindingAction
Ctrl+CInterrupt the current operation (double-press to exit)
Ctrl+DExit Claude Code
Ctrl+LRedraw the screen
Ctrl+TToggle the to-do list panel
Ctrl+OToggle the transcript viewer
Ctrl+RSearch command history

Chat input

These shortcuts apply when the chat prompt is focused.
KeybindingAction
EnterSubmit the prompt
Shift+TabCycle through input modes (plan, auto, etc.)
UpLoad the previous message from history
DownLoad the next message from history
Ctrl+GOpen the prompt in an external editor
Ctrl+X Ctrl+EOpen the prompt in an external editor (readline binding)
Ctrl+SStash the current prompt draft
Ctrl+_Undo last edit in the prompt
Ctrl+VPaste an image from the clipboard (Linux/macOS)
Alt+VPaste an image from the clipboard (Windows)
EscapeCancel the current operation
Meta+POpen the model picker

Autocomplete

These shortcuts apply when the autocomplete menu is visible.
KeybindingAction
TabAccept the selected suggestion
EscapeDismiss the autocomplete menu
UpSelect the previous suggestion
DownSelect the next suggestion

Scroll

These shortcuts apply when scrolling through output.
KeybindingAction
Page UpScroll up one page
Page DownScroll down one page
Ctrl+HomeScroll to the top
Ctrl+EndScroll to the bottom
Ctrl+Shift+CCopy selected text

Confirmation dialogs

These shortcuts apply when a permission or confirmation prompt is shown.
KeybindingAction
Y / EnterConfirm yes
N / EscapeConfirm no
Up / DownNavigate options
TabMove to the next field
SpaceToggle a checkbox
Ctrl+EToggle the permission explanation

Transcript viewer

KeybindingAction
Escape / Q / Ctrl+CClose the transcript viewer
Ctrl+EToggle showing all messages
Activated with Ctrl+R from the chat input.
KeybindingAction
Ctrl+RShow next match
EnterExecute the selected command
Tab / EscapeAccept and return to input
Ctrl+CCancel and return to input

Customizing keybindings

Run /keybindings to open ~/.claude/keybindings.json in your default editor. If the file does not exist, Claude Code creates it from a template containing all default bindings. The file uses a JSON format with an array of context blocks:
keybindings.json
{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "bindings": [
    {
      "context": "Global",
      "bindings": {
        "ctrl+l": "app:redraw",
        "ctrl+t": "app:toggleTodos"
      }
    },
    {
      "context": "Chat",
      "bindings": {
        "enter": "chat:submit",
        "ctrl+g": "chat:externalEditor"
      }
    }
  ]
}
Each block specifies a context and a map of key patterns to action identifiers. To remap a key, change the action value. To unbind a key entirely, set it to null:
keybindings.json
{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+s": null
      }
    }
  ]
}
You can also bind a key to run a slash command directly:
keybindings.json
{
  "bindings": [
    {
      "context": "Global",
      "bindings": {
        "ctrl+shift+d": "command:doctor"
      }
    }
  ]
}

Available contexts

ContextWhen it applies
GlobalActive everywhere, regardless of focus
ChatWhen the chat input is focused
AutocompleteWhen the autocomplete menu is visible
ConfirmationWhen a confirmation or permission dialog is shown
TranscriptWhen viewing the transcript
HistorySearchWhen searching command history
SettingsWhen the settings panel is open
SelectWhen a list or select component is focused
ScrollWhen scrolling through output
TaskWhen a task or agent is running in the foreground
ThemePickerWhen the theme picker is open
DiffDialogWhen the diff dialog is open
ModelPickerWhen the model picker is open
PluginWhen the plugin dialog is open

Reserved shortcuts

A small set of shortcuts cannot be rebound because they are handled before the keybinding system runs:
ShortcutReason
Ctrl+CHardcoded interrupt and exit
Ctrl+DHardcoded exit
Ctrl+MIdentical to Enter in all terminals
Terminal-level shortcuts such as Ctrl+Z (SIGTSTP) and Ctrl+\ (SIGQUIT) are intercepted by the OS and never reach Claude Code.
Keybinding customization is a preview feature. Run /doctor after editing keybindings.json to check for validation errors.

Vim mode keybindings

When vim mode is active, the chat input uses a modal editing model with its own keybindings for normal, insert, and visual modes. See Vim Mode for the full reference.

Build docs developers (and LLMs) love