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
I think it would be useful to be able to reference a different session using the @ symbol, so that the session's content would be available in the LLM's context.
Some ideas on how this could be implemented:
When creating a session title, also generate a slug using the AI. When typing @<that_slug> the LLM would have that session available in its context.
Generate a friendly but short slug (random or based on the session ID) - something like docker does for containers: vibrant_cray, competent_elgamal, etc. When typing @<that_slug> the LLM would have that session available in its context.
Use the session title after @, e.g. typing @Creat would show a completion window that would list Creating Dockerfile for opencode CLI which you can select. That session would then be available in the LLM's context.
One use case for this that just came up, though I could probably come up with numerous others:
I created a Dockerfile in the OC repo in the packages/opencode directory, but later realized that it would be better to have it in the repo root. I would like to cd to the repo root with the LLM retaining the context, but can't and have to start from scratch or use workarounds.
This issue might be a duplicate of existing issues. Please check:
Allow the model to get context from other sessions #968: Allow the model to get context from other sessions - This issue discusses linking sessions to share context between them, which is very similar to your @ symbol reference idea
[Feature Request] Fork session #1759: [Feature Request] Fork session - Discusses duplicating session state to new sessions, which relates to session context sharing
@rekram1-node Both would be nice, but this feature request is about referencing another session. The example was just one use case for the feature (the one that sparked the idea), though probably not the best one. Actually, this feature would address the existing issues the github bot linked, and those issues highlight better use cases than mine.
yeah not sure how we wanna approach this currently, I think rn the best thing for you would be writing a custom tool that lets the llm search previous sessions if it wants. Later on we will probably have some memory type of thing potentially
i dont think doing an @ reference will be best mechanism here
I think you'd be better off wrapping the sdk and making custom tools to search through sessions (which qualify as plugins) but yeah to some degree u could, tho we dont have a plugin for some parts that u may want like @ completions plugins
Activity
github-actions commentedon Oct 16, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 16, 2025
was your problem wanting to reference a different session? Or was it just the need to reference files outside cwd
veracioux commentedon Oct 16, 2025
@rekram1-node Both would be nice, but this feature request is about referencing another session. The example was just one use case for the feature (the one that sparked the idea), though probably not the best one. Actually, this feature would address the existing issues the github bot linked, and those issues highlight better use cases than mine.
rekram1-node commentedon Oct 16, 2025
yeah not sure how we wanna approach this currently, I think rn the best thing for you would be writing a custom tool that lets the llm search previous sessions if it wants. Later on we will probably have some memory type of thing potentially
i dont think doing an @ reference will be best mechanism here
iamhenry commentedon Nov 11, 2025
would a plugin be able to search the local db to accomplish this?
rekram1-node commentedon Nov 12, 2025
I think you'd be better off wrapping the sdk and making custom tools to search through sessions (which qualify as plugins) but yeah to some degree u could, tho we dont have a plugin for some parts that u may want like @ completions plugins
rohitpaulk commentedon Sep 28, 2026
Was this implemented? Searched docs but didn't find an easy way to reference another session
robin-brochier-mirakl commentedon Oct 2, 2026
@rohitpaulk
https://opencode.ai/v2/docs/sharing/
robin-brochier-mirakl commentedon Oct 2, 2026
You might export to markdown/json and import in the current session. But that's not really user friendly :-(
bharatvansh commentedon Oct 4, 2026
Really need this one, Very imp.