How prabuselvamnatarajan/continue works
Purpose and Deliverables
Continue is an archived, final-2.0.0 open-source coding agent delivered through a Node CLI, VS Code extension, and JetBrains plugin. The shared TypeScript core supplies model access, agent tools, configuration, context retrieval, editing, and IDE protocol contracts. Primary entry points are extensions/cli/src/index.ts, extensions/vscode/src/extension.ts, and extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/activities/ContinuePluginStartupActivity.kt.
Host Integration and Process Boundary
IDE hosts collect editor/workspace state, render native UI, apply edits, and communicate with the core through a typed bidirectional protocol. VS Code activates its extension and messenger; JetBrains starts/manages a bundled binary process and socket/core messenger. The binary provides IPC/TCP transport and launches the core-facing runtime. Key boundaries: extensions/vscode/src/activation/activate.ts, extensions/vscode/src/extension/VsCodeMessenger.ts, extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt, binary/src/index.ts, and core/protocol/ideCore.ts.
Shared Agent Core
core/core.ts is the principal orchestration layer behind interactive chat/agent workflows. It composes normalized configuration, instructions, context, LLM streaming, and tools; adapters keep host-specific filesystem, terminal, editor, and UI operations outside the core. Rules and prompt files contribute user/workspace instructions. Core contracts are concentrated in core/protocol/core.ts, core/rules/InstructionConstructor.ts, and core/promptFiles/parsePromptFile.ts.
Configuration, Models, and LLM Boundary
Configuration supports local profiles, JSON/YAML sources, markdown rules/skills, model-role selection, and MCP definitions. The config layer resolves these into runtime configuration before requests begin. The LLM layer abstracts streaming chat, token handling, templates, retries, and a broad provider catalog, including cloud and local services such as OpenAI, Anthropic, Bedrock, Gemini, Azure, Ollama, and LM Studio. Relevant paths: core/config/ConfigHandler.ts, core/config/profile/doLoadConfig.ts, core/llm/streamChat.ts, and core/llm/llms/index.ts. Provider protocol adaptation is also packaged in packages/openai-adapters/src/index.ts.
Context and Retrieval Pipeline
Agent requests are augmented from IDE/workspace state and optional remote sources. Context providers can access files, diffs, terminals, Git, web/docs, databases, issue trackers, and MCP resources. Workspace indexing chunks code and supports full-text/vector-style retrieval; documentation can be crawled and indexed. Retrieval then ranks selected material for prompts. Major stages: core/context/providers/index.ts, core/context/retrieval/retrieval.ts, core/indexing/CodebaseIndexer.ts, core/indexing/LanceDbIndex.ts, and core/indexing/docs/DocsService.ts.
Tools, Edits, and Safety
Models invoke a defined tool surface for read/search/write, shell execution, diffs, MCP calls, web access, tasks, and mode switching. Tool definitions are separated from host-dependent implementations and can be overridden by policy. Generated edits are applied through search/replace, unified diff, or lazy streaming application paths; hosts render/apply resulting file changes. Core paths: core/tools/definitions/index.ts, core/tools/callTool.ts, core/tools/policies/fileAccess.ts, core/edit/lazy/streamLazyApply.ts, and core/edit/searchAndReplace/performReplace.ts. CLI adds explicit permission precedence and terminal command security through extensions/cli/src/permissions/permissionChecker.ts and packages/terminal-security/src/evaluateTerminalCommandSecurity.ts.
Client Experiences and Runtime Stack
The CLI is a Node/TypeScript terminal application with a React TUI, service container, streaming/tool-call loop, MCP connections, local session/config services, and optional platform API/auth/storage clients. VS Code and JetBrains embed the shared GUI webview, a Vite React/Redux application that sends protocol requests and renders streams, tool calls, configuration, indexing, and edit acceptance. Core runtime is TypeScript/Node; JetBrains is Kotlin/Gradle; sync is a Rust library with Merkle-based workspace synchronization. Paths: extensions/cli/src/stream/streamChatResponse.ts, extensions/cli/src/services/ServiceContainer.ts, gui/src/context/IdeMessenger.tsx, gui/src/redux/thunks/streamResponse.ts, and sync/src/sync/merkle.rs.
Main entry points: core.ts Agent orchestration · ideCore.ts IDE ↔ core protocol · retrieval.ts Context retrieval · callTool.ts Tool execution
Components 23
Client experiences
- Node CLI · Terminal agent with permissions and sessions.
extensions/cli/src/index.ts - CLI stream loop
extensions/cli/src/stream/streamChatResponse.ts - CLI permissions
extensions/cli/src/permissions/permissionChecker.ts - Shared GUI webview · Renders streams, tool calls, configuration, indexing, and edit review.
gui/src/redux/thunks/streamResponse.ts
Host integration
- VS Code extension
extensions/vscode/src/extension.ts - VS Code activation
extensions/vscode/src/activation/activate.ts - VS Code messenger
extensions/vscode/src/extension/VsCodeMessenger.ts - JetBrains plugin
extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/activities/ContinuePluginStartupActivity.kt - JetBrains core manager
extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt - Bundled binary · Launches the core-facing runtime for JetBrains.
binary/src/index.ts
Shared agent core
- IDE ↔ core protocol
core/protocol/ideCore.ts - Agent orchestration · Composes instructions, context, streaming, and tools.
core/core.ts - Rules and prompt files · Builds user and workspace instructions.
core/rules/InstructionConstructor.ts
Model, context & tools
- Runtime configuration · Resolves profiles, sources, model roles, and MCP definitions.
core/config/ConfigHandler.ts - LLM streaming layer · Handles templates, tokens, retries, and provider streaming.
core/llm/streamChat.ts - Model providers · Cloud and local LLM integrations.
core/llm/llms/index.ts - Context retrieval · Selects workspace, IDE, remote, and MCP material for prompts.
core/context/retrieval/retrieval.ts - Code and docs indexing · Chunks workspace code and supports retrieval.
core/indexing/CodebaseIndexer.ts - Tool execution · Invokes defined tools through host-dependent implementations.
core/tools/callTool.ts - Tool surface · Read, search, write, shell, diff, MCP, web, task, and mode tools.
core/tools/definitions/index.ts - Edit application · Applies generated changes through lazy streaming paths.
core/edit/lazy/streamLazyApply.ts - Terminal command security
packages/terminal-security/src/evaluateTerminalCommandSecurity.ts - Workspace sync · Merkle-based workspace synchronization.
sync/src/sync/merkle.rs
Connections 24
- Node CLI → CLI stream loop: starts
- CLI stream loop → Agent orchestration: runs agent requests
- CLI permissions → Tool execution: authorizes CLI tool use
- CLI permissions → Terminal command security: checks shell commands
- VS Code extension → VS Code activation: activates
- VS Code activation → VS Code messenger: creates
- VS Code messenger → IDE ↔ core protocol: communicates via
- JetBrains plugin → JetBrains core manager: starts
- JetBrains core manager → Bundled binary: manages
- Bundled binary → IDE ↔ core protocol: transports
- Shared GUI webview → IDE ↔ core protocol: sends requests and renders events
- IDE ↔ core protocol → Agent orchestration: routes host requests
- Agent orchestration → Rules and prompt files: builds prompts from
- Agent orchestration → Runtime configuration: uses
- Agent orchestration → Context retrieval: augments requests with
- Agent orchestration → LLM streaming layer: streams through
- Agent orchestration → Tool execution: invokes
- Agent orchestration → Edit application: produces edits through
- Runtime configuration → Model providers: selects model roles
- LLM streaming layer → Model providers: adapts requests to
- Context retrieval → Code and docs indexing: queries indexed workspace
- Tool execution → Tool surface: dispatches defined tools
- Edit application → IDE ↔ core protocol: returns file changes to hosts
- Workspace sync → Context retrieval: supplies synchronized workspace state