Skip to content

[FEATURE]: VS Code Integration for Reviewing OpenCode Code Changes (Diff Preview) #8003

Closed as not planned

Description

@liangxiao777

Feature hasn't been suggested before.

  • 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.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 12, 2026
  2. github-actions commented on Jan 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. Pl8tinium commented on Jan 20, 2026

    @Pl8tinium

    please feature this. This would be amazing and allow me the switch from GH Copilot

  4. liangxiao777 commented on Jan 21, 2026

    @liangxiao777
    Author

    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

  5. 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
  6. Pl8tinium commented on Jan 21, 2026

    @Pl8tinium

    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

  7. HoangP8 commented on Jan 30, 2026

    @HoangP8

    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:

    • I’ve seen several downloads from npm (thanks!), and it currently works only when running OpenCode in your editor’s terminal on Linux only.
    • If anything doesn’t work (like diffs not showing up), pls open an issue and I’ll take a look.
  8. Pl8tinium commented on Jan 30, 2026

    @Pl8tinium

    very cool! i'll give this a shot

  9. HoangP8 commented on Feb 14, 2026

    @HoangP8

    @Solix45456767 Hi,

    1. 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.
    2. 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"] }

  10. molon commented on Mar 24, 2026

    @molon

    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.

    https://github.com/molon/hunkwise

    Image
  11. haoliangwu commented on Mar 25, 2026

    @haoliangwu

    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.

    https://github.com/molon/hunkwise

    Image

    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.

  12. Astro-Han commented on Apr 1, 2026

    @Astro-Han

    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.

    demo

  13. Pl8tinium commented on Apr 1, 2026

    @Pl8tinium

    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.

    demo demo

    sounds really nice... in addition to the vscode integration 😀

  14. jaroslawjanas commented on Apr 20, 2026

    @jaroslawjanas

    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.

  15. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  16. lucaaamaral commented on Jun 10, 2026

    @lucaaamaral

    Please, do. This would be great actually.

  17. IceTea233 commented on Jun 11, 2026

    @IceTea233

    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?

  18. thetechank commented on Jun 15, 2026

    @thetechank

    Is there any plan to add this?

  19. aaatly commented on Jul 2, 2026

    @aaatly

    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.

    https://github.com/molon/hunkwise

    Image

    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

    Image Image
  20. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions