project-scoped session persistence
What variant of Codex are you using?
CLI
What feature would you like to see?
A project-stopped session persistence mechanism to allow a session resume that is project and/or project-activity scoped rather than the current codex --resume --last, or manual session-id management.
Proposal:
new command-line option: e.g. codex --session-file _<file-path>_
usage: via codex --session-file .codex-session
Instructs codex to write the session-id to the specified file when the session ends, rather than just outputting it to stdout in the form of a message as it currently does. It may also want to include the usage stats in this file as that is also out-of-band data that is most useful in a structured format owned by codex connected to the session.
When starting a codex session; if --session-file <path> is present it would automatically resume the specified session.
Goals:
- To improve non-sequential work with multiple projects and better context management for multiple activities.
- Improve the functionality for human driven sessions and agent driven sessions. Cleanly enable shared human and agent activity on the same project with flexible scoping.
Additional information
You could also consider a more human oriented change addition to the proposal with slightly less friction.
_--use-session-file_ where the name of the session-file is hardcoded.
While it might break some existing wrappers, usage-stats and current session-id message should maybe written to stderr, rather than stdout.