Skip to content

Events

Kilo Code emits its activity as EventFormat::Kilo. It is run with kilo run --format json, which writes a line-delimited JSON stream on standard output: each non-empty line is one complete JSON object carrying a top-level type. Kilo Code is built on the same OpenCode-style step stream as OpenCode, so it shares that stream’s shape; the harness layer parses it and maps it onto the normalized harness events. The session id is captured from a sessionID, session_id, or sessionId field.

Each line is handled by its top-level type:

Kilo eventHandling
step_start, step_finishStep boundaries, consumed. step_finish carries the usage totals used for metrics. No event.
reasoningModel thinking. Becomes a reasoning event when it carries text, otherwise consumed.
textThe assistant’s plain text becomes an agent message. An empty text emits no event.
tool_useA self-contained tool call, classified in place (see Tool mapping).
errorBecomes an error event.

A tool_use event is self-contained — it carries the tool name, input, and a terminal status in one event, so no request/response correlation is needed — and its status sets the success field.

Raw eventNormalized event
step_start, step_finishnone (consumed)
reasoningreasoning message when it carries text, otherwise none
textagent message
tool_usethe event its tool classifies to (see Tool mapping)
errorerror
any other typeunknown

A line that fails to parse as JSON, any unrecognized event type, and a tool_use whose tool is not recognized all become unknown events so the stream stays lossless.

Kilo Code extends the OpenCode tool set with workflow and semantic-search tools; tool names are matched case-insensitively:

Kilo toolEvent
task, agent_managerorchestration when the spawned agent/session is identified, otherwise unknown
codesearchsearch
todowrite, todoreadconsumed — internal task list, no event
readread
write, editwrite
apply_patchone write per file named by the patch markers
grep, globsearch
bashcommand, or a recognized file operation
skillskill
lspsearch when it carries a query/symbol, otherwise unknown
any other toolunknown

A task or agent_manager call only becomes an orchestration event when the spawned agent or session can be identified from the input; otherwise it falls through to an unknown event rather than guessing. Any other tool delegates to the OpenCode tool mapping.


For the normalized event types these map onto, see Harness Events.