-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
What feature would you like to see?
Problem
codex resume --last currently resumes the globally most recent session.
For users working on multiple projects in parallel, this behavior is often unintuitive and unhelpful. The globally “last” session is frequently unrelated to the current working directory (CWD), which breaks the expectation that Codex sessions are tied to the directory in which the tool is invoked.
By contrast, running codex resume without flags opens a TUI that lists sessions scoped to the current working directory. This behavior aligns much better with typical workflows and is what I initially expected resume --last to do.
Expected Behavior
codex resume --last should behave as follows:
-
Resume the most recent session associated with the current working directory (CWD)
-
Be functionally equivalent to:
- running
codex resume, and - automatically selecting the most recent session shown in the CWD-scoped TUI
- running
In other words, --last should resolve the most recent session within the current working directory, rather than the most recent session across all directories.
Why This Matters
For users managing multiple active projects, the global “last session” is rarely the correct one. Requiring interaction with the TUI introduces unnecessary friction into everyday workflows.
The core use case is the ability to resume the correct Codex session for the current working directory with a single, non-interactive command. This is essential for setups where Codex is launched via a keyboard shortcut or script (for example from a terminal multiplexer), where any additional selection step breaks the flow.
Making resume --last CWD-scoped would allow reliable, scriptable, one-command session startup per project, enabling Codex to be used comfortably as a day-to-day development tool.
Suggested Options
-
Change
resume --lastto be scoped to the current working directory -
OR introduce an explicit alternative flag, for example:
codex resume --last-cwdcodex resume --local-last
Additional information
No response