Cline became ‘agentic’ before it was cool, but building on the bleeding edge usually leads to some structural debt. Over time, the agent loop and the VS Code extension became a package deal—making it a headache to maintain or move to new environments. Its tough to just keep layering features on a rigid core. Cline, the open-source AI coding agent used by millions of developers, shipped a significant architectural change this week: it extracted its internal agent harness into a standalone, open-source TypeScript SDK called @cline/sdk, and is rebuilding all of its own products on top of it.
Rather than adding another layer on top of that architecture, the Cline team chose to rebuild the foundation.
What the SDK is, and How It is Structured
The core agent harness has been abstracted into a pluggable agent SDK (@cline/sdk). It now powers Cline across VS Code, JetBrains, and the CLI, and is open-sourced so any team can build on it. A key behavioral benefit of this redesign: long-running work no longer dies with a UI restart, and sessions can move across surfaces — the agent loop stays stateless and reusable while the runtime around it becomes durable, portable, and product-agnostic.
The SDK is a layered TypeScript stack where each layer has a single responsibility and dependencies flow strictly downward.
From the bottom up:
@cline/shared is the foundation package carrying types, schemas, tool helpers, hook contracts, and extension registration utilities — no higher-layer dependencies. @cline/llms sits above it, owning the provider gateway and model catalogs. It covers Anthropic, OpenAI, Google, AWS Bedrock, Mistral, LiteLLM, and any OpenAI-compatible endpoint such as vLLM, Together, and Fireworks, with all provider logic kept out of the agent loop so switching providers is a config change, not a code change. @cline/agents runs above that as a browser-compatible, stateless agent execution loop handling iteration, tool orchestration, and event emission — importantly, it does not own session storage, built-in file/shell tools, or Node-specific orchestration, which is what makes it embeddable in browser environments. At the top sits @cline/core, the Node runtime/orchestration layer responsible for sessions, storage, built-in tools, hub and remote transports, automation and scheduling, telemetry, and plugin/extension loading.
@cline/sdk itself is a public surface that re-exports everything from @cline/core. For engineers who want a smaller footprint, the packages are individually installable: you can pull in just @cline/llms for an LLM proxy, or just @cline/agents for a stateless loop in a serverless or browser environment, without pulling in the full Node runtime stack.
The Cline team also reports that the new CLI completes the same tasks faster and at lower token cost than the old one in internal runs.
A Rebuilt Agent Harness With Measurable Benchmark Results
With Cline 2.0, the team rewrote the prompts, simplified the loop, tightened context management, improved feedback loops and error handling, and rethought how tools are defined and surfaced to the model.
The Cline team published Terminal Benchmark 2.0 (tbench.ai) results to back this up. On frontier models, Cline CLI running claude-opus-4.7 scored 74.2%, compared to Anthropic’s published score of 69.4% for Claude Code on the same model. On claude-opus-4.6, Cline CLI scored 71.9% versus Claude Code’s published 65.4%. On open-weight models, Cline scored 55.1% on kimi-k2.6, compared to 37.1% for OpenCode and 45.5% for Pi-Code on the same model, with those runs performed by the Cline team using pass@1 scoring as of May 8, 2026.
https://cline.bot/blog/introducing-cline-sdk-the-upgraded-agent-runtime
The Plugin System and Extensibility Layer
One of the practical additions for dev teams building on the SDK is the plugin architecture. A plugin can register tools, observe lifecycle events, add rules and commands, and shape what the agent sees. Plugins can be loaded from configured paths or workspace locations, and can start as a local .ts or .js module, later becoming a package directory with a cline.plugins manifest so teams can prototype locally and package reusable capabilities when they are ready.
Beyond plugins, the SDK provides additional extensibility points including custom tools, MCP connectors, and skills. To add a new custom provider, you implement an ApiHandler and register it using the @cline/llms registry — the architecture docs list registerProvider and registerModel as the correct exported functions for runtime registry extension.
Native Multi-Agent Support
A notable design decision is that multi-agent coordination does not require a separate orchestration layer. The SDK includes agent teams and subagents natively, so a session can delegate to specialists, track progress, and exchange handoff notes, all inside the same core runtime. Subagents run with their own model, tools, and prompts.
Scheduled CRON jobs, checkpointing, web search, and MCP connectors are all handled natively out of the box.
Getting Started
The SDK requires Node.js 22 or later.
Copy CodeCopiedUse a different Browser# Install the SDK
npm install @cline/sdk
# Install the CLI globally
npm i -g @cline
# Or give your agent the Cline SDK skill
npx skills add cline/sdk-skill
Documentation is available at docs.cline.bot/sdk. Working examples — including plugin examples and multi-app builds — are in the sdk/apps/examples and sdk/examples directories of the Cline GitHub repository. The release is licensed under Apache 2.0.
Marktechpost’s Visual Explainer
#csg * { box-sizing:border-box!important; margin:0!important; padding:0!important; word-break:break-word!important; overflow-wrap:break-word!important; }
#csg hr, #csg p:empty, #csg del, #csg s { display:none!important; }
#csg {
background:#111!important;
color:#d0d0d0!important;
font-family:’JetBrains Mono’,monospace!important;
border:1px solid #2a2a2a!important;
border-radius:10px!important;
overflow:hidden!important;
max-width:780px!important;
margin:1.5rem auto!important;
width:100%!important;
}
/* HEADER */
#csg .hd {
background:#0c0c0c!important;
border-bottom:1px solid #222!important;
padding:12px 22px!important;
display:flex!important;
align-items:center!important;
justify-content:space-between!important;
}
#csg .hd-badge {
font-size:10px!important;
font-weight:600!important;
letter-spacing:.1em!important;
text-transform:uppercase!important;
color:#000!important;
background:#76B900!important;
padding:3px 10px!important;
border-radius:3px!important;
}
#csg .hd-title {
font-size:11px!important;
color:#666!important;
letter-spacing:.04em!important;
}
/* VIEWPORT */
#csg .vp { overflow:hidden!important; width:100%!important; }
#csg .track {
display:flex!important;
width:100%!important;
transition:transform .4s cubic-bezier(.4,0,.2,1)!important;
}
#csg .slide {
min-width:100%!important;
width:100%!important;
padding:22px 26px 20px!important;
flex-shrink:0!important;
overflow:hidden!important;
}
/* SLIDE META */
#csg .meta {
display:flex!important;
align-items:center!important;
gap:12px!important;
margin-bottom:10px!important;
}
#csg .snum {
font-size:11px!important;
color:#76B900!important;
font-weight:600!important;
letter-spacing:.08em!important;
}
#csg .slbl {
font-size:10px!important;
color:#555!important;
letter-spacing:.1em!important;
text-transform:uppercase!important;
}
#csg .div {
height:1px!important;
background:#222!important;
margin-bottom:16px!important;
display:block!important;
}
/* HEADINGS */
#csg h2 {
font-family:’Fraunces’,serif!important;
font-size:22px!important;
font-weight:700!important;
color:#ffffff!important;
line-height:1.2!important;
margin-bottom:7px!important;
display:block!important;
}
#csg h2 em { color:#76B900!important; font-style:normal!important; }
#csg .sub {
font-size:12px!important;
color:#888!important;
line-height:1.55!important;
margin-bottom:16px!important;
display:block!important;
}
/* BODY */
#csg p {
font-size:12px!important;
color:#aaa!important;
line-height:1.7!important;
margin-bottom:14px!important;
display:block!important;
}
/* CODE */
#csg pre {
background:#0a0a0a!important;
border:1px solid #222!important;
border-left:2px solid #76B900!important;
border-radius:5px!important;
padding:13px 16px!important;
overflow-x:auto!important;
margin-bottom:14px!important;
display:block!important;
width:100%!important;
}
#csg code {
font-family:’JetBrains Mono’,monospace!important;
font-size:12px!important;
color:#d0d0d0!important;
background:transparent!important;
border:none!important;
line-height:1.7!important;
display:block!important;
white-space:pre!important;
}
#csg code.ic {
display:inline!important;
background:#1a1a1a!important;
border:1px solid #2a2a2a!important;
border-radius:3px!important;
padding:1px 6px!important;
font-size:11px!important;
color:#76B900!important;
white-space:normal!important;
}
#csg .kw { color:#76B900!important; }
#csg .str { color:#ce9178!important; }
#csg .cmt { color:#555!important; font-style:italic!important; }
#csg .fn { color:#dcdcaa!important; }
#csg .num { color:#b5cea8!important; }
#csg .vr { color:#9cdcfe!important; }
#csg .tp { color:#4ec9b0!important; }
/* STEPS */
#csg .steps { list-style:none!important; display:block!important; }
#csg .steps li {
display:flex!important;
gap:12px!important;
align-items:flex-start!important;
padding:11px 0!important;
border-bottom:1px solid #1c1c1c!important;
}
#csg .steps li:last-child { border-bottom:none!important; padding-bottom:0!important; }
#csg .sn {
min-width:24px!important;
height:24px!important;
background:#76B900!important;
color:#000!important;
border-radius:3px!important;
display:flex!important;
align-items:center!important;
justify-content:center!important;
font-size:10px!important;
font-weight:600!important;
flex-shrink:0!important;
margin-top:1px!important;
}
#csg .st {
font-size:12px!important;
font-weight:600!important;
color:#e0e0e0!important;
margin-bottom:4px!important;
display:block!important;
}
#csg .sd {
font-size:11px!important;
color:#888!important;
line-height:1.65!important;
display:block!important;
}
/* STACK */
#csg .stack { display:flex!important; flex-direction:column!important; gap:7px!important; }
#csg .layer {
background:#0d0d0d!important;
border:1px solid #222!important;
border-left:2px solid #76B900!important;
border-radius:5px!important;
padding:10px 15px!important;
display:flex!important;
gap:14px!important;
align-items:flex-start!important;
}
#csg .lpkg {
font-size:11px!important;
font-weight:600!important;
color:#76B900!important;
min-width:135px!important;
flex-shrink:0!important;
padding-top:1px!important;
}
#csg .ldsc {
font-size:11px!important;
color:#888!important;
line-height:1.6!important;
}
#csg .arr {
text-align:center!important;
color:#333!important;
font-size:13px!important;
display:block!important;
}
/* PILLS */
#csg .pills { display:flex!important; flex-wrap:wrap!important; gap:7px!important; margin-bottom:14px!important; }
#csg .pill {
display:inline-flex!important;
align-items:center!important;
gap:6px!important;
background:#161616!important;
border:1px solid #2a2a2a!important;
border-radius:3px!important;
padding:5px 10px!important;
font-size:11px!important;
color:#999!important;
}
#csg .pill::before { content:’2713′!important; color:#76B900!important; font-size:10px!important; }
/* PROVIDER GRID */
#csg .pgrid {
display:grid!important;
grid-template-columns:repeat(3,1fr)!important;
gap:7px!important;
margin-bottom:14px!important;
}
#csg .prov {
background:#0d0d0d!important;
border:1px solid #1e1e1e!important;
border-radius:4px!important;
padding:8px 10px!important;
font-size:11px!important;
color:#555!important;
text-align:center!important;
}
#csg .prov.on { border-color:#76B900!important; color:#76B900!important; }
/* NOTE */
#csg .note {
background:#0d0d0d!important;
border:1px solid #222!important;
border-left:2px solid #444!important;
border-radius:5px!important;
padding:10px 14px!important;
font-size:11px!important;
color:#888!important;
line-height:1.65!important;
display:block!important;
}
#csg .note b { color:#bbb!important; }
/* NAV */
#csg .nav {
background:#0c0c0c!important;
border-top:1px solid #222!important;
padding:12px 22px!important;
display:flex!important;
align-items:center!important;
justify-content:space-between!important;
}
#csg .dots { display:flex!important; gap:6px!important; align-items:center!important; }
#csg .dot {
width:6px!important;
height:6px!important;
border-radius:50%!important;
background:#2a2a2a!important;
cursor:pointer!important;
border:none!important;
transition:all .2s!important;
flex-shrink:0!important;
}
#csg .dot.on { background:#76B900!important; width:16px!important; border-radius:3px!important; }
#csg .nbtn {
background:transparent!important;
border:1px solid #2a2a2a!important;
border-radius:4px!important;
color:#888!important;
font-family:’JetBrains Mono’,monospace!important;
font-size:11px!important;
padding:6px 14px!important;
cursor:pointer!important;
transition:all .2s!important;
}
#csg .nbtn:hover { border-color:#76B900!important; color:#76B900!important; }
#csg .nbtn:disabled { opacity:.25!important; cursor:default!important; pointer-events:none!important; }
#csg .ncnt {
font-size:10px!important;
color:#444!important;
text-align:center!important;
margin-top:5px!important;
display:block!important;
}
/* MOBILE */
@media(max-width:640px){
#csg .slide { padding:18px 16px 16px!important; }
#csg h2 { font-size:19px!important; }
#csg .lpkg { min-width:110px!important; }
#csg .pgrid { grid-template-columns:repeat(2,1fr)!important; }
#csg .layer { flex-direction:column!important; gap:5px!important; }
#csg pre { overflow-x:auto!important; }
#csg code { font-size:11px!important; }
#csg .hd, #csg .nav { padding:10px 16px!important; }
#csg p, #csg .sub { font-size:11px!important; }
}
How-To Guide
Cline SDK — Getting Started
01 / 09Overview
What is the Cline SDK?
The same agent runtime powering Cline’s VS Code, JetBrains, and CLI — now open for anyone to build on.
@cline/sdk handles the full agent loop: LLM calls, tool orchestration, session persistence, multi-agent coordination, and scheduling. Instead of wiring all that up yourself, you import the SDK and focus on what your agent actually needs to do.
TypeScript
Apache 2.0
Node.js 22+
Browser-compatible loop
Multi-provider
Plugin-first
Who is this for? AI engineers, software engineers, and data scientists who want to build or embed coding agents without rebuilding the infrastructure from scratch.
02 / 09Prerequisites
Before You Install
Four things to check before running npm install.
01
Node.js 22 or later
Run node –version. If below v22, update via nvm: nvm install 22 && nvm use 22
02
npm or a compatible package manager
npm, yarn, pnpm, or bun all work. This guide uses npm.
03
An API key from at least one LLM provider
Anthropic, OpenAI, Google Gemini, AWS Bedrock, Mistral, or any OpenAI-compatible endpoint. Pass the key at runtime — never hardcode it.
04
A TypeScript project (recommended)
The SDK ships full TypeScript types. Plain JS works too, but you lose type safety on tool definitions and event payloads.
03 / 09Installation
Install the SDK
One package for the full stack. Individual packages for smaller surfaces.
# Full SDK — recommended starting point
npm install @cline/sdk
# CLI globally (terminal-first usage)
npm i -g @cline
# Add the SDK skill to your coding agent
npx skills add cline/sdk-skill
If you only need a subset, install individual packages directly:
# Browser-compatible stateless loop only
npm install @cline/agents @cline/shared @cline/llms
# Just the provider layer (LLM proxy use case)
npm install @cline/llms @cline/shared
SDK skill: npx skills add cline/sdk-skill gives Claude Code, Codex, or Cline full context on the SDK’s APIs so it can scaffold agents and wire up plugins for you.
04 / 09Architecture
The Layer Stack
Four packages. One responsibility each. Dependencies flow strictly downward.
@cline/core
Node runtime layer. Sessions, storage, built-in tools, hub & remote transports, automation, scheduling, telemetry, plugin loading. This is what @cline/sdk re-exports.
↓
@cline/agents
Browser-compatible, stateless agent execution loop. Handles iteration, tool orchestration, and event emission. No Node-specific dependencies.
↓
@cline/llms
Provider gateway and model catalogs. All provider logic lives here — not in the agent loop. Switching providers is a config change.
↓
@cline/shared
Foundation. Types, schemas, tool helpers, hook contracts, and extension contracts. No higher-layer dependencies.
05 / 09Your First Agent
Run Your First Agent
Import Agent, subscribe to events, call run().
import { Agent } from “@cline/sdk”
const agent = new Agent({
providerId: “anthropic”,
modelId: “claude-sonnet-4-6”,
apiKey: process.env.ANTHROPIC_API_KEY,
maxIterations: 10,
})
agent.subscribe((event) => {
if (event.type === “assistant-text-delta”)
process.stdout.write(event.text ?? “”)
})
const result = await agent.run(
“Write a Python fn to check if a number is prime.”
)
AgentRuntime methods: run() continue() abort() subscribe() restore() snapshot() — Agent is an alias for AgentRuntime.
06 / 09Providers
Switching Providers
Provider logic lives in @cline/llms, not in the agent loop. Switching is a one-line config change.
Anthropic
OpenAI
Google
AWS Bedrock
Mistral
LiteLLM
vLLM
Together
Fireworks
// Anthropic
{ providerId: “anthropic”, modelId: “claude-sonnet-4-6” }
// OpenAI
{ providerId: “openai”, modelId: “gpt-4o” }
// Any OpenAI-compatible endpoint
{ providerId: “openai”, baseUrl: “https://your-vllm/v1” }
Custom provider: Implement an ApiHandler and register it using registerProvider from @cline/llms. Add new models with registerModel.
07 / 09Plugins
Extending with Plugins
Add domain-specific behavior without forking the runtime.
A plugin can register tools, observe lifecycle events, add rules and commands, and shape what the agent sees. Start with a local .ts file; promote to a package with a cline.plugins manifest when ready.
import { AgentPlugin, createTool } from “@cline/sdk”
const myPlugin: AgentPlugin = {
name: “my-plugin”,
tools() {
return [createTool({
name: “fetch_docs”,
description: “Fetch internal API docs by slug”,
async run({ slug }) {
return fetchFromInternalDocs(slug)
},
})]
},
}
Also available: custom tools, MCP connectors, and skills as extensibility points. Working examples at sdk/examples/plugins/ on GitHub.
08 / 09Multi-Agent
Multi-Agent Teams
Subagents and team coordination are native to the runtime — no external orchestrator needed.
01
Define your specialist agents
Each subagent gets its own Agent instance with a dedicated model, tool set, and system prompt scoped to its task domain.
02
Use the bundled subagent plugin tools
Built-in tools for starting subagents, messaging them, reading status, and storing handoff notes between sessions.
03
No orchestration layer to build
Sub-agent primitives live in @cline/core. Sessions remain durable across surfaces — long-running work no longer dies with a UI restart.
Familiar with LangGraph or CrewAI? The primitives here are built into the runtime itself, not layered on top of it.
09 / 09Built-ins & Deploy
Built-ins & Deployment
What you get out of the box, and how to run agents in CI/CD or external platforms.
CRON scheduling
Checkpointing
Web search
MCP connectors
Session persistence
Telemetry hooks
# Connect agent to Telegram, WhatsApp, Slack
cline connect
# Headless CI: auto-approve + structured JSON output
cline -y –json “Run tests and fix any failures”
# Pipe git diff into the agent
git diff origin/main | cline “Review these changes”
Resources: Docs → docs.cline.bot/sdk · Examples → sdk/apps/examples/ · Discord → discord.gg/cline · License: Apache 2.0
← Prev
1 of 9
Next →
(function(){
var total=9,cur=0;
var track=document.getElementById(‘csg-track’);
var prev=document.getElementById(‘csg-prev’);
var next=document.getElementById(‘csg-next’);
var cnt=document.getElementById(‘csg-cnt’);
var dotsEl=document.getElementById(‘csg-dots’);
var dots=[];
for(var i=0;i0)go(cur-1);};
next.onclick=function(){if(cur40){if(d>0&&cur

