This page covers what Cline is, who it is for, and the foundational concepts that all deeper documentation builds upon. For a detailed subsystem map, see Architecture Overview. For installation steps, see Installation and Setup. For running a first task, see Quick Start Guide.
Cline is an autonomous coding agent distributed as multiple primary artifacts:
claude-dev, publisher saoudrizwan) [apps/vscode/package.json:2-18].cline) [README.md:44-55], [apps/cli/package.json:21].@cline/sdk), a standalone TypeScript framework for building agentic applications [README.md:109-115], [sdk/packages/sdk/package.json:2-4].The agent accepts a natural-language prompt and executes multi-step tasks by combining LLM reasoning with a concrete set of host-environment tools: file creation and editing, terminal command execution, headless browser automation, and external service calls via the Model Context Protocol (MCP) [README.md:138-148].
The defining characteristic is the human-in-the-loop model: every consequential action (writing files, executing terminal commands, or browser actions) is presented to the user for approval before it executes [README.md:148], [apps/vscode/package.json:98-106].
The project targets three audiences:
Sources: [README.md:1-123], [apps/vscode/package.json:1-18], [CHANGELOG.md:7-15]
Diagram: Runtime Components Mapped to Code Entities
Sources: [sdk/packages/core/package.json:2-3], [sdk/packages/agents/package.json:22], [sdk/packages/llms/src/catalog/catalog.generated.ts:13-16], [apps/cli/package.json:24], [apps/vscode/package.json:47]
With the migration to the SDK-backed runtime [CHANGELOG.md:89], tasks are managed via ClineCore and executed by the stateless Agent loop [sdk/packages/core/package.json:52], [sdk/packages/agents/package.json:2].
Diagram: Agent Loop — Natural Language Steps to Code Entities
The loop steps in plain language:
ClineCore prepares the workspace and starts a stateful session [sdk/packages/core/package.json:18-21].Agent uses the provider gateway to communicate with the selected model, handling streaming updates [sdk/packages/agents/package.json:37].@cline/agents) dispatches the tool call [sdk/packages/agents/package.json:30].write_file, bash) until the user provides feedback via the UI [README.md:148].Sources: [README.md:146-149], [sdk/packages/agents/package.json:10-14], [sdk/packages/core/package.json:51-54]
By default, Cline never writes files or runs commands without first receiving explicit user confirmation. This is enforced through a suspension mechanism where the agent loop waits for user feedback [README.md:148], [apps/vscode/package.json:98-106].
| Mechanism | Implementation Detail | Effect |
|---|---|---|
| Approval prompts | ask() flow | Suspends agent loop; requires explicit user response [README.md:148]. |
| Diff view | apply_diff / DiffViewProvider | Shows proposed file changes before applying [CHANGELOG.md:38]. |
| Checkpoints | Git-based snapshots | System for diffing and rollback of workspace state [CHANGELOG.md:58]. |
| Rules & .clineignore | .clinerules / .clineignore | Guides behavior and prevents access to specified paths [README.md:150-152]. |
| Command Permissions | CLINE_COMMAND_PERMISSIONS | Restricts shell commands based on user-defined permissions [CHANGELOG.md:33]. |
| Plan Mode Blocks | Mode-based restrictions | Hard-blocks file-editing shell commands in Plan mode [CHANGELOG.md:33]. |
| YOLO Mode | Auto-approval settings | Bypasses approval for selected action types (e.g., -y in CLI) [README.md:148]. |
Sources: [README.md:138-152], [CHANGELOG.md:32-34], [CHANGELOG.md:58]
Cline supports a wide range of backends via the @cline/llms package, which provides a unified model catalog and provider gateway [sdk/packages/llms/package.json:2-4].
| Provider | Handler Logic | Key Feature |
|---|---|---|
| Anthropic | @ai-sdk/anthropic | Native tool calling, Claude 3.5/3.7 Sonnet [sdk/packages/llms/package.json:54]. |
| OpenAI | @ai-sdk/openai | GPT-4o, O1/O3 reasoning models [sdk/packages/llms/package.json:58]. |
| Google Gemini | @ai-sdk/google | Large context windows via Gemini series [sdk/packages/llms/package.json:55]. |
| OpenRouter | openrouter | Access to 200+ models via one API [README.md:163]. |
| AWS Bedrock | @ai-sdk/amazon-bedrock | Enterprise-grade hosting for Claude/Llama [sdk/packages/llms/package.json:53]. |
| Cline Provider | cline | Managed access with curated model catalog [CHANGELOG.md:7]. |
| Local Models | ollama-ai-provider-v2 | Run models locally for privacy/offline use [sdk/packages/llms/package.json:73]. |
Sources: [README.md:154-170], [sdk/packages/llms/package.json:52-74], [sdk/packages/llms/src/catalog/catalog.generated.ts:18-300]
The extension activates on events like onStartupFinished and onUri [apps/vscode/package.json:42-46]. It registers a sidebar webview provider claude-dev.SidebarProvider [apps/vscode/package.json:123]. It utilizes a rollout mechanism to switch between "Legacy" and "Next" (SDK-based) variants [CHANGELOG.md:89].
The CLI supports interactive terminal UIs and fully headless modes for CI/CD and scripting [README.md:44-55]. It implements the Agent Client Protocol (ACP) for standardized agent communication [bun.lock:27].
The SDK (@cline/sdk) is the foundational framework. It allows developers to build custom agents, bots, or automated pipelines [README.md:109-117]. It is structured into layered packages: @cline/shared, @cline/llms, @cline/agents, and @cline/core [package.json:5], [sdk/packages/sdk/package.json:28].
Sources: [apps/vscode/package.json:129-232], [README.md:1-123], [sdk/packages/sdk/package.json:1-37]
| Subsystem | Wiki Page | Primary Code Entities |
|---|---|---|
| Extension activation | Extension Activation and Lifecycle | activate() in apps/vscode/src/extension.ts |
| Orchestration | Controller and Orchestration | ClineCore, StateManager |
| Task execution | Task Lifecycle | Agent, Session, ToolOrchestrator |
| AI providers | Provider Implementations | ProviderGateway, GENERATED_PROVIDER_MODELS |
| UI components | UI Architecture | App.tsx, ChatView, McpMarketplaceView |
| SDK | SDK Architecture and Packages | @cline/shared, @cline/llms, @cline/agents, @cline/core |
Sources: [package.json:4-14], [apps/vscode/package.json:120-128], [sdk/packages/sdk/package.json:27-29]
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.