[FEATURE]: Allow custom session ID when starting codex CLI (e.g., --session my-project)
What variant of Codex are you using?
CLI
What feature would you like to see?
What would you like to be added?
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, Codex 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 Codex, similar to how OpenClaw allows custom session identifiers.
Example:
codex --session my-project
With this feature, users could:
Start a session with a meaningful name
Resume the same session later using the same session ID
Organize multiple projects more easily
Avoid relying only on auto-generated session IDs
Example workflow
Start a session:
codex --session my-project
Later resume the same session:
codex --resume my-project
Why is this needed?
Benefits:
Better project-based session organization
Easier session recovery
More predictable workflows when using Codex for multiple tasks
Improved scripting and automation possibilities
This feature would be especially useful for developers who use Codex 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.
Additional context
No response
Additional information
_No response_
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Session IDs are UUIDs, and they are created by the harness. Allowing them to be generated externally would break a number of scenarios, so we're unlikely to add such a feature. The name of the session is user-definable, so you can use that as a unique user-defined identifier if you'd like.
My understanding is that if the framework handles format validation and existence checks internally, it shouldn't lead to any additional destructive behavior? After all, Claude Code supports it. At the same time, not allowing a session ID to be specified makes it very difficult for third-party terminal managers to deeply bidirectionally bind and integrate with Codex's interactive sessions.
This is a very useful feature when being used in an enterprise environment. It has been very useful with Claude Code. ➕