/keybindings to create or open your configuration file at ~/.claude/keybindings.json.
Configuration file
The keybindings configuration file is an object with abindings 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 anamespace: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 theGlobal context:
History actions
Actions for navigating command history:Chat actions
Actions available in theChat 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 theAutocomplete context:
Confirmation actions
Actions available in theConfirmation context:
Permission actions
Actions available in theConfirmation context for permission dialogs:
Transcript actions
Actions available in theTranscript context:
transcript:toggleShowAll applies in the default renderer only; in fullscreen rendering, the transcript viewer doesn’t offer a show-all toggle.
History search actions
Actions available in theHistorySearch context:
The
historySearch:next, historySearch:accept, historySearch:cancel, and historySearch:execute defaults apply to the inline history search in the default 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 theTask context:
Theme actions
Actions available in theThemePicker context:
Help actions
Actions available in theHelp context:
Tabs actions
Actions available in theTabs context:
Attachments actions
Actions available in theAttachments context:
Footer actions
Actions available in theFooter context:
Message selector actions
Actions available in theMessageSelector context:
Diff actions
Actions available in theDiffDialog 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 theModelPicker context:
Select actions
Actions available in theSelect context:
Plugin actions
Actions available in thePlugin context:
Settings actions
Actions available in theSettings 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 theChat context when voice dictation is enabled:
Scroll actions
Actions available in theScroll context when fullscreen rendering is enabled:
Keystroke syntax
Modifiers
Use modifier keys with the+ separator:
ctrlorcontrol- Control keyshift- Shift keyalt,opt,option, ormeta- Alt key on Windows and Linux, Option key on macOScmd,command,super, orwin- Command key on macOS, Windows key on Windows, Super key on Linux
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
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:Special keys
escapeoresc- Escape keyenterorreturn- Enter keytab- Tab keyspace- Space barup,down,left,right- Arrow keysbackspace,delete- Delete keys
Unbind default shortcuts
Set an action tonull to unbind a default shortcut:
Ctrl+X family spans two contexts: ctrl+x ctrl+k and ctrl+x ctrl+e in Chat, and ctrl+x ctrl+b in Task. To reclaim ctrl+x itself as a single-key binding, unbind all of them:
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
jjto Escape, use thevimInsertModeRemapssetting - 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
- Reserved shortcut conflicts
- Terminal multiplexer conflicts
- Duplicate bindings in the same context
--debug to see the details.