Cline SDK
Guides building AI agents with the Cline SDK, covering runtime, tools, plugins, and teams.
Install
npx skills add cline/cline --skill cline-sdk -g -a claude-code -y- Repository
- cline/cline71.2k
- Category
- AI and agents
- Updated
- 3d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 2,112 tokens
- Runs scripts
- No, instructions only
What it does
Comprehensive Cline SDK skill for building AI agents. Covers the Agent runtime, ClineCore sessions, custom tools, plugins, events, LLM providers, scheduling, multi-agent teams, and production deployment. Use for any task involving @cline/sdk or its sub-packages.
Cline SDK Skill
Consolidated skill for building AI agents with the Cline SDK. Use the decision trees below to find the right entry point and API surface, then load detailed references.
Critical Rules
Follow these rules in all Cline SDK code:
- Install with
npm install @cline/sdk. The@cline/sdkpackage re-exports everything from@cline/core,@cline/agents,@cline/llms, and@cline/shared. - Requires Node.js 22 or later.
- Use
createTool()from@cline/sdk(or@cline/shared) to define tools. Tool names must besnake_case. - Return errors as structured data from tool
executefunctions. Throwing counts as a "mistake" against the agent's mistake limit. - Use
lifecycle: { completesRun: true }on tools that should end the agent loop (e.g. a "submit answer" tool). - When using
ClineCore, always calldispose()when done to clean up resources. - The standalone
AgentandClineCorehave different event systems. ForAgent: useagent.subscribe()to getAgentRuntimeEventtypes (text streaming is"assistant-text-delta", result text isresult.outputText). ForClineCore: usecline.subscribe()to getCoreSessionEventtypes (text streaming is"chunk"withpayload.type === "text", result text isresult.text). There is no top-levelonEventfield onAgentRuntimeConfig-- useagent.subscribe()orhooks.onEventinstead. Do not use event types like"content_update"or"content_start"withagent.subscribe()-- those are internal legacy types from the ClineCore adapter layer.
How to Use This Skill
Reference File Structure
The two main API surfaces (Agent and ClineCore) follow a 4-file pattern. Cross-cutting concepts are single-file guides.
Each main API surface in ./references/<api>/ contains:

