Agent Events

February 18, 2026 ยท View on GitHub

Real-time visibility into what the agent is doing. Events stream to clients and persist in Redis for replay.

Event types

  • Tool events - when the agent uses tools (Read, Edit, Bash, etc.)
  • File changes - files created, modified, or deleted
  • Commands - shell command execution with output
  • Thinking - extended reasoning content (for supported models)
  • Connection events - agent connect/disconnect status

Tool Events

Tool events track the lifecycle of tool invocations.

TOOL_START

Emitted when the agent begins using a tool.

FieldTypeDescription
toolstringTool name (e.g., "Read", "Edit", "Bash")
tool_use_idstringUnique ID for this invocation
parent_tool_use_idstring?Set when tool runs inside a Task/subagent
inputobject?Full tool input (if available at start)

TOOL_INPUT

Emitted as tool input is streamed (for large inputs).

FieldTypeDescription
tool_use_idstringCorrelates to TOOL_START
input_deltastringPartial input chunk

TOOL_INPUT_COMPLETE

Emitted when tool input streaming finishes.

FieldTypeDescription
tool_use_idstringCorrelates to TOOL_START
inputobjectComplete tool input as JSON

TOOL_END

Emitted when tool execution completes.

FieldTypeDescription
toolstringTool name
tool_use_idstringCorrelates to TOOL_START
resultstring?Tool output (on success)
errorstring?Error message (on failure)
duration_msint64?Execution time in milliseconds

Example

TOOL_START     tool=Bash, id=abc123
TOOL_INPUT     id=abc123, delta="npm "
TOOL_INPUT     id=abc123, delta="install"
TOOL_INPUT_COMPLETE id=abc123, input={"command": "npm install"}
... (command runs) ...
TOOL_END       id=abc123, result="added 150 packages", duration_ms=4523

File Change Events

Emitted when the agent modifies files.

FieldTypeDescription
pathstringFile path relative to workspace
actionenumCREATE, EDIT, or DELETE
lines_addedint32?Lines added (for EDIT)
lines_removedint32?Lines removed (for EDIT)

Command Events

COMMAND_START

FieldTypeDescription
commandstringThe command being executed
cwdstring?Working directory

COMMAND_END

FieldTypeDescription
commandstringThe command that ran
exit_codeint32?Exit code (0 = success)
outputstring?Command output (may be truncated)

Thinking Events

Emitted when the model uses extended thinking (Claude Opus, etc.).

FieldTypeDescription
thinking_idstringUnique ID for this thinking block
contentstringThinking content (delta if partial)
partialbooltrue for streaming deltas, false for final

Thinking content streams in chunks. Accumulate content for the same thinking_id until partial=false.

Other Events

KindDescription
REPO_CLONERepository clone progress (STARTING/CLONING/DONE/ERROR)
PORT_EXPOSEDPort exposed for preview (port, preview_url)
PORT_UNEXPOSEDPort exposure removed (port)
AGENT_DISCONNECTEDAgent lost connection
AGENT_RECONNECTEDAgent reconnected

Nested Tool Calls

When the agent uses the Task tool to spawn a subagent, events include parent_tool_use_id:

TOOL_START     tool=Task, id=task_1
  TOOL_START   tool=Read, id=read_1, parent=task_1
  TOOL_END     tool=Read, id=read_1, parent=task_1
  TOOL_START   tool=Edit, id=edit_1, parent=task_1
  TOOL_END     tool=Edit, id=edit_1, parent=task_1
TOOL_END       tool=Task, id=task_1

Persistence

Events stored in Redis Stream: session:{id}:stream. Cursor-based reading handles reconnection without missing events.

CLI

netclode events <session-id>                    # List events
netclode events <session-id> --kind tool_start  # Filter by kind
netclode events tail <session-id>               # Stream in real-time
netclode events <session-id> --json             # JSON output

iOS App

Events appear in the activity feed with expandable tool input/output, file diffs, and collapsible thinking blocks.