Skip to main content
COPILOT:S:0004 deterministic high structure copilot

Hook Handler Has Type

Each hook handler object in .github/hooks/*.json or VS Code hook config MUST contain a "type" field set to command. The VS Code Copilot hooks reference states each hook entry must have type: "command". Without a type field, Copilot cannot dispatch the handler and the hook silently does nothing.

Antipatterns

  • Missing type field. Defining a handler with only "command" but no "type" key.
  • Invalid type value. Setting "type": "prompt", "type": "shell", or "type": "script" — Copilot supports only command. (prompt is a Cursor-specific hook type and is not recognized by VS Code Copilot.)

Pass / Fail

Pass

{
  "hooks": {
    "SessionStart": [
      { "type": "command", "command": "echo hook" }
    ]
  }
}

Fail

{
  "hooks": {
    "SessionStart": [
      { "command": "echo hook" }
    ]
  }
}

Limitations

Checks that at least one handler has a valid type field. Does not verify every handler individually.