{
  "version": 10,
  "owner": "cogitod",
  "description": "Canonical daemon hook lifecycle contract. Harness adapters project these events into Claude Code, Codex, and opencode; command adapters remain transport-only clients of daemon-owned /v1/hook behavior.",
  "events": [
    {
      "id": "orientation.brief",
      "hook": "brief",
      "mcp_tool": "agent_hook_brief",
      "status": "Loading memory context..."
    },
    {
      "id": "presence.capture",
      "hook": "capture",
      "mcp_tool": "agent_hook_capture",
      "status": "Marking session presence..."
    },
    {
      "id": "edit.mutex",
      "hook": "edit-mutex",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Checking edit mutex..."
    },
    {
      "id": "context.comprehension",
      "hook": "comprehension",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Loading comprehension context..."
    },
    {
      "id": "coord.claim",
      "hook": "coord-claim",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Claiming file lease..."
    },
    {
      "id": "collision.warn",
      "hook": "collision-warn",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Checking edit collisions..."
    },
    {
      "id": "commit.mutex",
      "hook": "commit-mutex",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Checking git index mutex..."
    },
    {
      "id": "read.cache",
      "hook": "read-cache",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Checking Breathe file cache..."
    },
    {
      "id": "subagent.start",
      "hook": "subagent-start",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Registering subagent..."
    },
    {
      "id": "edit.capture",
      "hook": "capture",
      "mcp_tool": "agent_hook_capture",
      "status": "Recording edit..."
    },
    {
      "id": "bash.commit",
      "hook": "bash-commit",
      "mcp_tool": "agent_hook_post_tool",
      "status": "Checkpointing commit..."
    },
    {
      "id": "read.store",
      "hook": "read-store",
      "mcp_tool": "agent_hook_post_tool",
      "status": "Caching file summary..."
    },
    {
      "id": "subagent.capture",
      "hook": "capture",
      "mcp_tool": "agent_hook_capture",
      "status": "Storing subagent result..."
    },
    {
      "id": "subagent.end",
      "hook": "subagent-end",
      "mcp_tool": "agent_hook_post_tool",
      "status": "Completing subagent..."
    },
    {
      "id": "signal.sense",
      "hook": "signal-sense",
      "mcp_tool": "agent_hook_post_tool",
      "status": "Sensing cross-agent signals..."
    },
    {
      "id": "compact.capture",
      "hook": "capture",
      "mcp_tool": "agent_hook_capture",
      "status": "Checkpointing before compaction..."
    },
    {
      "id": "task.capture",
      "hook": "capture",
      "mcp_tool": "agent_hook_capture",
      "status": "Recording task completion..."
    },
    {
      "id": "session.stop.capture",
      "hook": "capture",
      "mcp_tool": "agent_hook_session_stop",
      "status": "Capturing session..."
    },
    {
      "id": "inbox.drain",
      "hook": "inbox-drain",
      "mcp_tool": "agent_hook_session_stop",
      "status": "Draining direct messages..."
    },
    {
      "id": "pre-edit.warn",
      "hook": "pre-edit",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Checking edit context..."
    },
    {
      "id": "post-tool.capture",
      "hook": "post-tool",
      "mcp_tool": "agent_hook_post_tool",
      "status": "Recording bounded tool context..."
    },
    {
      "id": "security.breathe-boundary",
      "hook": "breathe-boundary",
      "mcp_tool": "agent_hook_pre_tool",
      "status": "Enforcing Breathe boundary..."
    },
    {
      "id": "worker.heartbeat",
      "hook": "worker-heartbeat",
      "mcp_tool": "agent_hook_post_tool",
      "status": "Renewing worker lease..."
    },
    {
      "id": "lifecycle.turn-start",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "turn_start",
      "status": "Preparing agent turn..."
    },
    {
      "id": "context.budget",
      "hook": "session-budget",
      "transport_only": true,
      "status": "Checking context budget..."
    },
    {
      "id": "lifecycle.pre-tool",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "pre_tool",
      "status": "Checking tool preflight..."
    },
    {
      "id": "lifecycle.post-tool",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "post_tool",
      "status": "Recording tool outcome..."
    },
    {
      "id": "lifecycle.compact",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "compact",
      "status": "Checkpointing before compaction..."
    },
    {
      "id": "lifecycle.task-complete",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "task_complete",
      "status": "Recording task completion..."
    },
    {
      "id": "lifecycle.turn-stop",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "capture",
      "status": "Capturing completed turn..."
    },
    {
      "id": "lifecycle.session-stop",
      "hook": "lifecycle",
      "mcp_tool": "agent_lifecycle_transition",
      "phase": "session_stop",
      "status": "Reconciling session lanes...",
      "lane_reconciliation": {
        "concurrency": "multiple-active-lanes-allowed",
        "ownership_scope": "current-harness-session-across-repositories",
        "leave_requires_cleanup": true,
        "clean_lanes": "land-if-ahead-then-clean",
        "unsafe_lanes": "preserve-report-and-block-leave",
        "foreign_lanes": "preserve",
        "orphan_lanes": "reap-if-empty-preserve-if-work",
        "quiescent_fleet": "zero-reapable-managed-lanes"
      }
    }
  ],
  "harness_capabilities": {
    "claude": {
      "transport": "mcp_tool",
      "support": [
        "UserPromptSubmit",
        "PreToolUse",
        "PostToolUse",
        "PreCompact",
        "TaskCompleted",
        "Stop",
        "SessionEnd"
      ],
      "lifecycle": {
        "startup": "UserPromptSubmit",
        "presence": "UserPromptSubmit",
        "pre_tool": "PreToolUse",
        "post_tool": "PostToolUse",
        "pre_compact": "PreCompact",
        "task_done": "TaskCompleted",
        "turn_stop": "Stop",
        "session_stop": "SessionEnd"
      },
      "synthesis": [],
      "events": [
        {
          "event_id": "lifecycle.turn-start",
          "event": "UserPromptSubmit",
          "matcher": "",
          "transport": "command"
        },
        {
          "event_id": "context.budget",
          "event": "UserPromptSubmit",
          "matcher": "",
          "transport": "command",
          "timeout": 5
        },
        {
          "event_id": "security.breathe-boundary",
          "event": "PreToolUse",
          "matcher": "*",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.pre-tool",
          "event": "PreToolUse",
          "matcher": "*",
          "mode": "warn",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.post-tool",
          "event": "PostToolUse",
          "matcher": "*",
          "transport": "command"
        },
        {
          "event_id": "worker.heartbeat",
          "event": "PostToolUse",
          "matcher": "*",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.compact",
          "event": "PreCompact",
          "matcher": "",
          "mode": "pre-compact",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.task-complete",
          "event": "TaskCompleted",
          "matcher": "",
          "mode": "task",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.turn-stop",
          "event": "Stop",
          "matcher": "",
          "mode": "stop",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.session-stop",
          "event": "SessionEnd",
          "matcher": "",
          "mode": "stop",
          "transport": "command",
          "async": true,
          "timeout": 310
        }      ]
    },
    "codex": {
      "transport": "command",
      "support": [
        "SessionStart",
        "UserPromptSubmit",
        "PreToolUse",
        "PostToolUse",
        "Stop",
        "SessionEnd"
      ],
      "lifecycle": {
        "startup": "UserPromptSubmit",
        "presence": "UserPromptSubmit",
        "pre_tool": "PreToolUse",
        "post_tool": "PostToolUse",
        "turn_stop": "Stop",
        "session_stop": "SessionEnd"
      },
      "synthesis": [
        "first-touch brief",
        "idle-reaper stop checkpoint"
      ],
      "events": [
        {
          "event_id": "lifecycle.turn-start",
          "event": "UserPromptSubmit",
          "matcher": ""
        },
        {
          "event_id": "security.breathe-boundary",
          "event": "PreToolUse",
          "matcher": "*",
          "transport": "command"
        },
        {
          "event_id": "lifecycle.pre-tool",
          "event": "PreToolUse",
          "matcher": "*",
          "mode": "warn"
        },
        {
          "event_id": "lifecycle.post-tool",
          "event": "PostToolUse",
          "matcher": "*"
        },
        {
          "event_id": "lifecycle.turn-stop",
          "event": "Stop",
          "matcher": "",
          "mode": "stop"
        },
        {
          "event_id": "lifecycle.session-stop",
          "event": "SessionEnd",
          "matcher": "",
          "mode": "stop"
        }
      ]
    },
    "opencode": {
      "transport": "plugin",
      "support": [
        "experimental.chat.system.transform",
        "chat.message",
        "tool.execute.before",
        "tool.execute.after",
        "event:file.edited",
        "session.idle",
        "session.deleted",
        "dispose"
      ],
      "lifecycle": {
        "startup": "experimental.chat.system.transform",
        "presence": "experimental.chat.system.transform",
        "pre_tool": "tool.execute.before",
        "post_tool": "tool.execute.after",
        "file_edit": "event:file.edited",
        "turn_stop": "event:session.idle",
        "session_stop": "dispose"
      },
      "synthesis": [
        "task/subagent lifecycle from tool matchers"
      ],
      "events": [
        {
          "event_id": "lifecycle.turn-start",
          "pluginEvent": "experimental.chat.system.transform"
        },
        {
          "event_id": "security.breathe-boundary",
          "pluginEvent": "tool.execute.before",
          "matcher": "*"
        },
        {
          "event_id": "lifecycle.pre-tool",
          "pluginEvent": "tool.execute.before",
          "matcher": "*"
        },
        {
          "event_id": "lifecycle.post-tool",
          "pluginEvent": "tool.execute.after",
          "matcher": "*"
        },
        {
          "event_id": "lifecycle.turn-stop",
          "pluginEvent": "event:session.idle",
          "mode": "stop"
        },
        {
          "event_id": "lifecycle.session-stop",
          "pluginEvent": "dispose",
          "mode": "stop"
        }
      ]
    }
  }
}
