Learning resourcesReviewed · Cline

Cline SDK Plugins Overview

Cline's Plugins Overview is a guide for developers extending Cline AI agents, but its crash isolation does not make untrusted plugins safe. It explains reusable AgentPlugin modules, lifecycle hooks, session configuration and failure reporting.

Researched 13 Nov 2026

In short.

Cline's Plugins Overview is a guide for developers adding reusable capabilities to Cline AI agents, but plugin workers are not a security boundary. It documents registration, session policies, lifecycle hooks, runtime packaging and error handling. Important integration details include hook errors being ignored by default, plugin policies applying only in worker mode, and edited code taking effect in new sessions. Compatible package versions, costs and licensing are unspecified, and actual runtime behavior has not been assessed.

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

Coverage is limited to the complete captured page at [https://docs.cline.bot/sdk/plugins.md], including its code snippets, tables, runtime and error caveats, outgoing references and Mintlify hosting notice. The documentation index, installation guide, writing tutorial, example pages and linked repository files are excluded. No plugin package or linked license file is included. No code was executed; runtime behavior, security, performance and compatibility remain untested.

The overview

Identity

This is the Cline SDK documentation page titled Plugins Overview at [https://docs.cline.bot/sdk/plugins.md]. It explains the SDK's plugin extension interface and operational behavior; it does not supply a complete plugin package.

A plugin is represented by an AgentPlugin object. The page describes packaging tools, lifecycle hooks, commands, rules, events and other extension capabilities into reusable modules.

Assessment

The guide is useful for deciding how to structure a Cline extension and what its host must support. Its strongest material covers operational details: session isolation, plugin failures, timeouts, cleanup, status reporting and reload behavior.

Its examples omit model/runtime configuration and complete tool implementations. A working integration therefore needs additional implementation and version-specific information. Developers relying on hooks for enforcement should pay particular attention to the default behavior that lets a run continue after a hook error.

Users

The main audience is developers extending Cline agents, teams sharing integrations across projects, and maintainers embedding Cline Core into another host. Documented use cases include database tools, API actions, lifecycle metrics, approval controls and external event triggers.

Beginners can use the glossary to distinguish tools, commands, hooks, rules and events. Implementing the examples requires familiarity with TypeScript or JavaScript, asynchronous functions and session configuration; the page does not teach those prerequisites.

Capabilities

Plugins can register model-callable tools, user-triggered slash commands, persistent guidance and external events. They can also package providers and message builders. The page describes sharing plugins through npm or git and installation through the CLI from file URLs, npm, git or local paths.

The seven documented hooks are beforeRun, afterRun, beforeModel, afterModel, beforeTool, afterTool and onEvent. Depending on the hook, handlers can add context, alter model requests, stop a run, block a tool call, require approval, replace tool input or replace tool output.

In worker mode, a session can enable named plugins while disabling others, and plugin tools remain subject to toolPolicies. Status interfaces expose failures and identify plugins unavailable to a session.

Using it

Requirements

The examples use AgentPlugin from @cline/sdk and start sessions through ClineCore. An integration needs the model/runtime configuration omitted from the snippets. The page does not specify supported package versions, operating systems or minimum hardware.

Both documented execution modes require Core's complete plugin runtime. A host bundling @cline/core must ship dist/plugin-runtime beside its bundle or set CLINE_PLUGIN_RUNTIME_DIR to that directory. Missing bootstrap support produces PluginBootstrapMissingError.

Default workers use the host runtime without starting a separate node or bun process. The optional sandbox mode uses a subprocess and may require node or bun on PATH, depending on the host; compiled CLI binaries use their embedded Bun runtime.

Mechanism

By default, each plugin runs in its own worker thread for each session. Module state is not shared between sessions. Workers contain plugin failures, but share the host's memory limit, environment snapshot and native addons, so the documentation explicitly denies a security boundary.

Arguments and return values cross a thread boundary and must be plain data; functions are dropped. Relative paths resolve against the host's directory even though process.cwd() reports the session directory, so the page directs plugin authors to use ctx.cwd.

Plugins are fixed when a session starts. New sessions import them afresh, while existing sessions retain their original code. Successful reloads do not replace running copies; an import failure during reload can disable the plugin for running sessions too.

The opt-in sandbox mode uses a per-session subprocess. It loads every discovered plugin and does not apply the per-session plugin policy or report plugin status.

Setup

The illustrated AgentPlugin object has a name, a capability manifest, setup(api, ctx) and a hooks object. Registration happens through methods such as api.registerTool(). Lifecycle handlers belong inside hooks.

A session can receive plugin objects through config.extensions or module paths through config.pluginPaths. Plugin files export an AgentPlugin. A separate plugins policy on the start call controls which plugins a worker-mode session enables.

Setup context includes the session directory, workspace metadata, event emission and disposal callbacks. Authors should register cleanup with ctx.onDispose for timers, child processes, sockets and shared listeners. Plugin logging should use ctx.logger because console and stdout output are discarded.

Example

The page illustrates a session that disables plugins by default using "*": { "enabled": false } and enables only "code-review": { "enabled": true }. This provides a concrete pattern for limiting the extensions available to one worker-mode session.

Within an enabled plugin, a beforeTool handler can return { "skip": true, "reason": "Approval required" } to block a call, or { "policy": { "autoApprove": false } } to require approval. The page does not implement the code-review plugin or supply complete model/runtime settings, and no execution result is available.

Assessment & evidence

Limitations

Hook failures have a three-second timeout. Under the default hookErrorMode of "ignore", an error or timeout is recorded and the run continues as though the hook returned nothing. The "throw" setting makes that error fail the run. This distinction matters when a hook is expected to enforce a restriction.

Import and setup normally have four-second limits. Tools normally have 60 seconds unless their timeoutMs changes it; commands, rule content and message builders have 60-second limits. The import timeout also has an environment-variable override.

Setup failure discards that session's plugin registrations, and subsequent sessions try again. Import failure or five consecutive failed calls disables the plugin across sessions using it until reload or a source change. A disabled enforcement plugin therefore needs explicit attention.

The page supplies no benchmarks, supported-version matrix or independent security results. Performance, deployment compatibility and actual failure behavior remain unassessed.

Reasoning

A plugin is a plausible fit when several related capabilities need to travel together across Cline agents or projects. That conclusion follows from the documented packaging interface and session-level registration model.

Operational fit depends on the intended responsibility. Logging and metrics may tolerate continued execution after a hook error; approval enforcement may require the documented "throw" behavior and monitoring for unavailable plugins. Worker isolation should not be used as a reason to trust unfamiliar plugin code.

Reload behavior also affects development and deployment: editing a file does not update active sessions. A rollout needs to account for which sessions still hold older code.

Alternatives

The page distinguishes extension points by purpose: a Tool exposes an action to the model, a Command exposes a manually triggered slash action, a Hook handles lifecycle logic, a Rule supplies recurring guidance, and an Event triggers agent activity from outside the session. These distinctions help determine what a plugin needs to contain.

For loading, the documented choices are an extension object or a plugin module path. For execution, worker mode provides session plugin policies and status, while optional sandbox mode uses subprocesses with different runtime requirements and limitations.

The captured page offers no comparison with competing SDKs or plugin systems, so comparative performance, portability and ease of use are unknown.

Evidence

The evidence is the complete captured page at [https://docs.cline.bot/sdk/plugins.md], retained as selected-page.txt. It includes explanatory prose, interface tables and illustrative TypeScript snippets. These support documentation-based conclusions about the intended API and behavior, without execution evidence.

The source revision is sha256:a0da36ee5f2c63ea46cffdefe4b6c612d2e07414231ba84af225173d16c7dc8a. The supplied content checksum is f3d5dcfbc25e1c8e16d266ba10437c32c77e475e65e233acf6d616f78444c9b3.

Links to installation instructions, a writing tutorial, repository examples and other documentation are references only. Their contents provide no additional evidence here.

Access & freshness

Costs

The page gives no SDK or plugin pricing, subscription requirements, model-provider rates or operating-cost estimates. Total cost is unknown.

A budget would need separate information about the chosen host, model provider and any services called by the plugin. The documentation does not establish whether any particular integration is free or paid.

Rights

The captured page contains no explicit license or redistribution grant for its text, code snippets, SDK packages or linked examples. Its references to npm and git explain distribution methods without establishing reuse rights.

Permission to copy, modify or redistribute those materials remains unknown from this page. Relevant documentation and package licenses would need to be established separately.

Freshness

The page was captured on 2026-11-13 at 05:09:31.637 UTC. That timestamp identifies the available snapshot, not its publication date or last substantive update.

No SDK release number, package version or dated compatibility statement appears in the captured text. Whether its APIs and defaults match a particular installed release is unknown.

Actions

Before implementing a plugin, establish the target SDK/Core versions, required host runtime files and the smallest extension capability needed. Choose worker mode when session-specific plugin policies or status reporting are required.

For approval or blocking hooks, set the intended hookErrorMode explicitly and evaluate hook errors, timeouts and plugin-disable behavior. Inspect StartSessionResult.pluginIssues and subsequent status notices; hub clients can also use plugins.status and plugin.status_changed events.

Verify cleanup and new-session loading behavior before deployment, and use trusted plugin code. Establish license terms and costs separately. These are recommended evaluation steps; no tests or runtime results are available.

Evidence for this report

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