[PR #5447] feat IDE Integration: Live text selection and diff review/approval. #11408

Open
opened 2026-02-16 18:16:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5447

State: open
Merged: No


Forgive me for being a Claude Code user up until this point; excited about being able to contribute to an open workflow instead of opening tickets and watching them go stale. One aspect of my workflow I really enjoy is the ability to send my highlights directly into context, and also have diffs appear in my IDE.

This patch uses the existing coder/claudecode.nvim (and probably the existing VSCode extension I haven't tested yet) to connect opencode to the websocket server they provide.

After installing the plugin, launch opencode and use the /ide command to select from the available open sockets. In nvim visual mode your selection will be automatically updated in the prompt window. When the agent proposes a change the diff will appear in the IDE and can either be approved inside the IDE or in the terminal session.

In order to not hard-code any third party references, I made a couple config updates to opencode.json that are necessary for this to work:

{
    "ide": {
      "lockfile_dir": "/Users/tcdent/.claude/ide/",
      "auth_header_name": "x-claude-code-ide-authorization"
  }
}

Also, in order to get diff approval to wait for input, setting permission is necessary:

{
  "permission": {
    "edit": "ask"
  }
}

This is more of a PoC than a production-ready feature and I'm sure everyone on the team here has some opinion about this, so I'm happy to continue working on this. For one thing, we should coordinate with an existing plugin maintainer for an opencode-specific integration. For now, this has made opencode a drop-in replacement for my existing workflow, and I'm excited to own my entire dev environment again.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5447 **State:** open **Merged:** No --- Forgive me for being a Claude Code user up until this point; excited about being able to contribute to an open workflow instead of opening tickets and watching them go stale. One aspect of my workflow I really enjoy is the ability to send my highlights directly into context, and also have diffs appear in my IDE. This patch uses the existing `coder/claudecode.nvim` (and probably the existing VSCode extension I haven't tested yet) to connect `opencode` to the websocket server they provide. After installing the plugin, launch `opencode` and use the `/ide` command to select from the available open sockets. In nvim visual mode your selection will be automatically updated in the prompt window. When the agent proposes a change the diff will appear in the IDE and can either be approved inside the IDE or in the terminal session. In order to not hard-code any third party references, I made a couple config updates to `opencode.json` that are necessary for this to work: ```json { "ide": { "lockfile_dir": "/Users/tcdent/.claude/ide/", "auth_header_name": "x-claude-code-ide-authorization" } } ``` Also, in order to get diff approval to wait for input, setting permission is necessary: ```json { "permission": { "edit": "ask" } } ``` This is more of a PoC than a production-ready feature and I'm sure everyone on the team here has some opinion about this, so I'm happy to continue working on this. For one thing, we should coordinate with an existing plugin maintainer for an opencode-specific integration. For now, this has made `opencode` a drop-in replacement for my existing workflow, and I'm excited to own my entire dev environment again.
yindo added the pull-request label 2026-02-16 18:16:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11408