Skip to main content
Claude Code supports customizable keyboard shortcuts. Run /keybindings to create or open your configuration file at ~/.claude/keybindings.json.

Configuration file

The keybindings configuration file is an object with a bindings array. Each block specifies a context and a map of keystrokes to actions.
Changes to the keybindings file are automatically detected and applied without restarting Claude Code.
FieldDescription
$schemaOptional JSON Schema URL for editor autocompletion
$docsOptional documentation URL
bindingsArray of binding blocks by context
This example binds Ctrl+E to open an external editor in the chat context, and unbinds Ctrl+U:
{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+e": "chat:externalEditor",
        "ctrl+u": null
      }
    }
  ]
}

Contexts

Each binding block specifies a context where the bindings apply:
ContextDescription
GlobalApplies everywhere in the app
ChatMain chat input area
AutocompleteAutocomplete menu is open
SettingsSettings menu (escape-only dismiss)
ConfirmationPermission and confirmation dialogs
TabsTab navigation components
HelpHelp menu is visible
TranscriptTranscript viewer
HistorySearchHistory search mode (Ctrl+R)
TaskBackground task is running
ThemePickerTheme picker dialog
AttachmentsImage/attachment bar navigation
FooterFooter indicator navigation (tasks, teams, diff)
MessageSelectorRewind and summarize dialog message selection
DiffDialogDiff viewer navigation
ModelPickerModel picker effort level
SelectGeneric select/list components
PluginPlugin dialog (browse, discover, manage)

Available actions

Actions follow a namespace:action format, such as chat:submit to send a message or app:toggleTodos to show the task list. Each context has specific actions available.

App actions

Actions available in the Global context:
ActionDefaultDescription
app:interruptCtrl+CCancel current operation
app:exitCtrl+DExit Claude Code
app:toggleTodosCtrl+TToggle task list visibility
app:toggleTranscriptCtrl+OToggle verbose transcript

History actions

Actions for navigating command history:
ActionDefaultDescription
history:searchCtrl+ROpen history search
history:previousUpPrevious history item
history:nextDownNext history item

Chat actions

Actions available in the Chat context:
ActionDefaultDescription
chat:cancelEscapeCancel current input
chat:cycleModeShift+Tab*Cycle permission modes
chat:modelPickerCmd+P / Meta+POpen model picker
chat:thinkingToggleCmd+T / Meta+TToggle extended thinking
chat:submitEnterSubmit message
chat:undoCtrl+_Undo last action
chat:externalEditorCtrl+GOpen in external editor
chat:stashCtrl+SStash current prompt
chat:imagePasteCtrl+V (Alt+V on Windows)Paste image
*On Windows without VT mode (Node <24.2.0/<22.17.0, Bun <1.2.23), defaults to Meta+M.

Autocomplete actions

Actions available in the Autocomplete context:
ActionDefaultDescription
autocomplete:acceptTabAccept suggestion
autocomplete:dismissEscapeDismiss menu
autocomplete:previousUpPrevious suggestion
autocomplete:nextDownNext suggestion

Confirmation actions

Actions available in the Confirmation context:
ActionDefaultDescription
confirm:yesY, EnterConfirm action
confirm:noN, EscapeDecline action
confirm:previousUpPrevious option
confirm:nextDownNext option
confirm:nextFieldTabNext field
confirm:previousField(unbound)Previous field
confirm:cycleModeShift+TabCycle permission modes
confirm:toggleExplanationCtrl+EToggle permission explanation

Permission actions

Actions available in the Confirmation context for permission dialogs:
ActionDefaultDescription
permission:toggleDebugCtrl+DToggle permission debug info

Transcript actions

Actions available in the Transcript context:
ActionDefaultDescription
transcript:toggleShowAllCtrl+EToggle show all content
transcript:exitCtrl+C, EscapeExit transcript view

History search actions

Actions available in the HistorySearch context:
ActionDefaultDescription
historySearch:nextCtrl+RNext match
historySearch:acceptEscape, TabAccept selection
historySearch:cancelCtrl+CCancel search
historySearch:executeEnterExecute selected command

Task actions

Actions available in the Task context:
ActionDefaultDescription
task:backgroundCtrl+BBackground current task

Theme actions

Actions available in the ThemePicker context:
ActionDefaultDescription
theme:toggleSyntaxHighlightingCtrl+TToggle syntax highlighting

Help actions

Actions available in the Help context:
ActionDefaultDescription
help:dismissEscapeClose help menu

Tabs actions

