Events

Every event type and its fields.

The concepts, ordering and replay rules are on Normalized events. This page lists the shapes.

CoreEvent

type CoreEvent =
  | { type: "session.created"; sessionId: string; record: SessionRecord }
  | { type: "session.resumed"; sessionId: string; record: SessionRecord }
  | { type: "session.stateChanged"; sessionId: string; state: SessionState }
  | { type: "session.update"; sessionId: string; update: AgentUpdate }        // raw, in the agent's protocol
  | { type: "session.event"; sessionId: string; event: EventEnvelope & NormalizedBody }
  | { type: "session.failed"; sessionId: string; error: Error }
  | { type: "message.accepted" | "message.started"; sessionId: string; messageId: string }
  | { type: "message.completed"; sessionId: string; messageId: string; result: Completion }
  | { type: "account.switched"; sessionId: string; from: string; to: string; reason: "manual" | "limit" | "unavailable" }
  | { type: "account.refreshed"; sessionId: string; account: string }
  | { type: "account.exhausted"; sessionId: string; agent: string; account: string; reason: "limit" | "unavailable" }
  | { type: "account.unavailable"; sessionId: string; agent: string; account: string; reason: string }
  | { type: "account.available"; sessionId: string; agent: string; account: string }
  | { type: "context.degraded"; sessionId: string; dropped: ContextDrop[] }
  | { type: "context.updated"; sessionId: string; applied: Array<ContextApplied | ToolChangeApplied> }
  | { type: "tool.called"; sessionId: string; server: string; tool: string; callId: string }
  | { type: "tool.finished"; sessionId: string; server: string; tool: string; callId: string; ok: boolean; durationMs: number }

The envelope

type EventEnvelope = {
  sessionId: string
  agent: string
  seq: number                     // per Session object
  ts: string
  turnId?: string                 // "turn:1", "turn:2", …
  origin: "live" | "replay"
  native: { protocol: "codex-app-server" | "claude-stream-json" | "antigravity-stream-json" | "acp" | "core"; method?: string; payload: unknown }
  subagentId?: string             // on any body that comes from a subagent
}

Bodies

kindFields
turn-startnone
turn-completereason: "ok" | "interrupt"
assistant-deltamessageId, text
assistant-messagemessageId, text
reasoning-deltareasoningId, text
reasoningreasoningId, text?, redacted, summary?
tool-callcallId, tool, title?, phase: "started" | "updated" | "completed" | "failed", category?, locations?: { path }[], input?, output?, exitCode?, description?
command-outputcallId, stream: "stdout" | "stderr" | "merged", delta
file-diffcallId?, path, diff, changeKind?
web-searchcallId, phase: "started" | "completed" | "failed", query?, results?
mcp-toolcallId, server, tool, phase: "started" | "progress" | "completed" | "failed", arguments?, result?
planentries: { content, status: "pending" | "in_progress" | "completed", priority? }[], explanation?
tasktaskId, taskKind: "shell" | "agent" | "workflow" | "monitor" | "subagent" | "collab", phase, label?, parentCallId?
user-questionrequestId, blocking, questions: { id, prompt, header?, multiSelect, allowFreeText, options: { id, label, description? }[] }[]
permission-requestrequestId, toolCall: { callId, tool, title, input?, category? }, options: { id, kind, label }[], detail?: { command?, cwd?, blockedPath? }
request-resolvedrequestId, outcome: "answered" | "cancelled", answer?
permission-autotoolCall, optionId
permissions-updatespec, applied: "now" | "next-turn"
commands-updatecommands: { name, description? }[]
mode-updatemodeId?, model?
session-infotitle?, cwd?, model?
usagecontext?: { used, size }, tokens?: { input, output, total }, cost?: { amount, currency }, rateLimits?
compactioncompactionId, status: "in_progress" | "completed" | "failed" | "cancelled", summary?, error?
subagentsubagentId, phase: "started" | "progress" | "completed" | "failed" | "cancelled" | "resumed", name?, description?, prompt?, background?, activity?, stats?, result?, model?, messaging?, canMessage?, canStop? and more
warningmessage, source?
errormessage, errorType?, recoverable?

category is one of read, edit, delete, move, search, execute, fetch, mcp, web-search, think and other.

Next release

After 0.17.1, commands-update entries also carry argumentHint, aliases and builtin, and a new conversation-reset body (agentSessionId, previousAgentSessionId, trigger?) reports Claude Code's /clear.

On this page