OpenCode Chat for VS Code
A focused OpenCode coding-agent experience in the VS Code sidebar, with streaming chat, tools, questions, permissions, models, sessions, and diffs.
OpenCode Chat by Shawn is an independent community extension. It is not affiliated with or endorsed by OpenCode or SST.
Highlights
- Clean secondary-sidebar and Activity Bar chat views
- Streaming responses, a collapsed Thinking section, tool activity, and Markdown
- Working interactive questions with single, multiple, and custom answers
- Four explicit safety modes: Ask, Auto safe, Full access, and Plan
- Chat history with automatic names, confirmed deletion, and clean cancellation
- OpenCode Zen and Go model catalogs with favorites and model-verified reasoning levels
- Maximum supported reasoning by default, with OpenCode's coding-focused Build agent
- Native parallel-agent delegation for independent research, review, and implementation work
- File, folder, image-paste, and
@file context
- Session diffs that open in VS Code’s native diff editor
- One OpenCode account key, stored in VS Code Secret Storage and the CLI’s auth file
- Guided OpenCode CLI setup
Safety modes
| Mode |
Behavior |
| Ask |
Asks before every tool action. This is the default. |
| Auto safe |
Allows structured reads, search, language tools, read-only Explore agents, and a very small exact read-only command set; asks for everything else. |
| Full access |
Automatically approves actions that OpenCode asks the extension to approve. Explicit deny rules are preserved. |
| Plan |
Explores and plans while denying edits, shell commands, and external-directory access. Read-only Explore agents remain available. |
Protected environment files remain denied in modes that automatically read files. Full access is powerful—only use it in workspaces you trust.
OpenCode Chat adds a small set of structured tools to every extension-managed OpenCode session:
| Tool |
Purpose |
background_start |
Start a dev server or other long-running command without blocking the agent |
background_output / background_list |
Reattach to managed jobs and inspect their latest output |
background_stop |
Stop a managed process and its child process tree |
workspace_move |
Rename or move a workspace path with strict workspace-boundary checks |
visual_verify |
Capture a real browser screenshot and return the image to the model |
workspace_checkpoint |
Create, list, restore, and delete named snapshots without changing Git state |
These tools follow the active safety mode. Plan blocks mutating operations while still allowing read-only job status, checkpoint listing, and visual verification.
Parallel agents
For requests with independent workstreams, the primary model can launch OpenCode subagents concurrently through the native Task tool. Background agents use child sessions, inherit the selected model and active safety policy, can be cancelled with the parent run, and automatically return their results to the main conversation.
The extension encourages bounded delegation instead of splitting every prompt. It defaults to three concurrent agents, assigns non-overlapping scopes, and keeps read-only exploration separate from implementation. Parallel agents share the same workspace, so overlapping file ownership is intentionally avoided.
Requirements
The same account key configures both the Zen and Go catalogs. Access to individual models still depends on your OpenCode account.
Commands
| Command |
Description |
OpenCode: Open Chat |
Focus OpenCode Chat |
OpenCode: New Session |
Start a fresh chat and stop the active run |
OpenCode: Connect Account |
Store an OpenCode account key |
OpenCode: Disconnect Account |
Remove the stored OpenCode account key |
OpenCode: Install CLI |
Install or repair the OpenCode CLI |
OpenCode: Insert File Mention |
Insert the active file or selection into the composer |
Default shortcuts:
- Open chat:
Ctrl+Shift+O / Cmd+Shift+O
- Insert file mention:
Ctrl+Alt+K / Cmd+Alt+K
Settings
opencode.cliPath — optional absolute path to the OpenCode binary
opencode.defaultModel — default model ID
opencode.defaultVariant — default reasoning effort; the extension falls back to the strongest level the selected model actually supports
opencode.parallelAgents — enable automatic delegation for substantial independent work
opencode.maxParallelAgents — delegation limit from 1 to 6; defaults to 3
Development
npm install
npm run check
npm run build
Press F5 in VS Code to launch an Extension Development Host. For watch mode, run npm run watch and npm run watch:webview in separate terminals.
To create a VSIX:
npm run package
Architecture
React webview → VS Code extension host → local OpenCode server → OpenCode providers
The extension starts its local server lazily when the chat is opened, uses an explicit workspace working directory, and stops the process when the extension is disposed.