Skip to main content
ClineCore is the full Cline harness as a programmable runtime. It gives you everything Cline ships out of the box: built-in tools for files, shell, search, and web; session persistence and message history; tool approval callbacks; local, hub, and remote backends; scheduling and automation APIs; and plugin support. Under the hood, ClineCore uses the Agent class from @cline/agents. You can use Agent directly if you want to skip the harness and wire everything yourself: your own tools, your own persistence, your own lifecycle.

When to use which

ClineCore

ClineCore wraps runtime execution with application features:
  • session manifests and message artifacts
  • built-in tools
  • tool approval callbacks
  • local, hub, and remote backends
  • automation/scheduling APIs
  • optional plugin paths and extensions

Methods

See ClineCore reference for exact signatures.

Backend Modes

For process topology, see Hub & Spoke.

Session Artifacts

ClineCore stores session manifests and messages as files. A session result includes:

Tool Approval

Use tool policies for simple cases:
Use requestToolApproval when your application needs to decide dynamically:
For tool behavior and policies, see Tools.

Using Agent directly

Agent (also exported as AgentRuntime) is the stateless primitive that ClineCore builds on. Use it directly when you want full control or don’t need the harness. Agent is an alias for AgentRuntime. Use Agent when constructing from provider/model IDs. Use AgentRuntime when supplying a pre-built AgentModel. Agent runs the core loop:

Agent Methods

See Agent reference for exact signatures.

Multi-Turn Conversations

AgentRuntime keeps message state internally. Use continue() after the first run:
If you persist messages externally, restore them with restore(messages) before continuing.