{
  "description": "pi-loom Codex CLI hook integration",
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|resume",
        "hooks": [
          {
            "type": "command",
            "command": "_P=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; if command -v pi-loom-codex-hook >/dev/null 2>&1; then pi-loom-codex-hook SessionStart; elif [ -n \"$_P\" ] && [ -f \"$_P/../dist/codex-hook.js\" ]; then node \"$_P/../dist/codex-hook.js\" SessionStart; else node ./dist/codex-hook.js SessionStart; fi",
            "timeout": 10,
            "statusMessage": "Loading pi-loom context"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": ".*",
        "hooks": [
          {
            "type": "command",
            "command": "_P=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; if command -v pi-loom-codex-hook >/dev/null 2>&1; then pi-loom-codex-hook PostToolUse; elif [ -n \"$_P\" ] && [ -f \"$_P/../dist/codex-hook.js\" ]; then node \"$_P/../dist/codex-hook.js\" PostToolUse; else node ./dist/codex-hook.js PostToolUse; fi",
            "timeout": 10
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "_P=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; if command -v pi-loom-codex-hook >/dev/null 2>&1; then pi-loom-codex-hook Stop; elif [ -n \"$_P\" ] && [ -f \"$_P/../dist/codex-hook.js\" ]; then node \"$_P/../dist/codex-hook.js\" Stop; else node ./dist/codex-hook.js Stop; fi",
            "timeout": 10
          }
        ]
      }
    ]
  }
}
