Skip to main content
GEMINI:S:0001 deterministic high structure gemini

Hook Valid Event Types

Hook event keys in .gemini/settings.json MUST use recognized Gemini CLI event type names (11 events). Unrecognized event names are silently ignored, so a typo means the hook never fires.

Antipatterns

  • Camel-case typos. Writing event names with wrong capitalization. Gemini CLI silently ignores unrecognized keys.
  • Cross-agent event names. Using event names from another agent (e.g., Claude's PreToolUse instead of Gemini CLI's convention).
  • Deprecated event names. Using event names from older versions that have been renamed or removed.

Pass / Fail

Pass

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

Fail

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

Limitations

Checks that at least one recognized Gemini CLI event type is present. Does not detect misspelled event names if a valid one also exists.