# Claude Code Keybindings: Rebind, Unbind and Chords

> Keybindings live in one hot-reloaded file, scoped by context. The chord prefix rule is what stops a rebind working, and four keys can never be touched.

URL: https://www.matthewswong.com/en/blog/claude-code-keybindings-customization/

- Author: Matthews Wong (https://www.matthewswong.com/en/about/)
- Published: 2026-08-27
- Updated: 2026-08-27
- Category: Software Development

> **Key takeaway:** Claude Code keybindings live in a single file created by the keybindings command, and changes apply without restarting. Bindings are scoped to a context such as Chat or Confirmation, actions use a namespace-colon-action form, and setting an action to null unbinds a default. Four shortcuts cannot be rebound at all.

I wanted a single key for inserting a newline and picked one that was free. It refused to bind, silently, and I assumed the file was wrong. It was not: the key I picked was the prefix of three default chords, and a chord in any active context keeps its prefix reserved. My binding was competing with a mechanism I had not noticed existed.

The keybinding system is more structured than most terminal tools bother with — nineteen contexts, a namespaced action list, real chord support — and the structure is what makes some rebinds refuse to work for reasons that are not obvious. This post covers the file, contexts, the chord prefix rule, the reserved keys and why each is reserved, and how vim mode and keybindings coexist without fighting.

## One file, hot reloaded

Run the keybindings command and Claude Code creates or opens the file for you. It is an object with an array of blocks, each naming a context and a map of keystrokes to actions. The schema URL at the top is optional and worth keeping — it gives you autocompletion for action names in any editor that reads it, which matters because there are well over a hundred.

## Context is why your binding did not fire

Every binding belongs to a context, and a binding in the wrong one simply never runs. There are nineteen, and the split is finer than most people expect — a permission dialog, a diff viewer, a model picker and the plugin browser all have their own. The four you will actually touch are these.

| Context | When it applies | Typical action |
| --- | --- | --- |
| Global | Everywhere in the app | Interrupt, exit, toggle the transcript |
| Chat | The main input area | Submit, newline, external editor, cycle permission mode |
| Confirmation | Permission and confirmation dialogs | Yes, no, toggle the command explanation |
| Scroll | Conversation scrolling in fullscreen rendering | Page up and down, jump to bottom, extend a selection |

## The rebinds actually worth making

Most defaults are fine. These four are the ones I have seen people change and keep changed:

- The external-editor action, if you write long prompts. Its defaults are a chord and a control key that many terminals already claim.
- The jump-to-bottom scroll action, which has no working default chord on a MacBook keyboard — the standard combination does not reach Claude Code on macOS at all.
- The background-task action, which defaults to a key that is also the tmux prefix. There is a chord alternative for exactly this reason.
- The stash-prompt action, if you use its default key for something else in your shell, which many people do.

> There is a readline flavour setting that changes a family of text-editing defaults at once rather than binding them individually: the word-delete key deletes to the previous whitespace, the word-forward keys stop at the end of a word rather than the start of the next one, and a delete-to-word-end binding appears. If you have muscle memory from a readline shell, that one setting is worth more than any individual rebind.

## The chord prefix rule

This is the mechanism that blocked my rebind, and it is worth understanding rather than working around. Chords are keystrokes separated by a space, and any chord in an active context reserves its first keystroke. Reclaiming that keystroke as a single-key binding means unbinding every chord that uses it — and the default family spans two contexts, so unbinding only the ones you can see leaves the prefix reserved.

## The four keys you cannot have

Each reservation has a concrete reason, and one of them is a fact about terminals rather than a decision by anyone. The interrupt and exit keys are hardcoded. The third is reserved because terminals send an identical byte for it and for Enter, so binding it separately is not physically possible. And the fourth is never delivered to terminal applications at all.

> Three more conflict with things outside Claude Code and cannot be fixed from this file. The tmux and GNU screen prefixes are consumed by the multiplexer before Claude Code sees them — in tmux you can press the key twice to send it through — and the suspend key is handled by the shell. If a binding works outside tmux and not inside it, the file is not the problem.

## Vim mode and keybindings do not fight

They operate at different layers, and knowing which layer owns what saves a lot of confusion:

- Vim mode handles input at the text level — cursor movement, modes, motions. Keybindings handle actions at the component level.
- The escape key in vim mode switches insert to normal mode and does not trigger the cancel action.
- Most control-key shortcuts pass straight through vim mode to the keybinding system.
- Vim keys themselves are not remappable through this file. A two-key insert-mode sequence mapped to escape is a separate setting.

> In vim normal mode two keys behave as a vim user expects rather than as Claude Code otherwise would: the question mark shows the help menu, and the forward slash opens history search — the same as the standard-mode history search key. Those are deliberate concessions to vim muscle memory rather than accidents, and they are not documented anywhere you would look while editing a keybindings file.

## When a binding does not take

Claude Code validates the file on load and warns about parse errors, invalid context names, invalid action values, reserved-shortcut conflicts and duplicate bindings within one context. Those warnings appear when the file loads and are also written to the debug log, so starting with the debug flag is how you see the detail rather than the summary.

If the file validates and the binding still does nothing, the usual causes are context and chord reservation, in that order. Check that the action you bound actually exists in the context you put it in — a chat action in the Global block is valid JSON, a valid action name, and completely inert.

Two things make this system easy once you know them: bindings are scoped, so half of all failures are a block in the wrong context, and chords reserve their prefix, so the other half is a key that is not as free as it looks. Everything else is a lookup. Keep the schema line at the top of the file for autocompletion, start with the debug flag the first time a binding misbehaves, and reach for the readline flavour setting before you rebind text editing key by key.

## Sources & further reading

- Claude Code docs — Customize keyboard shortcuts
- Claude Code docs — Interactive mode
- Claude Code docs — Fullscreen rendering and scroll actions
- Claude Code docs — Terminal configuration
- Claude Code docs — CLI reference
- Claude Code docs — Settings reference
- Claude Code docs — Voice dictation
- SchemaStore — the Claude Code keybindings JSON schema

## Source links

- https://code.claude.com/docs/en/keybindings
- https://code.claude.com/docs/en/interactive-mode
- https://code.claude.com/docs/en/fullscreen
- https://code.claude.com/docs/en/terminal-config
- https://code.claude.com/docs/en/cli-reference
- https://code.claude.com/docs/en/settings-reference
- https://code.claude.com/docs/en/voice-dictation
- https://www.schemastore.org/claude-code-keybindings.json

## FAQ

### Where are Claude Code keybindings configured?

In ~/.claude/keybindings.json, which you can create or open by running the /keybindings command. It holds a bindings array of blocks, each naming a context and a map of keystrokes to actions. Changes are detected and applied automatically without restarting Claude Code.

### How do I unbind a default Claude Code shortcut?

Set the keystroke to null in the appropriate context block. This works for chord bindings too. But to reclaim a prefix key as a single-key binding, you must unbind every chord that uses it — a chord in any active context keeps its prefix reserved, and the default families can span more than one context.

### Which Claude Code shortcuts cannot be rebound?

Four. Ctrl+C is a hardcoded interrupt and Ctrl+D a hardcoded exit. Ctrl+M is reserved because terminals send an identical byte for it and for Enter, so binding it separately is not possible. Caps Lock is never delivered to terminal applications at all.

### Does vim mode conflict with Claude Code keybindings?

No, they operate at different layers. Vim mode handles input at the text level — cursor movement, modes, motions — while keybindings handle component-level actions. Escape in vim mode switches insert to normal mode rather than triggering cancel, and most control-key shortcuts pass through to the keybinding system.

### Why does my Claude Code keybinding do nothing?

Usually context or chord reservation. A chat action placed in the Global block is valid JSON and a valid action name, and completely inert. If the file validates and the binding still does nothing, check the context first, then whether the key is the prefix of a chord in any active context. Start with --debug to see validation detail.

---

- HTML version: https://www.matthewswong.com/en/blog/claude-code-keybindings-customization/
- Bahasa Indonesia: https://www.matthewswong.com/id/blog/claude-code-keybindings-customization/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
