Skip to content

[FEATURE]: Allow custom session ID when starting Opencode (e.g., --session my-project) #17344

@seekskyworld

Description

@seekskyworld

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, Opencode automatically generates a session ID when starting a new session. While this works well, it makes it difficult to organize or intentionally resume sessions for specific projects.

I would like to request support for manually specifying a session ID when launching Opencode, similar to how OpenClaw allows custom session identifiers.

Example:

opencode --session my-project

With this feature, users could:

  1. Start a session with a meaningful name
  2. Resume the same session later using the same session ID
  3. Organize multiple projects more easily
  4. Avoid relying only on auto-generated session IDs

Example workflow:

Start a session:
opencode --session my-project

Later resume the same session:
opencode --resume my-project

Benefits:

  • Better project-based session organization
  • Easier session recovery
  • More predictable workflows when using Opencode for multiple tasks
  • Improved scripting and automation possibilities

This feature would be especially useful for developers who use Opencode across multiple repositories or long-running development sessions.

If session IDs are currently auto-generated internally, this could potentially be implemented as an optional override flag while keeping the current default behavior unchanged.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions