[FEATURE]:Inter-Project Context Bridging: Enable LLM Collaboration Across Sessions #7383

Open
opened 2026-02-16 18:07:01 -05:00 by yindo · 5 comments
Owner

Originally created by @enesgur on GitHub (Jan 23, 2026).

Originally assigned to: @thdxr on GitHub.

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

What do you want to change or add?

I would like to propose a feature that allows two distinct active sessions (projects) within Opencode to communicate and share context with each other.

The Core Concept:
Imagine a scenario where a user has two open projects:

  • Project A: A consumer application (e.g., Frontend or a Dependent Service).
  • Project B: A dependency provider (e.g., Backend API or Core Library).

Currently, these projects run in isolated silos. I propose adding a "Link Session" or "Dependency Bridge" mechanism. Once linked, the LLM instance in Project A should be able to query or "talk" to the LLM instance/context of Project B.

Proposed Workflow:

  1. Open Project A and Project B in separate Opencode windows/tabs.
  2. In Project A, select an option to "Add Context from Active Session: Project B".
  3. When asking the LLM in Project A to write an integration code (e.g., "Write a function to fetch user data from the API"), the LLM can reference the actual implementation details (routes, DTOs, models) currently existing in Project B’s active session.

What are the benefits of implementing this?

Implementing this feature would significantly enhance developer productivity in multi-repo environments:

  • Seamless Integration Development: It eliminates the need to manually copy-paste code snippets (contracts, API schemas) from one project to another just to provide context to the LLM.
  • Real-time Synchronization: If a developer modifies an API endpoint in Project B, Project A's LLM immediately "knows" about the change, reducing integration bugs caused by outdated documentation or context.
  • Holistic Code Awareness: It mimics a "monorepo" experience for multi-repo setups, allowing the AI to understand the full flow of data from the database (Project B) to the UI (Project A).
  • Error Reduction: The LLMs can cross-verify types and method signatures between projects, acting as an intelligent integration linter.
Originally created by @enesgur on GitHub (Jan 23, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ### What do you want to change or add? I would like to propose a feature that allows two distinct active sessions (projects) within Opencode to communicate and share context with each other. **The Core Concept:** Imagine a scenario where a user has two open projects: * **Project A:** A consumer application (e.g., Frontend or a Dependent Service). * **Project B:** A dependency provider (e.g., Backend API or Core Library). Currently, these projects run in isolated silos. I propose adding a **"Link Session"** or **"Dependency Bridge"** mechanism. Once linked, the LLM instance in Project A should be able to query or "talk" to the LLM instance/context of Project B. **Proposed Workflow:** 1. Open Project A and Project B in separate Opencode windows/tabs. 2. In Project A, select an option to "Add Context from Active Session: Project B". 3. When asking the LLM in Project A to write an integration code (e.g., *"Write a function to fetch user data from the API"*), the LLM can reference the actual implementation details (routes, DTOs, models) currently existing in Project B’s active session. ### What are the benefits of implementing this? Implementing this feature would significantly enhance developer productivity in multi-repo environments: * **Seamless Integration Development:** It eliminates the need to manually copy-paste code snippets (contracts, API schemas) from one project to another just to provide context to the LLM. * **Real-time Synchronization:** If a developer modifies an API endpoint in Project B, Project A's LLM immediately "knows" about the change, reducing integration bugs caused by outdated documentation or context. * **Holistic Code Awareness:** It mimics a "monorepo" experience for multi-repo setups, allowing the AI to understand the full flow of data from the database (Project B) to the UI (Project A). * **Error Reduction:** The LLMs can cross-verify types and method signatures between projects, acting as an intelligent integration linter.
yindo added the discussion label 2026-02-16 18:07:01 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 23, 2026):

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

  • #9777: How do you handle multi-application collaboration and context handoff in OpenCode? (directly addresses cross-session context sharing for dependent applications)
  • #8043: Feature Request: Model-Agnostic Memory Layer (Global & Per-Project) (proposes persistent context/memory mechanism across sessions and providers)
  • #9649: [FEATURE]: Multi-Agent Coding (discusses agent collaboration and context handoff between different agents)

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

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #9777: How do you handle multi-application collaboration and context handoff in OpenCode? (directly addresses cross-session context sharing for dependent applications) - #8043: Feature Request: Model-Agnostic Memory Layer (Global & Per-Project) (proposes persistent context/memory mechanism across sessions and providers) - #9649: [FEATURE]: Multi-Agent Coding (discusses agent collaboration and context handoff between different agents) Feel free to ignore if none of these address your specific case.
Author
Owner

@antonio-ivanovski commented on GitHub (Jan 23, 2026):

Don't find the justification good enough for such a feature, also see that CC has done something similar.

Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used.

@antonio-ivanovski commented on GitHub (Jan 23, 2026): Don't find the justification good enough for such a feature, also see that CC has done something similar. Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used.
Author
Owner

@enesgur commented on GitHub (Jan 23, 2026):

Don't find the justification good enough for such a feature, also see that CC has done something similar.

Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used.

I see your point regarding the Shared Spec, and I agree it's the best approach for maintaining a "Single Source of Truth."

However, I feel that a Spec is the result of the work, not necessarily the best channel for the process itself.

When we are building a completely new feature (greenfield), there isn't a spec yet. The agents need to "negotiate" and handshake to decide on the data structures first. If we rely solely on reading/writing a file to coordinate, the feedback loop becomes much slower.

Think of it like debugging: If Agent A tries to consume an endpoint and fails, it should be able to tell Agent B, "Hey, this didn't work, check your parameters," directly. Doing this via a static file feels a bit too rigid and might reintroduce the need for manual intervention/testing.

Maybe a hybrid approach is the sweet spot? They communicate directly to iterate fast, but update the Shared Spec as the final output.

@enesgur commented on GitHub (Jan 23, 2026): > Don't find the justification good enough for such a feature, also see that CC has done something similar. > > Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used. I see your point regarding the Shared Spec, and I agree it's the best approach for maintaining a "Single Source of Truth." However, I feel that a Spec is the **result** of the work, not necessarily the best channel for the **process** itself. When we are building a completely new feature (greenfield), there isn't a spec yet. The agents need to "negotiate" and handshake to decide on the data structures first. If we rely solely on reading/writing a file to coordinate, the feedback loop becomes much slower. Think of it like debugging: If Agent A tries to consume an endpoint and fails, it should be able to tell Agent B, "Hey, this didn't work, check your parameters," directly. Doing this via a static file feels a bit too rigid and might reintroduce the need for manual intervention/testing. Maybe a hybrid approach is the sweet spot? They communicate directly to iterate fast, but update the Shared Spec as the final output.
Author
Owner

@qyi71 commented on GitHub (Feb 5, 2026):

Don't find the justification good enough for such a feature, also see that CC has done something similar.
Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used.

I see your point regarding the Shared Spec, and I agree it's the best approach for maintaining a "Single Source of Truth."

However, I feel that a Spec is the result of the work, not necessarily the best channel for the process itself.

When we are building a completely new feature (greenfield), there isn't a spec yet. The agents need to "negotiate" and handshake to decide on the data structures first. If we rely solely on reading/writing a file to coordinate, the feedback loop becomes much slower.

Think of it like debugging: If Agent A tries to consume an endpoint and fails, it should be able to tell Agent B, "Hey, this didn't work, check your parameters," directly. Doing this via a static file feels a bit too rigid and might reintroduce the need for manual intervention/testing.

Maybe a hybrid approach is the sweet spot? They communicate directly to iterate fast, but update the Shared Spec as the final output.

I’ve been thinking about this as well.
Would it be possible to achieve this by combining skills + memory?

For example, in a skill we could describe the OpenCode TUI interaction commands and CLI commands, and at the same time, in memory we could specify that the current session is allowed to query results from other sessions via OpenCode skills.

By “memory,” I mean something like .agent.md or .claude.md.

@qyi71 commented on GitHub (Feb 5, 2026): > > Don't find the justification good enough for such a feature, also see that CC has done something similar. > > Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used. > > I see your point regarding the Shared Spec, and I agree it's the best approach for maintaining a "Single Source of Truth." > > However, I feel that a Spec is the **result** of the work, not necessarily the best channel for the **process** itself. > > When we are building a completely new feature (greenfield), there isn't a spec yet. The agents need to "negotiate" and handshake to decide on the data structures first. If we rely solely on reading/writing a file to coordinate, the feedback loop becomes much slower. > > Think of it like debugging: If Agent A tries to consume an endpoint and fails, it should be able to tell Agent B, "Hey, this didn't work, check your parameters," directly. Doing this via a static file feels a bit too rigid and might reintroduce the need for manual intervention/testing. > > Maybe a hybrid approach is the sweet spot? They communicate directly to iterate fast, but update the Shared Spec as the final output. I’ve been thinking about this as well. Would it be possible to achieve this by combining skills + memory?  For example, in a skill we could describe the OpenCode TUI interaction commands and CLI commands, and at the same time, in memory we could specify that the current session is allowed to query results from other sessions via OpenCode skills.  By “memory,” I mean something like .agent.md or .claude.md.
Author
Owner

@wtfzambo commented on GitHub (Feb 13, 2026):

Don't find the justification good enough for such a feature, also see that CC has done something similar.

Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used.

@antonio-ivanovski Just yesterday I ended up in a situation where I thought a feature like this would have been helpful.

I had vibecoded a CLI tool for my personal needs and also had the AI write the tests. Because it wrote 198 test cases and it's kinda silly that one single AI is both judge and defendant, I thought I could pit two separate agents against each other:

  1. Agent 1 would first try to break the app as much as possible
  2. Agent 2 would have to write test cases for the things discovered by Agent 1, which would have to fail
  3. Agent 1 would then have to fix the code to make those test pass without being able to touch the tests
  4. ...
  5. rinse and repeat for a few loops.

It did work, but there was a lot of manual involvement and every time a new subagent would be spawned, instead of re-using the old ones. Ideally, this should be a conversation with very little to none user involvement, where agents retain their context for the entire session and are able to "pass the ball".

@wtfzambo commented on GitHub (Feb 13, 2026): > Don't find the justification good enough for such a feature, also see that CC has done something similar. > > Isn't it a better approach to have a shared spec that the two agents coordinate on and can both read from it. For example the spec can have tasks for backend and tasks for frontend with a special section of the API that will be used. @antonio-ivanovski Just yesterday I ended up in a situation where I thought a feature like this would have been helpful. I had vibecoded a CLI tool for my personal needs and also had the AI write the tests. Because it wrote 198 test cases and it's kinda silly that one single AI is both judge and defendant, I thought I could pit two separate agents against each other: 1. Agent 1 would first try to break the app as much as possible 2. Agent 2 would have to write test cases for the things discovered by Agent 1, which would have to fail 3. Agent 1 would then have to fix the code to make those test pass without being able to touch the tests 4. ... 5. rinse and repeat for a few loops. It did work, but there was a lot of manual involvement and every time a new subagent would be spawned, instead of re-using the old ones. Ideally, this should be a conversation with very little to none user involvement, where agents retain their context for the entire session and are able to "pass the ball".
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7383