Use OpenCode from a VS Code sidebar. Chat with your local OpenCode service,
organize conversations into sessions, and add editor files or selections as
context when you choose.
Features
Sidebar chat with streamed responses and stop/cancel controls.
Multiple workspace-local chat sessions with per-session context and
agent/model selection.
Add the active file or selected editor text to a chat when you choose; items
larger than 200 KiB are rejected.
MCP server status display and a command to open OpenCode in a terminal at the
active file's directory or workspace root.
Works with local and VS Code remote workspaces.
Requirements
Visual Studio Code 1.95 or newer
OpenCode CLI/service
The extension connects to an HTTP loopback endpoint, defaulting to
http://127.0.0.1:4096. It reuses a healthy service or starts
opencode serve --hostname 127.0.0.1 --port 4096 when needed. The extension
stops only a service process it started.
Use
Open the OpenCode view from the Activity Bar.
Enter a prompt and send it to your OpenCode service.
Use the session drawer to create or switch conversations, select an agent or
model, inspect MCP status, or launch OpenCode in a terminal.
Use OpenCode: Add Active File to Chat or OpenCode: Add Selection to
Chat when you want to provide editor context.
The opencode.endpoint setting accepts HTTP loopback addresses only. Prompts
are sent when you submit them; file and selection content is included only
after you explicitly add it. The extension does not use telemetry.
Configuration
Setting
Default
Description
opencode.endpoint
http://127.0.0.1:4096
HTTP loopback endpoint for the OpenCode service.
Change the endpoint in VS Code Settings if your OpenCode service uses a
different HTTP loopback address.
Troubleshooting
If the sidebar cannot connect, make sure OpenCode is installed and the local
service is available at the configured endpoint. Use OpenCode: Start and
Connect from the Command Palette to retry.
If you need to inspect connection details, open View: Toggle Output and
select OpenCode.
If a file or selection is too large, reduce it to 200 KiB or less before
adding it as context.