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.
This example binds Ctrl+E to open an external editor in the chat context, and unbinds Ctrl+U:

Contexts

Each binding block specifies a context where the bindings apply: Before v2.1.205, a Doctor context and a doctor:fix action existed for the /doctor diagnostics screen.

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:

History actions

Actions for navigating command history:

Chat actions

Actions available in the Chat context: *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:

Confirmation actions

Actions available in the Confirmation context: *On Windows without VT mode (Node <24.2.0/<22.17.0, Bun <1.2.23), defaults to Meta+M.

Permission actions

Actions available in the Confirmation context for permission dialogs:

Transcript actions

Actions available in the Transcript context: transcript:toggleShowAll applies in the classic renderer only; in fullscreen rendering, the transcript viewer doesn’t offer a show-all toggle.

History search actions

Actions available in the HistorySearch context: The historySearch:next, historySearch:accept, historySearch:cancel, and historySearch:execute defaults apply to the inline history search in the classic renderer, which always searches prompts from all projects. historySearch:cycleScope takes effect only in fullscreen rendering, where Ctrl+R opens a search dialog instead and Ctrl+S cycles its scope. The dialog’s other keys are fixed and can’t be rebound: Enter or Tab places the highlighted match in the prompt input and Esc cancels.

Task actions

Actions available in the Task context:

Theme actions

Actions available in the ThemePicker context:

Help actions

Actions available in the Help context:

Tabs actions

Actions available in the Tabs context:

Attachments actions

Actions available in the Attachments context: Actions available in the Footer context:

Message selector actions

Actions available in the MessageSelector context:

Diff actions

Actions available in the DiffDialog context: The diff detail view also binds pager-style keys to the standard scroll actions. These bindings are part of the DiffDialog context and apply only in the detail view; the Scroll context defaults listed under Scroll actions are unchanged.

Model picker actions

Actions available in the ModelPicker context:

Select actions

Actions available in the Select context: Claude Code applies your select:pageUp, select:pageDown, select:first, and select:last bindings in the /skills menu. In most other lists, such as the /model picker, Claude Code pages with PageUp and PageDown regardless of your bindings and ignores Home and End.

Plugin actions

Actions available in the Plugin context:

Settings actions

Actions available in the Settings context. The select:accept and confirm:no actions are reused from the Select and Confirmation contexts with Settings-specific behavior: changes apply to each setting as soon as you change it, so Escape closes the panel with your changes saved rather than declining.

Voice actions

Actions available in the Chat context when voice dictation is enabled:

Scroll actions

Actions available in the Scroll context when fullscreen rendering is enabled:

Keystroke syntax

Modifiers

Use modifier keys with the + separator:
  • ctrl or control - Control key
  • shift - Shift key
  • alt, opt, option, or meta - Alt key on Windows and Linux, Option key on macOS
  • cmd, command, super, or win - Command key on macOS, Windows key on Windows, Super key on Linux
The cmd group is only detected in terminals that report the Super modifier, such as those supporting the Kitty keyboard protocol or xterm’s modifyOtherKeys mode. Most terminals do not send it, so use ctrl or meta for bindings you want to work everywhere. For example:

Uppercase letters

Claude Code parses key names case-insensitively, so K is the same binding as k and ctrl+K is the same as ctrl+k. To bind Shift and a letter, write shift+k.

Non-US keyboard layouts

Write the key names of Ctrl shortcuts as Latin characters even when your active keyboard layout types other characters. How Claude Code matches the key you press to a binding depends on the kind of layout:
  • Under a non-Latin layout such as Cyrillic, Claude Code matches Ctrl shortcuts by the key’s US-layout position when the terminal uses the Kitty keyboard protocol and reports that position. In such a terminal, with a Russian layout active, pressing Ctrl and the physical W key triggers ctrl+w. In a terminal that doesn’t report the position, Claude Code matches whatever the terminal sends for the keypress: an ASCII control code triggers the Latin shortcut, and a keypress that arrives as the Cyrillic character matches no binding
  • Under layouts that rearrange Latin letters, such as AZERTY, Claude Code matches the letter that the key types, so pressing Ctrl and the key labeled A triggers ctrl+a
Before v2.1.247, pressing a Ctrl shortcut under a non-Latin layout didn’t trigger its binding in terminals that use the Kitty keyboard protocol, such as Ghostty, Kitty, WezTerm, and iTerm2.

Chords

Chords are sequences of keystrokes separated by spaces:

Special keys

  • escape or esc - Escape key
  • enter or return - Enter key
  • tab - Tab key
  • space - Space bar
  • up, down, left, right - Arrow keys
  • pageup, pagedown - Page Up and Page Down keys
  • home, end - Home and End keys
  • backspace, delete - Delete keys
  • wheelup, wheeldown - Mouse wheel scroll events

Unbind default shortcuts

Set an action to null to unbind a default shortcut:
This also works for chord bindings. Unbinding every chord that shares a prefix frees that prefix for use as a single-key binding. A chord in any active context keeps its prefix reserved, so you must unbind each chord in the context that defines it. Claude Code binds these default chords on the ctrl+x prefix: ctrl+x ctrl+k, ctrl+x ctrl+e, and ctrl+x enter in Chat, and ctrl+x ctrl+b in Task. The ctrl+x enter chord requires v2.1.247 or later. To reclaim ctrl+x itself as a single-key binding, unbind all of them:
If you unbind some but not all chords on a prefix, pressing the prefix still enters chord-wait mode for the remaining bindings.

Reserved shortcuts

These shortcuts cannot be rebound:

Terminal conflicts

Some shortcuts may conflict with terminal multiplexers:

Vim mode interaction

When vim mode is enabled via /config → Editor mode, 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
  • Vim keys aren’t remappable through the keybindings file. To map a two-key INSERT-mode sequence such as jj to Escape, use the vimInsertModeRemaps setting
  • In vim NORMAL mode, ? shows the help menu (vim behavior)
  • In vim NORMAL mode, / opens history search, the same as Ctrl+R in standard mode

Validation

Claude Code validates your keybindings and shows warnings for:
  • Parse errors (invalid JSON or structure)
  • Invalid context names
  • Invalid action values, such as an action that isn’t a string or null
  • Unknown action names, such as a typo of a registered action. Claude Code skips the binding and keeps any default binding for that key in effect. Before v2.1.246, a binding with an unknown action name silently disabled that key
  • Reserved shortcut conflicts
  • Duplicate bindings in the same context
Claude Code reports warnings when the file loads and writes each one to the debug log. Start Claude Code with --debug to see the details.