You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: VS Code Integration for Reviewing OpenCode Code Changes (Diff Preview) #8003
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Currently, when modifying files that contain hundreds of lines of code, previewing changes in the TUI is very painful for me. I have to scroll back and forth in a very small window just to review the code modifications.
When using Claude Code, I can connect it to an external IDE (e.g. VS Code). After the agent generates code changes, I can preview/review the diffs in VS Code, and then go back to the TUI to decide whether to accept the changes or provide further feedback.
I hope OpenCode can support a similar workflow as well.
Reacted by stefantrigger, Muhammad Salik Salam, obaydah bouifadene, Lukas, axelstram, Phan Hoang, iamseb4s, Johann Brancourt, mw10013, Wei-Chih Huang and 73 more
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: Session or Per-chat File Diff Viewer #5102: [FEATURE]: Session or Per-chat File Diff Viewer - Proposes an integrated diff viewer in OpenCode TUI to review code changes without scrolling, addressing the same core pain point
Editor integrations #216: Editor integrations - Requests editor integrations like Claude Code's VS Code extension with ability to display diffs in external editors
please feature this. This would be amazing and allow me the switch from GH Copilot
In the current existing functionality, an alternative implementation is adopted. If you set "edit": "ask" in opencode.json, you can preview the agent's code modifications and use ctrl+f to preview in full-screen mode within the TUI. Unfortunately, even in this mode, there are only 4 lines of context outside the modified code, preventing you from previewing the diff across the entire modified code file. Therefore, I have raised a new issue: #9026, and based on this, submitted a PR to implement it: #9357
Reacted by edward zhu, wwnbb, dingping and Jarosław Janas
changed the title [-]VS Code Integration for Reviewing OpenCode Code Changes (Diff Preview)[/-][+][FEATURE]: VS Code Integration for Reviewing OpenCode Code Changes (Diff Preview)[/+]on Jan 21, 2026
Thats cool, makes sense to me. Though tbh i would still rather have an optional functionality that allows me to review my stuff in vscode and i think i speak for a reasonable group of people
Reacted by edward zhu, Jean-Philippe Robin, Dylan Barber, dingping, jjordan10, Marco Cuomo and ashwinlimaye
My plugin currently supports an editor-based diff (temporary backup + code --diff). It handles multiple edits across multiple files reliably in my testing, but currently works only on Linux and when running opencode from the editor’s integrated terminal. You can give it a try.
A Webview dashboard or sidebar UI would require much larger architectural changes — likely a dedicated VS Code extension — so it’s out of scope for now, but something I may explore later.
If you use Linux + Vscode, just add this in ~/.config/opencode/opencode.jsonc: { "plugin": ["@hoangp8/opencode-plugin-editor-diff@0.1.0"] }
I built a tool-agnostic VSCode extension for this — it watches for any external file writes and shows inline diffs with per-hunk Accept/Discard controls. No special integration needed with opencode.
It uses VSCode's proposed editorInsets API, so it can't be published to the marketplace — has to be installed manually via VSIX.
I built a tool-agnostic VSCode extension for this — it watches for any external file writes and shows inline diffs with per-hunk Accept/Discard controls. No special integration needed with opencode.
It uses VSCode's proposed editorInsets API, so it can't be published to the marketplace — has to be installed manually via VSIX.
awesome extension, it resolves my problems 100%, I was using Cursor + OpenCode at the same time for different type tasks and wish to have a similar feature for code-review purpose.
anyway, thx for your hard working and I will share it to my teammates today.
For terminal-only setups, diffpane solves this with a different approach: run it in a split pane and it shows a full-screen diff view that auto-updates as the agent writes. No editor integration needed.
For terminal-only setups, diffpane solves this with a different approach: run it in a split pane and it shows a full-screen diff view that auto-updates as the agent writes. No editor integration needed.
sounds really nice... in addition to the vscode integration 😀
It would still be nice to have this as a native feature of OpenCode.
It's incredibly useful in Claude Code, especially if you have more than one monitor which most of us probably do.
Reacted by Nils DEYBACH, enshulv, Gonçalo Amaral, Ryan, IceTea233, Yoyo and David Orozco
Not just Diff Preview, but also need to be able to edit the changes before accepting.
It is annoying and also wasting of tokens to interrupt the agents frequently only to revise some small (and obvious, but always overlooked by agents) problems manually.
Looks that editing changes is more related to #2167. If VS Code Integration is not available currently, could OpenCode at least provide a built-in changes editing functionality?
I built a tool-agnostic VSCode extension for this — it watches for any external file writes and shows inline diffs with per-hunk Accept/Discard controls. No special integration needed with opencode.
It uses VSCode's proposed editorInsets API, so it can't be published to the marketplace — has to be installed manually via VSIX.
Huge thanks for building and open-sourcing hunkwise — I’ve learned a ton from your implementation and design ideas, it’s been such a valuable reference as I’m learning to build VS Code extensions.
While using the monorepo in large directories, I encountered an issue where excessive Git commits caused my computer to run out of memory and crash. I attempted to modify the hunkwise logic in the original project to resolve this, but the effort failed—it seems Git commits inherently suffer from this flaw.
I tried replicating the diff approach adopted by tools like Copilot and Cursor. My implementation leverages SSE on the OpenCode backend alongside a port listener in the plugin, which only monitors AI-initiated write and edit operations within OpenCode. This delivers better compatibility with large folders, yet numerous unresolved issues remain (I have documented all of them in the README).
Part of the UI design and CodeLens implementation references your hunkwise design, which has been tremendously helpful to me !
It also uses VSCode's proposed editorInsets API, so it can't be published to the marketplace — has to be installed manually via VSIX.
I developed it in window, so maybe there are some compatile question in any other system.
Activity
github-actions commentedon Jan 12, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
Pl8tinium commentedon Jan 20, 2026
please feature this. This would be amazing and allow me the switch from GH Copilot
liangxiao777 commentedon Jan 21, 2026
In the current existing functionality, an alternative implementation is adopted. If you set "edit": "ask" in opencode.json, you can preview the agent's code modifications and use ctrl+f to preview in full-screen mode within the TUI. Unfortunately, even in this mode, there are only 4 lines of context outside the modified code, preventing you from previewing the diff across the entire modified code file. Therefore, I have raised a new issue: #9026, and based on this, submitted a PR to implement it: #9357
[-]VS Code Integration for Reviewing OpenCode Code Changes (Diff Preview)[/-][+][FEATURE]: VS Code Integration for Reviewing OpenCode Code Changes (Diff Preview)[/+]Pl8tinium commentedon Jan 21, 2026
Thats cool, makes sense to me. Though tbh i would still rather have an optional functionality that allows me to review my stuff in vscode and i think i speak for a reasonable group of people
HoangP8 commentedon Jan 30, 2026
Hello! I wrote a simple plugin here: https://github.com/HoangP8/opencode-plugin-editor-diff
View changed files directly in your editor — from the TUI. Try it out!
Note for future users:
Pl8tinium commentedon Jan 30, 2026
very cool! i'll give this a shot
HoangP8 commentedon Feb 14, 2026
@Solix45456767 Hi,
code --diff). It handles multiple edits across multiple files reliably in my testing, but currently works only on Linux and when running opencode from the editor’s integrated terminal. You can give it a try.If you use Linux + Vscode, just add this in
~/.config/opencode/opencode.jsonc:{ "plugin": ["@hoangp8/opencode-plugin-editor-diff@0.1.0"] }molon commentedon Mar 24, 2026
I built a tool-agnostic VSCode extension for this — it watches for any external file writes and shows inline diffs with per-hunk Accept/Discard controls. No special integration needed with opencode.
It uses VSCode's proposed
editorInsetsAPI, so it can't be published to the marketplace — has to be installed manually via VSIX.https://github.com/molon/hunkwise
haoliangwu commentedon Mar 25, 2026
awesome extension, it resolves my problems 100%, I was using Cursor + OpenCode at the same time for different type tasks and wish to have a similar feature for code-review purpose.
anyway, thx for your hard working and I will share it to my teammates today.
Astro-Han commentedon Apr 1, 2026
For terminal-only setups, diffpane solves this with a different approach: run it in a split pane and it shows a full-screen diff view that auto-updates as the agent writes. No editor integration needed.
Pl8tinium commentedon Apr 1, 2026
sounds really nice... in addition to the vscode integration 😀
jaroslawjanas commentedon Apr 20, 2026
It would still be nice to have this as a native feature of OpenCode.
It's incredibly useful in Claude Code, especially if you have more than one monitor which most of us probably do.
lucaaamaral commentedon Jun 10, 2026
Please, do. This would be great actually.
IceTea233 commentedon Jun 11, 2026
Not just Diff Preview, but also need to be able to edit the changes before accepting.
It is annoying and also wasting of tokens to interrupt the agents frequently only to revise some small (and obvious, but always overlooked by agents) problems manually.
Looks that editing changes is more related to #2167. If VS Code Integration is not available currently, could OpenCode at least provide a built-in changes editing functionality?
thetechank commentedon Jun 15, 2026
Is there any plan to add this?
aaatly commentedon Jul 2, 2026
Huge thanks for building and open-sourcing hunkwise — I’ve learned a ton from your implementation and design ideas, it’s been such a valuable reference as I’m learning to build VS Code extensions.
While using the monorepo in large directories, I encountered an issue where excessive Git commits caused my computer to run out of memory and crash. I attempted to modify the hunkwise logic in the original project to resolve this, but the effort failed—it seems Git commits inherently suffer from this flaw.
I tried replicating the diff approach adopted by tools like Copilot and Cursor. My implementation leverages SSE on the OpenCode backend alongside a port listener in the plugin, which only monitors AI-initiated write and edit operations within OpenCode. This delivers better compatibility with large folders, yet numerous unresolved issues remain (I have documented all of them in the README).
Part of the UI design and CodeLens implementation references your hunkwise design, which has been tremendously helpful to me !
It also uses VSCode's proposed editorInsets API, so it can't be published to the marketplace — has to be installed manually via VSIX.
I developed it in window, so maybe there are some compatile question in any other system.
Opencode Diffgate
github-actions commentedon Sep 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.