Learning resourcesReviewed · Cline

Cline SDK Events

Cline SDK Events is a guide for developers adding live updates and monitoring to Cline AI agents, but it assumes an existing agent or session setup. It explains runtime and session subscriptions, streaming interface updates, token counters and state snapshots.

Researched 23 Nov 2026

In short.

Cline SDK Events is a guide for developers connecting Cline AI agents to live interfaces and monitoring, but it assumes existing SDK objects and leaves complete event definitions to a separate reference. Its central distinction is between AgentRuntimeEvent subscriptions on an agent and host-facing or session events associated with ClineCore. The examples cover text and tool updates, completion notifications, token counts and snapshots. Installation, version compatibility, pricing and cancellation implementation are not established, and no code was executed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete selected page at https://docs.cline.bot/sdk/events.md, including its examples, event-category table, documentation-index notice and Mintlify footer. The linked documentation index, event reference, multi-agent repository example and Mintlify site are excluded. SDK implementation, linked files, runtime behavior, compatibility, performance and billing were not tested or independently verified.

The overview

Resource identity

This is the Events page in Cline's SDK documentation at [https://docs.cline.bot/sdk/events.md]. It teaches event handling for @cline/agents and @cline/core. The resource is a documentation guide, not a downloadable SDK package or standalone application.

Practical assessment

The guide is useful when an application already creates Cline agents or sessions and needs to display their progress. Its strongest contribution is distinguishing the event surfaces and showing small integration patterns. It does not provide enough setup or event-schema detail to serve as a complete first integration tutorial.

Who it helps

The examples suit developers building agent interfaces, logs or monitoring. Beginners should understand callbacks and asynchronous operations: a subscription registers a function that receives notifications as work progresses. Experienced developers can use the page to identify the appropriate event surface, then consult definitions matching their installed SDK version.

What it covers

Runtime examples handle assistant text fragments, tool starts, tool finishes, run completion and usage updates. The host-facing event table also identifies content, iteration, usage, notice, completion and error categories. Session subscriptions can filter by sessionId, while snapshot() provides current status, iteration and usage values.

Using it

Prerequisites

The page presents TypeScript examples and assumes configured agent or cline objects. It identifies @cline/agents and @cline/core but supplies no installation commands, imports, package versions or initialization code. Although it describes the low-level runtime as browser-compatible, supported browser and server runtime versions are unknown.

How event delivery works

For direct Agent use, agent.subscribe(listener) delivers AgentRuntimeEvent values from the low-level runtime. AgentEvent is the host-facing shape used by @cline/core orchestration, and cline.subscribe(listener) receives session-level events. These surfaces use different event names and should be handled according to their own definitions.

The listener examines event.type and reads the corresponding payload. Subscriptions return an unsubscribe function. A snapshot is a separate request for current state, useful when an application needs a state value at a particular moment.

Integration pattern

With an existing agent, register a listener before calling agent.run(), retain the returned unsubscribe function and call it after the operation. The session example follows the same sequence around cline.start(). To receive events for one session, pass { sessionId } as the second argument to cline.subscribe(). Initialization and cleanup following a thrown error are not demonstrated.

Streaming interface example

The streaming example forwards assistant-text-delta text to an application callback, reports the tool name on tool-started and tool-finished, and forwards the result status on run-finished. The application must supply the onUpdate callback and interface behavior. A linked multi-agent example is described as streaming events to browser cards through server-sent events, but its implementation was not assessed.

Assessment & evidence

Limits and missing details

Complete event shapes are delegated to a linked reference. Event ordering, delivery guarantees, listener error behavior and performance under frequent updates are not specified. The introduction mentions cancellation, but the examples show no cancellation method. Calling unsubscribe is shown as subscription cleanup; the page does not establish that it stops agent execution.

Why the distinctions matter

An integration should choose its event surface according to the object it controls. The runtime example uses names such as assistant-text-delta and run-finished, while host-facing categories include content_update and done. This difference means handlers cannot be assumed interchangeable. The documentation supports that architectural distinction; successful integration and runtime reliability remain unverified.

Choices within the documented API

Use agent subscriptions for direct runtime activity, session subscriptions for session-level notifications, and snapshot() when current state is sufficient. These are complementary access patterns described on the page. Other agent SDKs and monitoring products are not compared, so their relative suitability is not assessed.

Evidence and provenance

The source is the complete documentation page at [https://docs.cline.bot/sdk/events.md], captured as selected-page.txt with source revision sha256:b7447d32faf579123e11b6fdcd8be6e25e717f4b0728b0e6ca16e74adfac5776. Its examples establish documented usage patterns. No code was executed, and linked documentation and repository contents were not assessed.

Access & freshness

Costs and usage accounting

SDK pricing, model-provider charges and operating costs are unknown. The runtime usage example assigns inputTokens + outputTokens to totalTokens whenever usage-updated arrives. It shows no currency calculation and does not establish whether those counters are cumulative. The host-facing usage category is described as supporting token and cost tracking, without a billing formula.

Licensing and reuse

The page states no licence or reuse terms for its prose, examples or SDK packages, so redistribution permissions are unknown. Its Mintlify footer identifies the documentation platform and does not establish licensing rights.

Dates and compatibility

The page was captured on 2026-11-23 at 18:31:48.765 UTC. It supplies no publication date, update date or SDK release number. The capture date establishes when this text was obtained; compatibility with a particular installed release remains unknown.

Before integrating

Identify whether your application uses a direct Agent or ClineCore sessions, then confirm the relevant event definitions against your installed packages. Supply the interface callbacks, arrange subscription cleanup on success and failure, and verify completion and error handling in your application. Confirm usage-counter semantics before calculating totals, and find the documented cancellation method if stopping work is required.

Evidence for this report

selected-page.txtselected · checked 2026-11-23