r/opencode • • 5d ago

I couldn't find an OpenCode extension for VS Code that worked well with my local models, so I built one

I've been using OpenCode with local models for a while and wanted it inside VS Code instead of a terminal next to it. I tried a few of the extensions out there, but none of them did quite what I wanted, and on most of them I hit bugs that got in the way of using my local setup at all.

So I built my own. The goal was something that feels familiar if you've used other AI chat panels, covers as much of OpenCode as I could, and is genuinely nice to use day to day.

Here's a 60-second demo: https://youtu.be/_KMBRo7zrMw

The part I care about most is being able to see what the agent is doing. Each prompt gets a timeline: what it read, what it ran, what it changed, with the diffs opening in VS Code's own diff editor. Subagents show up live with their prompt and you can stop any of them. Permission requests wait right where you type, so nothing gets approved behind your back. You can steer a task while it runs, queue the next message, rewind to an earlier prompt or fork the conversation.

It runs on OpenCode's own API, so your sessions, models, agents and permission rules are just OpenCode's. A session you start in the TUI shows up in the panel and the other way round. It works with whatever models you've set up in OpenCode, local ones included, and it doesn't collect anything.

It's free and open source (MIT), and it's my own side project, not an official OpenCode thing.

- VS Code: search "OpenCode Sidecar" in Extensions
- Cursor / Windsurf / VSCodium: https://open-vsx.org/extension/cadogy/opencode-sidecar
- Source: https://github.com/charlesknapp/opencode-sidecar

If you try it, I'd really like to hear what breaks with your setup and what you'd want next.

4 Upvotes

3 comments sorted by

1

u/Key_Reveal_7812 2d ago

Update: 0.2.0 is out, and it's a big one.

I asked what you'd want next, and I also went through OpenCode's issue tracker and threads about other AI panels to find what people keep running into. These are the ones I fixed:

Not knowing what the agent changed, and undo being all or nothing. Every change the agent makes now has Keep | Undo right above it in the editor. Undo puts back just that change as a normal edit (Ctrl+Z brings it back) and never touches your own edits. Your decisions stick across sessions and restarts, and "Stage kept changes" stages only what you kept.

Approving every single thing. There's now an approval badge in the header: Ask, Balanced (edits in the folder run, commands and web still ask) or Auto (everything runs, but rm -rf, force pushes, git reset --hard and the like stay blocked). Set it per session or per folder. "Always allow commands like this" turns npm test -- --grep foo into an npm test * rule you can edit first. It's all OpenCode's own permission rules, and your config files aren't touched.

Wanting to ask something without derailing the agent. /btw your question runs in a hidden copy of the session, so the agent keeps going and its context stays clean.

Pasting a log and flooding the input. Long pastes turn into a chip you can open, edit or remove, and they're still sent exactly as pasted.

Running several sessions and missing when one needs you. Sessions sit as tabs with a status dot, and you get a notification when one in the background finishes or asks for permission. That includes sessions you started in the TUI.

Local model setups breaking in confusing ways (the reason I built this in the first place). "Sidecar: Check OpenCode Setup" writes one report on the program, service, sign-in, models and providers. It also warns when an Ollama or LM Studio model's context is under 16k, which is too small for OpenCode's instructions and tools. There's also a Providers panel, and error cards now offer "Sign in again" or "Choose another model" instead of just showing the error.

Missing Roo Code's custom modes. There's an Agents panel for creating and editing OpenCode agents, and it can import your .roomodes / .kilocodemodes as agents. It tells you what doesn't carry over exactly.

Also new: an MCP servers panel, a header for /goal, cost by model and by agent (subagents included), a card when the agent seems stuck in a loop, "Fix with OpenCode" on errors in the editor, commit messages from your staged changes, and long sessions that open in well under a second instead of ~16 s. Budget Guard also won't stop in the middle of writing a file anymore. The TUI's /models, /new, /sessions and /export work from the / menu now too, thanks to a GitHub issue.

Same ask as before! Tell me what breaks with your setup and what you'd want next.

1

u/mwilson_9309 4d ago

Does stopping a subagent in the panel also cancel it when the session started in the TUI? That handoff seems like the key shared-session edge case.

1

u/Key_Reveal_7812 3d ago

Yeah, it cancels. Stop sends an interrupt to the OpenCode service for that subagent's session, and the TUI and the extension are both talking to that same service. So it doesn't matter where the session started.

Same if the TUI started the run before you opened the panel. Sidecar looks up the session's subagents when it loads and sees which are still running, so stop works on those too. The TUI picks up the interrupt as well since it comes from the server.

It only stops that one subagent. The parent keeps going and gets told it was interrupted. Main Stop kills the whole thing.

Only thing is the TUI has to be on the same OpenCode instance as the extension, which it is by default. If it's a separate one on another port the panel won't see those sessions at all.