{
  "version": 1,
  "hooks": {
    "SessionStart": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "node ${PLUGIN_ROOT}/registry/scripts/install.js; epic resume"
          }
        ],
        "description": "Restore previous session context + load project memory and evolved skills"
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "EH=$(command -v epic 2>/dev/null); test -n \"$EH\" && \"$EH\" guard || echo '[harness] epic not found'"
          }
        ],
        "description": "Block dangerous commands (force push, prod DB drop, rm -rf /)"
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "EH=$(command -v epic 2>/dev/null); test -n \"$EH\" && \"$EH\" observe || echo '[harness] epic not found'"
          }
        ],
        "description": "Record Bash tool result for evolution loop (Codex PostToolUse only intercepts Bash)"
      },
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "EH=$(command -v epic 2>/dev/null); test -n \"$EH\" && \"$EH\" polish || echo '[harness] epic not found'"
          }
        ],
        "description": "Auto-format + typecheck after edits"
      },
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "EH=$(command -v epic 2>/dev/null); test -n \"$EH\" && \"$EH\" polish || echo '[harness] epic not found'"
          }
        ],
        "description": "Auto-format + typecheck after file writes"
      }
    ],
    "Stop": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "EH=$(command -v epic 2>/dev/null); test -n \"$EH\" && \"$EH\" reflect || echo '[harness] epic not found'"
          }
        ],
        "description": "Analyze session observations -> evolve skills -> gate mutations"
      }
    ]
  }
}
