Skip to main content
CODEX:S:0004 deterministic high structure codex

Hook Handler Has Type

Each hook handler object in .codex/hooks.json MUST contain a "type" field set to command. Without a type field, Codex 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": "shell" or "type": "script" instead of command.

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.