Skip to content

Events and Traces

Everything Omnodex captures is a trace event. Detection, the dashboards, and reports are all built on the event stream.

Every event has:

FieldDescription
event_idUnique identifier for this event
session_idThe agent session that produced it
occurred_atWhen it happened (ISO 8601)
interceptorWhat captured it, for example claude-code-hook, codex-hook, or mcp-proxy
event_typeWhat kind of event it is, for example tool.invoked

The remaining fields depend on the event type.

TypeDescription
session.startedAn agent session, or a proxy session, began
session.endedThe session ended
tool.invokedThe agent called a tool. Includes the tool name, owning server, and parameters
tool.completedThe tool call finished. Includes duration, status, and response size
file.readThe agent read files
file.writtenThe agent wrote a file
risk.detectedA detection rule matched

tool.invoked and tool.completed share a tool_call_id, so each call can be followed from start to finish. Tool output is never stored, only its size.

See the Event Schema for every field.

Events are grouped into sessions. A hook session covers one agent session, from start to finish. A proxy session covers one run of the MCP proxy, which a desktop app may keep open across several conversations.

Sessions give analysis context: a tool call that looks suspicious in isolation can be normal for what the agent was asked to do.

Events are stored as JSON Lines (one JSON object per line), in one append-only file per session under event-log/sessions/ in the Omnodex home.

{"schema_version":1,"event_id":"a1b2c3d4-0000-4000-8000-000000000001","session_id":"sess-example","occurred_at":"2026-09-16T10:00:01Z","recorded_at":"2026-09-16T10:00:01Z","interceptor":"claude-code-hook","event_type":"tool.invoked","tool_call_id":"call-1","tool_name":"Read","mcp_server":"builtin","parameters":{"file_path":"/home/case/project/src/index.ts"}}

This format is:

  • Human-readable - inspect it with cat, grep, or jq
  • Append-only - new events are added to the end; existing lines are not rewritten
  • Streamable - the dashboard tails the files for real-time updates
  • Portable - plain JSON, readable by any tool

The SQLite database (traces.db) is built from these files and can be deleted and rebuilt with omnodex replay at any time.