Skip to main content
The SDK exposes two related event surfaces:
  • AgentRuntimeEvent from @cline/agents, delivered through agent.subscribe(listener).
  • AgentEvent / CoreSessionEvent from @cline/core, delivered through core session adapters and cline.subscribe(listener).
Use this page for event handling patterns. For event shapes, see Events reference.

AgentRuntime Events

AgentRuntimeEvent is the low-level event stream from the browser-compatible runtime.

Core / Host-Facing Agent Events

AgentEvent is the host-facing event shape used by @cline/core session orchestration. For direct Agent usage, prefer agent.subscribe(...) and AgentRuntimeEvent. Common host-facing event categories:

ClineCore Session Events

Use cline.subscribe() for session-level events:
Pass a sessionId filter when you only want one session:

Streaming UI Pattern

Subscribe to events to build real-time UIs:
For a complete working example of streaming agent events to a browser via SSE, see the multi-agent example. It spawns multiple agents in parallel and streams each agent’s events to separate UI cards.

Usage Tracking Pattern

Runtime State Snapshots

Call snapshot() when you need the current state: