Skip to content

feat: VSCode chat extension — use Open Claude Code as @claude chatbot inside the editor#1

Merged
codomium merged 2 commits intomainfrom
copilot/add-chatbot-support-vscode
Apr 16, 2026
Merged

feat: VSCode chat extension — use Open Claude Code as @claude chatbot inside the editor#1
codomium merged 2 commits intomainfrom
copilot/add-chatbot-support-vscode

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 16, 2026

Adds a vscode-extension/ package that surfaces the existing v2/src agent loop as a native VSCode Chat participant (@claude), eliminating the need to run the CLI in a terminal.

Architecture

A long-lived Node.js subprocess (agent-bridge.mjs) owns the agent loop and its conversation state. The extension host communicates with it via newline-delimited JSON over stdin/stdout, serializing requests to prevent interleaving.

VSCode Chat UI (@claude)
    │  vscode.chat.createChatParticipant
    ▼
extension.js  (CJS, extension host)
    │  child_process.spawn — cwd = workspace root
    ▼
agent-bridge.mjs  (ESM, Node subprocess)
    │  ../v2/src/core/agent-loop.mjs + 25 tools
    ▼
Anthropic / OpenAI / Google API

New files

  • package.json — Extension manifest: chatParticipants contribution (@claude), configuration schema (model, permissionMode, maxTurns, showToolOutput), and three commands
  • agent-bridge.mjs — ESM subprocess wrapping createAgentLoop; handles run, reset, and model messages; emits typed ndjson events (stream_event, tool_progress, result, stop, error, …)
  • extension.js — Registers the chat participant, manages bridge lifecycle (lazy start, auto-restart on crash, dispose on settings change), streams events to ChatResponseStream, stores the API key in VSCode SecretStorage
  • README.md — VSIX build/install steps, configuration reference, troubleshooting

Key design decisions

  • One subprocess per workspace with a serialized request queue — keeps conversation history intact across turns without re-sending full history each time
  • API key flows through SecretStorage → bridge env var (ANTHROPIC_API_KEY); model and permission mode are passed as ANTHROPIC_MODEL / CLAUDE_CODE_PERMISSION_MODE which loadSettings() already handles via applyEnvOverrides
  • /clear and /model are exposed as first-class chat slash commands in addition to Command Palette equivalents

Copilot AI and others added 2 commits April 16, 2026 22:48
- vscode-extension/package.json: extension manifest with chatParticipant
  contribution (@claude), configuration schema, and commands
- vscode-extension/agent-bridge.mjs: long-lived ESM subprocess that runs
  the agent loop and speaks ndjson over stdin/stdout
- vscode-extension/extension.js: CJS extension entry point — registers the
  @claude chat participant, streams agent events to the VS Code chat UI,
  manages the bridge lifecycle, and exposes Set API Key / Clear Session /
  Show Status commands
- vscode-extension/README.md: setup, usage, and troubleshooting docs

Agent-Logs-Url: https://github.com/codomium/CODE/sessions/88fa876c-c934-453a-8c89-3e6b7dd78be2

Co-authored-by: codomium <255525663+codomium@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codomium/CODE/sessions/88fa876c-c934-453a-8c89-3e6b7dd78be2

Co-authored-by: codomium <255525663+codomium@users.noreply.github.com>
@codomium
Copy link
Copy Markdown
Owner

ADD CHATBOT INSIDE VSCODE

@codomium codomium marked this pull request as ready for review April 16, 2026 22:53
@codomium codomium merged commit 197621a into main Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants