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 v2]: Feature request: Start and continue a session with opencode run -s (modify flag behavior) #60127
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Note: this is a copy of this popular issue, which was auto-closed with a comment asking to re-create it (which is done here). 14 likes and 7 (closed) dups — so that's a pretty popular request.
Below is a copy of the original description:
Hi guys,
Hope you are well.
I would like to make a feature request, I think this would be a wise and efficient design choice, even somewhat popular:
Modify the behavior of the opencode run --session flag.
Current behavior:
Input: opencode run --session ses-abc (or abc) hello Output: "Resource not found" (if ses-abc) or "Invalid string - must start with ses" if plain abc.
Desired behavior:
Input: opencode run --session abc hello Output: "Hello how can I be of assistance?"
Here opencode will create session abc if it doesn't exist and continue it if it exists.
Thanks for carrying this over from #3434. I think this is a duplicate of #50464. OpenCode v2 already does what you describe: since #51405 (in v2.1.4 and later), --session / -s continues the session if it exists and creates it with that ID if it doesn't:
opencode run -s ses_abc "hello"# creates ses_abc on first run
opencode run -s ses_abc "and now?"# continues it afterwards
The one difference from your example: session IDs must start with ses, so -s abc on its own is still rejected. Use something like ses_abc instead.
Possible duplicates and related issues, ordered by likelihood:
If you're on v2.1.4 or later and it doesn't work for you, please share opencode --version and the exact command and error. If what you mainly need is IDs without the ses prefix, please reply to say so. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.
We haven't heard back, so I'm closing this as a duplicate of #50464. Since v2.1.4, opencode run --session <id> (-s) continues the session if it exists and otherwise creates it with that ID. That change came in #51405. Session IDs must start with ses, so use e.g. -s ses_abc rather than -s abc.
If it doesn't work for you on v2.1.4 or later, or you specifically need IDs without the ses prefix, please open a new issue with your opencode --version and the exact command and error. Thanks!
Activity
opencodejr commentedon Oct 29, 2026
Thanks for carrying this over from #3434. I think this is a duplicate of #50464. OpenCode v2 already does what you describe: since #51405 (in v2.1.4 and later),
--session/-scontinues the session if it exists and creates it with that ID if it doesn't:The one difference from your example: session IDs must start with
ses, so-s abcon its own is still rejected. Use something likeses_abcinstead.Possible duplicates and related issues, ordered by likelihood:
--sessionIf you're on v2.1.4 or later and it doesn't work for you, please share
opencode --versionand the exact command and error. If what you mainly need is IDs without thesesprefix, please reply to say so. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.Hi-Angel commentedon Oct 29, 2026
Just tested on 2.2.0 — unless I'm missing something, doesn't work for me.
Got a session named
ses_main:Executing
opencode -s ses_mainjust creates a new empty session.opencodejr commentedon Oct 30, 2026
We haven't heard back, so I'm closing this as a duplicate of #50464. Since v2.1.4,
opencode run --session <id>(-s) continues the session if it exists and otherwise creates it with that ID. That change came in #51405. Session IDs must start withses, so use e.g.-s ses_abcrather than-s abc.If it doesn't work for you on v2.1.4 or later, or you specifically need IDs without the
sesprefix, please open a new issue with youropencode --versionand the exact command and error. Thanks!Hi-Angel commentedon Oct 30, 2026
Bot is misbehaving. CCing maintainers: @arvsrn @Hona (sorry if I mistagged someone, judged by the commits list).
Hi-Angel commentedon Nov 1, 2026
Ping?