← Files TokenXARCHIVED FILE

hooks/hooks.json

1.51 KB · Oct 2, 2026 · 00:29 UTC

↓ Download file

{
  "description": "Cost-aware native Codex agent routing.",
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|resume|clear|compact",
        "hooks": [
          {
            "type": "command",
            "command": "node \"${PLUGIN_ROOT}/scripts/session-start.mjs\"",
            "commandWindows": "node \"%PLUGIN_ROOT%\\scripts\\session-start.mjs\"",
            "timeout": 5,
            "additionalContextLimit": 512
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "node \"${PLUGIN_ROOT}/scripts/user-prompt-submit.mjs\"",
            "commandWindows": "node \"%PLUGIN_ROOT%\\scripts\\user-prompt-submit.mjs\"",
            "timeout": 30,
            "additionalContextLimit": 512
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "^(?:Agent|spawn_agent)$",
        "hooks": [
          {
            "type": "command",
            "command": "node \"${PLUGIN_ROOT}/scripts/agent-guard.mjs\"",
            "commandWindows": "node \"%PLUGIN_ROOT%\\scripts\\agent-guard.mjs\"",
            "timeout": 5
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "other",
        "hooks": [
          {
            "type": "command",
            "command": "node \"${PLUGIN_ROOT}/scripts/session-end.mjs\"",
            "commandWindows": "node \"%PLUGIN_ROOT%\\scripts\\session-end.mjs\"",
            "timeout": 3
          }
        ]
      }
    ]
  }
}

SHA-256: eafff60b710f64f67bb450576549d9f837a90054694d3d742e12d0eaf00246d7