← All Event Families
OpenEarth

foundation.protocols.ai.claude.hook.*

IAS gate enforcement decisions: what rules were evaluated, what was blocked or allowed, and subagent lifecycle tracking via Claude Code hooks.

5
Events
5
Timeline
0
State

Contents

Three-layer observation model. These events record the policy decision layer — what the IAS hooks decided. They complement ai.claude.* (self-report) and ai.gryph.* (system observation). Together, the three layers enable verifiable execution certification.

1. Rule Enforcement

Timeline Event

foundation.protocols.ai.claude.hook.rule.evaluated

A hook rule was checked against a tool call. Records the decision (allow or block) and the reason.

FieldTypeDescription
session_idstringParent session identifier
timestampstringISO 8601 UTC
rule_idstringRule identifier (e.g., "B-001")
gatestringGate reference (e.g., "G4")
tool_namestringClaude Code tool name
command_previewstringFirst 200 chars of tool input
decisionstringEnforcement outcome
Values: allow, block
reasonstringExplanation (when decision is "block")

2. Session Hooks

Timeline Event

foundation.protocols.ai.claude.hook.session.init

The SessionStart hook fired, recovering stale sessions and estimating costs for Gate 0.

FieldTypeDescription
session_idstringThis session's identifier
timestampstringISO 8601 UTC
stale_sessions_recoveredintUnclean sessions cleaned up
cost_estimate_usdstringEstimated cost for Gate 0 reads
Timeline Event

foundation.protocols.ai.claude.hook.session.close

The SessionEnd hook fired, finalizing cost periods and cleaning up orphaned agents.

FieldTypeDescription
session_idstringThis session's identifier
timestampstringISO 8601 UTC
periods_closedintCost periods finalized
total_cost_usdstringTotal estimated session cost
orphaned_agentsintSubagents that started but never completed

3. Agent Lifecycle

Subagent attribution. Claude Code includes agent_id and agent_type inline in every subagent tool call. Main-agent calls omit these fields. This enables direct attribution without bracketing — validated empirically 2026-04-14.
Timeline Event

foundation.protocols.ai.claude.hook.agent.started

A subagent was spawned via the Agent tool or SubagentStart hook.

FieldTypeDescription
session_idstringParent session identifier
timestampstringISO 8601 UTC
subagent_idstringSubagent identifier (from Claude Code agent_id)
agent_typestringSubagent type
Values: Explore, Plan, general-purpose, …
modelstringModel used by subagent
prompt_charsintCharacters in the subagent prompt
parent_idstringParent agent ID (empty for main agent's children)
Timeline Event

foundation.protocols.ai.claude.hook.agent.completed

A subagent completed its work.

FieldTypeDescription
session_idstringParent session identifier
timestampstringISO 8601 UTC
subagent_idstringSubagent identifier
agent_typestringSubagent type
result_charsintCharacters in the subagent result
duration_msintExecution time in milliseconds
est_cost_usdstringEstimated cost for this subagent