Skip to content

Feature Request: resume the latest session in the current directory (follow-up to #4342) #4545

Closed as duplicate

Description

@Nhahan

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-dir or codex resume --continue
  • Scope flag: codex resume --last --scope=dir (default remains global)

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

Activity

  1. williamhrs commented on Oct 10, 2025

    @williamhrs

    New subcommand: codex continue → resume the most recent session whose session’s workspace equals the current directory

    this would be awesome

  2. Nhahan commented on Oct 14, 2025

    @Nhahan
    Author

    @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!

  3. etraut-openai commented on Nov 14, 2025

    @etraut-openai
    Contributor

    Closing in favor of #3856, which has more upvotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions