{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/claude-code-keybindings.json",
  "$defs": {
    "keybindingBlock": {
      "description": "A block of keybindings for a specific UI context",
      "type": "object",
      "properties": {
        "context": {
          "$ref": "#/$defs/context"
        },
        "bindings": {
          "description": "Map of keystroke patterns to actions.\nhttps://code.claude.com/docs/en/keybindings",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/keystrokePattern"
          },
          "additionalProperties": {
            "$ref": "#/$defs/bindingValue"
          }
        }
      },
      "required": ["context", "bindings"],
      "additionalProperties": false
    },
    "context": {
      "description": "UI context where these bindings apply. Global bindings work everywhere.\nhttps://code.claude.com/docs/en/keybindings",
      "type": "string",
      "enum": [
        "Global",
        "Chat",
        "Autocomplete",
        "Confirmation",
        "Help",
        "Transcript",
        "HistorySearch",
        "Task",
        "ThemePicker",
        "Settings",
        "Tabs",
        "Attachments",
        "Footer",
        "MessageSelector",
        "DiffDialog",
        "ModelPicker",
        "Select",
        "Plugin"
      ]
    },
    "keystrokePattern": {
      "description": "Keystroke pattern such as \"ctrl+k\", \"shift+tab\", or chord \"ctrl+k ctrl+s\"",
      "type": "string"
    },
    "bindingValue": {
      "description": "Action to trigger, command to invoke, or null to unbind a default shortcut",
      "anyOf": [
        {
          "$ref": "#/$defs/builtinAction"
        },
        {
          "$ref": "#/$defs/commandBinding"
        },
        {
          "description": "Set to null to unbind a default shortcut",
          "type": "null"
        }
      ]
    },
    "builtinAction": {
      "description": "Built-in action identifier.\nhttps://code.claude.com/docs/en/keybindings",
      "type": "string",
      "enum": [
        "app:interrupt",
        "app:exit",
        "app:toggleTodos",
        "app:toggleTranscript",
        "app:toggleTeammatePreview",
        "history:search",
        "history:previous",
        "history:next",
        "chat:cancel",
        "chat:cycleMode",
        "chat:modelPicker",
        "chat:thinkingToggle",
        "chat:submit",
        "chat:undo",
        "chat:externalEditor",
        "chat:stash",
        "chat:imagePaste",
        "autocomplete:accept",
        "autocomplete:dismiss",
        "autocomplete:previous",
        "autocomplete:next",
        "confirm:yes",
        "confirm:no",
        "confirm:previous",
        "confirm:next",
        "confirm:nextField",
        "confirm:previousField",
        "confirm:cycleMode",
        "confirm:toggleExplanation",
        "tabs:next",
        "tabs:previous",
        "transcript:toggleShowAll",
        "transcript:exit",
        "historySearch:next",
        "historySearch:accept",
        "historySearch:cancel",
        "historySearch:execute",
        "task:background",
        "theme:toggleSyntaxHighlighting",
        "help:dismiss",
        "attachments:next",
        "attachments:previous",
        "attachments:remove",
        "attachments:exit",
        "footer:next",
        "footer:previous",
        "footer:openSelected",
        "footer:clearSelection",
        "messageSelector:up",
        "messageSelector:down",
        "messageSelector:top",
        "messageSelector:bottom",
        "messageSelector:select",
        "diff:dismiss",
        "diff:previousSource",
        "diff:nextSource",
        "diff:back",
        "diff:viewDetails",
        "diff:previousFile",
        "diff:nextFile",
        "modelPicker:decreaseEffort",
        "modelPicker:increaseEffort",
        "select:next",
        "select:previous",
        "select:accept",
        "select:cancel",
        "plugin:toggle",
        "plugin:install",
        "permission:toggleDebug",
        "settings:search",
        "settings:retry"
      ]
    },
    "commandBinding": {
      "description": "Command binding that executes a slash command as if typed (e.g., \"command:commit\", \"command:help\")",
      "type": "string",
      "pattern": "^command:[a-zA-Z0-9:\\-_]+$"
    }
  },
  "description": "Keyboard shortcut configuration for Claude Code.\nhttps://code.claude.com/docs/en/keybindings",
  "title": "Claude Code Keybindings",
  "type": "object",
  "properties": {
    "$schema": {
      "description": "JSON Schema URL for editor validation",
      "type": "string"
    },
    "$docs": {
      "description": "Documentation URL",
      "type": "string"
    },
    "bindings": {
      "description": "Array of keybinding blocks, each scoping bindings to a UI context",
      "type": "array",
      "items": {
        "$ref": "#/$defs/keybindingBlock"
      }
    }
  },
  "required": ["bindings"],
  "additionalProperties": false
}
