1> ## Documentation Index
2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt
3> Use this file to discover all available pages before exploring further.
4
5# Customize keyboard shortcuts
6
7> Customize keyboard shortcuts in Claude Code with a keybindings configuration file.
8
9Claude Code supports customizable keyboard shortcuts. Run `/keybindings` to create or open your configuration file at `~/.claude/keybindings.json`.
10
11## Configuration file
12
13The keybindings configuration file is an object with a `bindings` array. Each block specifies a context and a map of keystrokes to actions.
14
15<Note>Changes to the keybindings file are automatically detected and applied without restarting Claude Code.</Note>
16
17| Field | Description |
18| :--------- | :------------------------------------------------- |
19| `$schema` | Optional JSON Schema URL for editor autocompletion |
20| `$docs` | Optional documentation URL |
21| `bindings` | Array of binding blocks by context |
22
23This example binds `Ctrl+E` to open an external editor in the chat context, and unbinds `Ctrl+U`:
24
25```json theme={null}
26{
27 "$schema": "https://platform.claude.com/docs/schemas/claude-code/keybindings.json",
28 "$docs": "https://code.claude.com/docs/en/keybindings",
29 "bindings": [
30 {
31 "context": "Chat",
32 "bindings": {
33 "ctrl+e": "chat:externalEditor",
34 "ctrl+u": null
35 }
36 }
37 ]
38}
39```
40
41## Contexts
42
43Each binding block specifies a **context** where the bindings apply:
44
45| Context | Description |
46| :---------------- | :----------------------------------------------- |
47| `Global` | Applies everywhere in the app |
48| `Chat` | Main chat input area |
49| `Autocomplete` | Autocomplete menu is open |
50| `Settings` | Settings menu (escape-only dismiss) |
51| `Confirmation` | Permission and confirmation dialogs |
52| `Tabs` | Tab navigation components |
53| `Help` | Help menu is visible |
54| `Transcript` | Transcript viewer |
55| `HistorySearch` | History search mode (Ctrl+R) |
56| `Task` | Background task is running |
57| `ThemePicker` | Theme picker dialog |
58| `Attachments` | Image/attachment bar navigation |
59| `Footer` | Footer indicator navigation (tasks, teams, diff) |
60| `MessageSelector` | Rewind dialog message selection |
61| `DiffDialog` | Diff viewer navigation |
62| `ModelPicker` | Model picker effort level |
63| `Select` | Generic select/list components |
64| `Plugin` | Plugin dialog (browse, discover, manage) |
65
66## Available actions
67
68Actions 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.
69
70### App actions
71
72Actions available in the `Global` context:
73
74| Action | Default | Description |
75| :--------------------- | :------ | :-------------------------- |
76| `app:interrupt` | Ctrl+C | Cancel current operation |
77| `app:exit` | Ctrl+D | Exit Claude Code |
78| `app:toggleTodos` | Ctrl+T | Toggle task list visibility |
79| `app:toggleTranscript` | Ctrl+O | Toggle verbose transcript |
80
81### History actions
82
83Actions for navigating command history:
84
85| Action | Default | Description |
86| :----------------- | :------ | :-------------------- |
87| `history:search` | Ctrl+R | Open history search |
88| `history:previous` | Up | Previous history item |
89| `history:next` | Down | Next history item |
90
91### Chat actions
92
93Actions available in the `Chat` context:
94
95| Action | Default | Description |
96| :-------------------- | :------------------------ | :----------------------- |
97| `chat:cancel` | Escape | Cancel current input |
98| `chat:cycleMode` | Shift+Tab\* | Cycle permission modes |
99| `chat:modelPicker` | Cmd+P / Meta+P | Open model picker |
100| `chat:thinkingToggle` | Cmd+T / Meta+T | Toggle extended thinking |
101| `chat:submit` | Enter | Submit message |
102| `chat:undo` | Ctrl+\_ | Undo last action |
103| `chat:externalEditor` | Ctrl+G | Open in external editor |
104| `chat:stash` | Ctrl+S | Stash current prompt |
105| `chat:imagePaste` | Ctrl+V (Alt+V on Windows) | Paste image |
106
107\*On Windows without VT mode (Node \<24.2.0/\<22.17.0, Bun \<1.2.23), defaults to Meta+M.
108
109### Autocomplete actions
110
111Actions available in the `Autocomplete` context:
112
113| Action | Default | Description |
114| :---------------------- | :------ | :------------------ |
115| `autocomplete:accept` | Tab | Accept suggestion |
116| `autocomplete:dismiss` | Escape | Dismiss menu |
117| `autocomplete:previous` | Up | Previous suggestion |
118| `autocomplete:next` | Down | Next suggestion |
119
120### Confirmation actions
121
122Actions available in the `Confirmation` context:
123
124| Action | Default | Description |
125| :-------------------------- | :-------- | :---------------------------- |
126| `confirm:yes` | Y, Enter | Confirm action |
127| `confirm:no` | N, Escape | Decline action |
128| `confirm:previous` | Up | Previous option |
129| `confirm:next` | Down | Next option |
130| `confirm:nextField` | Tab | Next field |
131| `confirm:previousField` | (unbound) | Previous field |
132| `confirm:cycleMode` | Shift+Tab | Cycle permission modes |
133| `confirm:toggleExplanation` | Ctrl+E | Toggle permission explanation |
134
135### Permission actions
136
137Actions available in the `Confirmation` context for permission dialogs:
138
139| Action | Default | Description |
140| :----------------------- | :------ | :--------------------------- |
141| `permission:toggleDebug` | Ctrl+D | Toggle permission debug info |
142
143### Transcript actions
144
145Actions available in the `Transcript` context:
146
147| Action | Default | Description |
148| :------------------------- | :------------- | :---------------------- |
149| `transcript:toggleShowAll` | Ctrl+E | Toggle show all content |
150| `transcript:exit` | Ctrl+C, Escape | Exit transcript view |
151
152### History search actions
153
154Actions available in the `HistorySearch` context:
155
156| Action | Default | Description |
157| :---------------------- | :---------- | :----------------------- |
158| `historySearch:next` | Ctrl+R | Next match |
159| `historySearch:accept` | Escape, Tab | Accept selection |
160| `historySearch:cancel` | Ctrl+C | Cancel search |
161| `historySearch:execute` | Enter | Execute selected command |
162
163### Task actions
164
165Actions available in the `Task` context:
166
167| Action | Default | Description |
168| :---------------- | :------ | :---------------------- |
169| `task:background` | Ctrl+B | Background current task |
170
171### Theme actions
172
173Actions available in the `ThemePicker` context:
174
175| Action | Default | Description |
176| :------------------------------- | :------ | :------------------------- |
177| `theme:toggleSyntaxHighlighting` | Ctrl+T | Toggle syntax highlighting |
178
179### Help actions
180
181Actions available in the `Help` context:
182
183| Action | Default | Description |
184| :------------- | :------ | :-------------- |
185| `help:dismiss` | Escape | Close help menu |
186
187### Tabs actions
188
189Actions available in the `Tabs` context:
190
191| Action | Default | Description |
192| :-------------- | :-------------- | :----------- |
193| `tabs:next` | Tab, Right | Next tab |
194| `tabs:previous` | Shift+Tab, Left | Previous tab |
195
196### Attachments actions
197
198Actions available in the `Attachments` context:
199
200| Action | Default | Description |
201| :--------------------- | :---------------- | :------------------------- |
202| `attachments:next` | Right | Next attachment |
203| `attachments:previous` | Left | Previous attachment |
204| `attachments:remove` | Backspace, Delete | Remove selected attachment |
205| `attachments:exit` | Down, Escape | Exit attachment bar |
206
207### Footer actions
208
209Actions available in the `Footer` context:
210
211| Action | Default | Description |
212| :---------------------- | :------ | :------------------------ |
213| `footer:next` | Right | Next footer item |
214| `footer:previous` | Left | Previous footer item |
215| `footer:openSelected` | Enter | Open selected footer item |
216| `footer:clearSelection` | Escape | Clear footer selection |
217
218### Message selector actions
219
220Actions available in the `MessageSelector` context:
221
222| Action | Default | Description |
223| :----------------------- | :---------------------------------------- | :---------------- |
224| `messageSelector:up` | Up, K | Move up in list |
225| `messageSelector:down` | Down, J | Move down in list |
226| `messageSelector:top` | Ctrl+Up, Shift+Up, Meta+Up, Shift+K | Jump to top |
227| `messageSelector:bottom` | Ctrl+Down, Shift+Down, Meta+Down, Shift+J | Jump to bottom |
228| `messageSelector:select` | Enter | Select message |
229
230### Diff actions
231
232Actions available in the `DiffDialog` context:
233
234| Action | Default | Description |
235| :-------------------- | :----------------- | :--------------------- |
236| `diff:dismiss` | Escape | Close diff viewer |
237| `diff:previousSource` | Left | Previous diff source |
238| `diff:nextSource` | Right | Next diff source |
239| `diff:previousFile` | Up | Previous file in diff |
240| `diff:nextFile` | Down | Next file in diff |
241| `diff:viewDetails` | Enter | View diff details |
242| `diff:back` | (context-specific) | Go back in diff viewer |
243
244### Model picker actions
245
246Actions available in the `ModelPicker` context:
247
248| Action | Default | Description |
249| :--------------------------- | :------ | :-------------------- |
250| `modelPicker:decreaseEffort` | Left | Decrease effort level |
251| `modelPicker:increaseEffort` | Right | Increase effort level |
252
253### Select actions
254
255Actions available in the `Select` context:
256
257| Action | Default | Description |
258| :---------------- | :-------------- | :--------------- |
259| `select:next` | Down, J, Ctrl+N | Next option |
260| `select:previous` | Up, K, Ctrl+P | Previous option |
261| `select:accept` | Enter | Accept selection |
262| `select:cancel` | Escape | Cancel selection |
263
264### Plugin actions
265
266Actions available in the `Plugin` context:
267
268| Action | Default | Description |
269| :--------------- | :------ | :----------------------- |
270| `plugin:toggle` | Space | Toggle plugin selection |
271| `plugin:install` | I | Install selected plugins |
272
273### Settings actions
274
275Actions available in the `Settings` context:
276
277| Action | Default | Description |
278| :---------------- | :------ | :---------------------------------- |
279| `settings:search` | / | Enter search mode |
280| `settings:retry` | R | Retry loading usage data (on error) |
281
282## Keystroke syntax
283
284### Modifiers
285
286Use modifier keys with the `+` separator:
287
288* `ctrl` or `control` - Control key
289* `alt`, `opt`, or `option` - Alt/Option key
290* `shift` - Shift key
291* `meta`, `cmd`, or `command` - Meta/Command key
292
293For example:
294
295```
296ctrl+k Single key with modifier
297shift+tab Shift + Tab
298meta+p Command/Meta + P
299ctrl+shift+c Multiple modifiers
300```
301
302### Uppercase letters
303
304A 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.
305
306Uppercase letters with modifiers (e.g., `ctrl+K`) are treated as stylistic and do **not** imply Shift — `ctrl+K` is the same as `ctrl+k`.
307
308### Chords
309
310Chords are sequences of keystrokes separated by spaces:
311
312```
313ctrl+k ctrl+s Press Ctrl+K, release, then Ctrl+S
314```
315
316### Special keys
317
318* `escape` or `esc` - Escape key
319* `enter` or `return` - Enter key
320* `tab` - Tab key
321* `space` - Space bar
322* `up`, `down`, `left`, `right` - Arrow keys
323* `backspace`, `delete` - Delete keys
324
325## Unbind default shortcuts
326
327Set an action to `null` to unbind a default shortcut:
328
329```json theme={null}
330{
331 "bindings": [
332 {
333 "context": "Chat",
334 "bindings": {
335 "ctrl+s": null
336 }
337 }
338 ]
339}
340```
341
342## Reserved shortcuts
343
344These shortcuts cannot be rebound:
345
346| Shortcut | Reason |
347| :------- | :------------------------- |
348| Ctrl+C | Hardcoded interrupt/cancel |
349| Ctrl+D | Hardcoded exit |
350
351## Terminal conflicts
352
353Some shortcuts may conflict with terminal multiplexers:
354
355| Shortcut | Conflict |
356| :------- | :-------------------------------- |
357| Ctrl+B | tmux prefix (press twice to send) |
358| Ctrl+A | GNU screen prefix |
359| Ctrl+Z | Unix process suspend (SIGTSTP) |
360
361## Vim mode interaction
362
363When vim mode is enabled (`/vim`), keybindings and vim mode operate independently:
364
365* **Vim mode** handles input at the text input level (cursor movement, modes, motions)
366* **Keybindings** handle actions at the component level (toggle todos, submit, etc.)
367* The Escape key in vim mode switches INSERT to NORMAL mode; it does not trigger `chat:cancel`
368* Most Ctrl+key shortcuts pass through vim mode to the keybinding system
369* In vim NORMAL mode, `?` shows the help menu (vim behavior)
370
371## Validation
372
373Claude Code validates your keybindings and shows warnings for:
374
375* Parse errors (invalid JSON or structure)
376* Invalid context names
377* Reserved shortcut conflicts
378* Terminal multiplexer conflicts
379* Duplicate bindings in the same context
380
381Run `/doctor` to see any keybinding warnings.