Feature Request: resume the latest session in the current directory (follow-up to #4342)
What feature would you like to see?
I’m requesting a way to resume the most recent Codex session scoped to the current directory/workspace, not the global last session.
In #4342, I was advised to use codex resume --last, but that resumes the global latest session across all directories on the machine. The desired behavior is to resume the latest session for the current directory/workspace only.
Any of the following would work:
- New subcommand:
codex continue→ resume the most recent session whose session’s workspace equals the current directory - New flag:
codex resume --last-in-dirorcodex resume --continue - Scope flag:
codex resume --last --scope=dir(default remainsglobal)
Are you interested in implementing this feature?
Yes. Once the preferred UX (new subcommand vs flag) is confirmed, I’ll open a PR.
Additional information
This is a follow-up to #4342 to clarify scope: the request is directory/workspace-scoped resume.
Why this helps: when working across multiple repos, --last often resumes an unrelated repo’s session; users expect a directory-scoped resume invoked from a folder to continue that folder’s work.
If no matching session exists for the current directory, a friendly message is sufficient (e.g., suggest listing sessions in this directory or starting a new one).
cc @dedrisian-oai
3 Comments
New subcommand: codex continue → resume the most recent session whose session’s workspace equals the current directory
this would be awesome
@dedrisian-oai @nornagon-openai Following up after ~2 weeks for a maintainer decision on the dir-scoped resume proposal above. This would streamline session persistence without re-setup overhead in multi-repo workflows.
Ask: decision(approve or decline) and preferred UX? If aligned, I'll submit a PR. Thanks!
Closing in favor of #3856, which has more upvotes.