/keybindings command writes a file even when no changes are made, causing defaults drift and schema errors
Problem
Running /keybindings immediately writes ~/.claude/keybindings.json populated with a full snapshot of the current defaults, even if the user makes no edits. This has two problems:
1. Unintended override / defaults drift
If the user makes no changes, the file still exists and overrides defaults going forward. New bindings added in future Claude Code releases won't take effect for that user — silently.
2. Schema errors on a freshly-created file
The generated template includes internal contexts and actions that are not valid in the user-facing JSON schema:
- Context
"Scroll"is not in the schema's enum of valid contexts - Actions
scroll:pageUp,scroll:pageDown,scroll:lineUp,scroll:lineDown,scroll:top,scroll:bottom,selection:copyare not in the available actions list
Running /doctor immediately after /keybindings (without making any edits) reports errors on a file the user never modified.
Expected behaviour
/keybindings should only write the file if the user actually saves a change. Until then, it should open an empty or comment-only template that merges additively with defaults at runtime — consistent with how the bindings system is documented to work.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