Layered Architecture for Portable, Durable Agents
Cline rebuilt its agent harness into @cline/sdk, a TypeScript stack with strict downward dependencies for reusability across environments like VS Code, JetBrains, CLI, and browsers. Bottom layer @cline/shared provides types, schemas, and utilities. @cline/llms handles providers (Anthropic, OpenAI, Google, AWS Bedrock, Mistral, LiteLLM, OpenAI-compatibles like vLLM) via config swaps, keeping logic out of the loop. @cline/agents delivers a stateless, browser-compatible execution loop for iteration, tools, and events—excluding session storage or Node tools for embeddability. Top @cline/core adds Node runtime for sessions, storage, built-ins (file/shell), plugins, telemetry, scheduling, and transports. Install full sdk via npm install @cline/sdk or subsets like @cline/agents for serverless. Result: sessions persist across UI restarts and surfaces, with faster CLI tasks at lower token costs.
Benchmark Wins from Refined Prompts and Loop
Cline 2.0 rewrote prompts, simplified loops, tightened context, improved error handling and tool surfacing. Terminal Benchmark 2.0 (tbench.ai) pass@1 scores: Cline CLI hits 74.2% on claude-opus-4.7 (beats Anthropic Claude Code's 69.4%), 71.9% on claude-opus-4.6 (vs. 65.4%), and 55.1% on kimi-k2.6 (tops OpenCode's 37.1% and Pi-Code's 45.5%). Use via new Agent({providerId: "anthropic", modelId: "claude-sonnet-4-6", apiKey: process.env.ANTHROPIC_API_KEY}) then agent.run(prompt) with subscribe, continue(), abort(), restore(), snapshot() for control.
Native Extensibility Without Extra Layers
Plugins register tools, events, rules via local .ts/.js or cline.plugins manifests—prototype then package. Implement ApiHandler for custom providers via @cline/llms registerProvider/registerModel. Built-in multi-agent teams delegate to subagents with isolated models/tools/prompts; no orchestration layer needed. Natively supports CRON, checkpointing, web search, MCP. CLI examples: cline connect for Telegram/Slack, cline -y --json "Run tests" for CI, pipe git diff | cline "Review". Examples in github sdk/examples/plugins and sdk/apps/examples; docs at docs.cline.bot/sdk. Apache 2.0, Node 22+.