Actions available in the Tabs context:
ActionDefaultDescription
tabs:nextTab, RightNext tab
tabs:previousShift+Tab, LeftPrevious tab

Attachments actions

Actions available in the Attachments context:
ActionDefaultDescription
attachments:nextRightNext attachment
attachments:previousLeftPrevious attachment
attachments:removeBackspace, DeleteRemove selected attachment
attachments:exitDown, EscapeExit attachment bar
Actions available in the Footer context:
ActionDefaultDescription
footer:nextRightNext footer item
footer:previousLeftPrevious footer item
footer:openSelectedEnterOpen selected footer item
footer:clearSelectionEscapeClear footer selection

Message selector actions

Actions available in the MessageSelector context:
ActionDefaultDescription
messageSelector:upUp, KMove up in list
messageSelector:downDown, JMove down in list
messageSelector:topCtrl+Up, Shift+Up, Meta+Up, Shift+KJump to top
messageSelector:bottomCtrl+Down, Shift+Down, Meta+Down, Shift+JJump to bottom
messageSelector:selectEnterSelect message

Diff actions

Actions available in the DiffDialog context:
ActionDefaultDescription
diff:dismissEscapeClose diff viewer
diff:previousSourceLeftPrevious diff source
diff:nextSourceRightNext diff source
diff:previousFileUpPrevious file in diff
diff:nextFileDownNext file in diff
diff:viewDetailsEnterView diff details
diff:back(context-specific)Go back in diff viewer

Model picker actions

Actions available in the ModelPicker context:
ActionDefaultDescription
modelPicker:decreaseEffortLeftDecrease effort level
modelPicker:increaseEffortRightIncrease effort level

Select actions

Actions available in the Select context:
ActionDefaultDescription
select:nextDown, J, Ctrl+NNext option
select:previousUp, K, Ctrl+PPrevious option
select:acceptEnterAccept selection
select:cancelEscapeCancel selection

Plugin actions

Actions available in the Plugin context:
ActionDefaultDescription
plugin:toggleSpaceToggle plugin selection
plugin:installIInstall selected plugins

Settings actions

Actions available in the Settings context:
ActionDefaultDescription
settings:search/Enter search mode
settings:retryRRetry loading usage data (on error)

Keystroke syntax

Modifiers

Use modifier keys with the + separator:
  • ctrl or control - Control key
  • alt, opt, or option - Alt/Option key
  • shift - Shift key
  • meta, cmd, or command - Meta/Command key
For example:
ctrl+k          Single key with modifier
shift+tab       Shift + Tab
meta+p          Command/Meta + P
ctrl+shift+c    Multiple modifiers

Uppercase letters

A standalone uppercase letter implies Shift. For example, K is equivalent to shift+k. This is useful for vim-style bindings where uppercase and lowercase keys have different meanings. Uppercase letters with modifiers (e.g., ctrl+K) are treated as stylistic and do not imply Shift — ctrl+K is the same as ctrl+k.

Chords

Chords are sequences of keystrokes separated by spaces:
ctrl+k ctrl+s   Press Ctrl+K, release, then Ctrl+S

Special keys

  • escape or esc - Escape key
  • enter or return - Enter key
  • tab - Tab key
  • space - Space bar
  • up, down, left, right - Arrow keys
  • backspace, delete - Delete keys

Unbind default shortcuts

Set an action to null to unbind a default shortcut:
{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+s": null
      }
    }
  ]
}

Reserved shortcuts

These shortcuts cannot be rebound:
ShortcutReason
Ctrl+CHardcoded interrupt/cancel
Ctrl+DHardcoded exit

Terminal conflicts

Some shortcuts may conflict with terminal multiplexers:
ShortcutConflict
Ctrl+Btmux prefix (press twice to send)
Ctrl+AGNU screen prefix
Ctrl+ZUnix process suspend (SIGTSTP)

Vim mode interaction

When vim mode is enabled (/vim), keybindings and vim mode operate independently:
  • Vim mode handles input at the text input level (cursor movement, modes, motions)
  • Keybindings handle actions at the component level (toggle todos, submit, etc.)
  • The Escape key in vim mode switches INSERT to NORMAL mode; it does not trigger chat:cancel
  • Most Ctrl+key shortcuts pass through vim mode to the keybinding system
  • In vim NORMAL mode, ? shows the help menu (vim behavior)

Validation

Claude Code validates your keybindings and shows warnings for:
  • Parse errors (invalid JSON or structure)
  • Invalid context names
  • Reserved shortcut conflicts
  • Terminal multiplexer conflicts
  • Duplicate bindings in the same context
Run /doctor to see any keybinding warnings.