Skip to content

Scope Codex VS Code chats to the current workspace/project #25319

Open

Description

@omry

What variant of Codex are you using?

IDE Extension

cc @etraut-openai, opening this as a fresh feature request per your guidance in #17185 (comment).

What feature would you like to see?

In the Codex VS Code extension, chat/thread history should be scoped, grouped, or filtered by the current workspace/project.

Right now, chats from different projects appear together in one shared history list. When working across multiple repositories, VS Code windows, remote workspaces, WSL/SSH sessions, or unrelated codebases, it becomes easy to resume the wrong thread or confuse which chat belongs to which project.

This creates a real workflow problem because Codex threads carry project-specific context. Accidentally continuing a thread from another project can lead to irrelevant suggestions, wrong assumptions, and extra mental overhead.

A useful MVP could be:

  • Associate each thread with its originating VS Code workspace folder or working directory.
  • Show current-workspace threads first in the extension history.
  • Hide, collapse, or visually separate threads from other workspaces.
  • Provide an “all threads” view or toggle for users who intentionally want global history.
  • Preserve existing thread rename/archive behavior.

This does not need to introduce a full project-management system. The most important behavior is that when I am in Project A, I should not have to scan through chats from Projects B, C, and D to find the relevant Codex thread.

Additional information

This is related to the closed issue #17185, but I am opening a new feature request per maintainer guidance here:

#17185 (comment)

There is also related discussion in #12564, where the VS Code extension recently gained thread renaming. Renaming helps, but it is only a mitigation for the broader issue: chats from unrelated projects are still mixed together.

A commenter noted that Codex CLI already appears to have working-directory-based isolation by default, with codex resume --all available for showing all threads:

#17185 (comment)

If that is accurate, the VS Code extension could potentially reuse the same working-directory concept and expose it in the extension history UI.

Activity

  1. added
    enhancementNew feature or request
    extensionIssues related to the VS Code extension
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on May 30, 2026
  2. whatsupbros commented on May 30, 2026

    @whatsupbros

    I agree this is a natural fit for the next step after adding the capability to rename threads.

    One important thing though, that if filtration of threads by working directory is added to VS Code extension, there also should be a way to "Show All". Because, for instance, if you move or copy a project to a different directory, there should be a way to resume the old thread about this project in the new location as well.

  3. daxliniere commented on May 30, 2026

    @daxliniere

    This has my vote. When I'm working on an Arduino project, I don't need to see web development threads.

  4. JohnnyBill commented on Jun 2, 2026

    @JohnnyBill

    That would be so nice, especially for linux users that still don't have the app :)

  5. dyunwei commented on Jun 6, 2026

    @dyunwei

    This is very important for those working across multiple projects.

  6. max5800 commented on Jun 6, 2026

    @max5800

    I want to add a more severe real-world impact case here.

    This is not just a history/navigation issue. In my setup, Codex chat sessions appeared to leak across multiple VS Code windows and repositories, and this resulted in unintended changes being applied across multiple repos.

    Environment:

    • OS: macOS 26.5, arm64
    • VS Code: 1.123.0
    • Codex IDE extension: openai.chatgpt@26.602.40724
    • Variant: Codex IDE Extension in VS Code
    • Mode: local Codex agent session in VS Code. I do not have a reliable record anymore of whether this was normal Agent mode or Agent Full Access.

    Setup:

    • VS Code window A: a multi-root workspace with two repositories.
    • VS Code window B: another VS Code window with other repositories open, because I was working on a cross-repo task.
    • Codex IDE extension was used in these windows.
    • I suddenly saw the same Codex chat sessions in both VS Code windows.
    • Later I discovered that Dependabot-related changes that were supposed to happen only in one target repository had also been applied in multiple unrelated local repositories.

    Current local evidence, redacted:

    • Multiple unrelated repositories currently have unexpected untracked .github/dependabot.yml files.
    • The file modification timestamps are all within the same short time window, roughly under one minute.
    • Example current git status pattern across affected repos:
    repo A:
    ?? .github/dependabot.yml
    
    repo B:
    ?? .github/dependabot.yml
    
    repo C:
    ?? .github/
    
    repo D:
    ?? .github/
    
    repo E:
    ?? .github/
    

    Impact:

    • The extension did not give me a clear per-workspace/project boundary.
    • Chats from unrelated repositories were visible together in multiple VS Code windows.
    • Codex threads carry repository-specific context, but the UI did not protect against using that context in the wrong workspace.
    • This caused real unintended file changes across multiple repositories, not just confusing suggestions.
    • The operation looked like it was scoped to one target repo, but changes appeared in multiple repos.

    In my view this should be treated as a bug / safety issue, not only an enhancement request. Other coding assistants such as Claude and GitHub Copilot handle multi-window / multi-repo project separation in a way that does not expose the same kind of cross-repo session confusion.

    Expected behavior:

    • Threads must be scoped to their originating VS Code workspace folder / working directory by default.
    • In a VS Code window for Project A, sessions from Projects B/C/D should be hidden or clearly separated.
    • If a user tries to resume a thread from a different workspace, the extension should warn or block by default.
    • Multi-root workspaces should show explicit root ownership for each thread.
    • Codex should never silently apply changes to repositories outside the intended active workspace/root.
    • If the extension cannot safely determine the active workspace/root, it should fall back to read-only or ask for explicit confirmation before editing.

    Related issues:

  7. xsjk commented on Jun 7, 2026

    @xsjk

    I think #25319 should be separated from full multi-root workspace support in #2909.

    Multi-root is hard because VS Code can have many workspace folders in one window, while a Codex core session still has one effective cwd. That is a real model mismatch, and fixing it properly probably belongs in #2909.

    But the common single-root VS Code workspace case is much simpler. Codex already records cwd for each session, and thread/list.cwd already supports filtering by cwd.

    So the VS Code extension can fix the main #25319 problem by passing the current workspace folder / effective cwd into its thread/list requests. When no workspace folder is open, it can keep showing the global history; multi-root can keep today's effective behavior for now and leave true multi-root semantics to #2909.

    Until there is an official fix, Codex Workspace Filter can be used as a small workaround.

  8. zsxm1998 commented on Jun 8, 2026

    @zsxm1998

    I am curious about why this feature is not supported until now. When open codex in vscode, it is hard to find the thread I want from hundred of my chats.

  9. omry commented on Jun 8, 2026

    @omry
    Author

    Because #17185 didn't get enough interest from the community.
    Please upvote this one.

  10. xionghaizhi commented on Jun 8, 2026

    @xionghaizhi

    +1. I strongly support this request.

    I use the Codex VS Code extension across multiple repositories and VS Code windows every day, and the current global mixed history makes the extension much harder to use than it should be.

    The main issue is that Codex threads are project-specific by nature. A thread usually contains assumptions about a particular repository, file structure, build system, dependencies, and task context. When threads from unrelated projects all appear in one shared history list, it becomes very easy to reopen or continue the wrong conversation.

    This is not just a small navigation inconvenience. It creates real workflow risk:

    • It is hard to find the correct thread when many projects have similar task titles.
    • It is easy to resume a thread that belongs to a different repository.
    • The user has to manually remember which conversation belongs to which workspace.
    • Project-specific context can be confused across unrelated codebases.
    • In multi-window or multi-repo workflows, the history list becomes noisy very quickly.

    The CLI already appears to have a better mental model here by scoping resume behavior around the working directory, with an option to show all sessions. The VS Code extension should follow a similar model.

    A good MVP would be:

    • Show current-workspace threads by default.
    • Clearly display the workspace/project name for each thread.
    • Provide an optional “All threads” view for users who want global history.
    • Warn or make it explicit when reopening a thread from a different workspace.
    • Support multi-root workspaces by showing which root a thread belongs to.

    This would make the extension much safer and easier to use for people who work across multiple active projects. Right now, the lack of project/workspace separation is one of the biggest sources of friction in the VS Code extension.

  11. Efs-O commented on Jun 20, 2026

    @Efs-O

    For anyone affected by this before an upstream fix lands, I published a small experimental workaround:

    https://github.com/Efs-O/codex-sessions-workspace-patch-kit

    Current pre-release:

    https://github.com/Efs-O/codex-sessions-workspace-patch-kit/releases/tag/v0.4.0

    It patches the shipped openai.chatgpt VS Code extension bundle locally so Codex session history is filtered to the active VS Code workspace roots. It also widens thread/list requests before filtering, so older matching workspace sessions are less likely to be hidden behind newer sessions from unrelated workspaces.

    Compatibility note: this has been tested locally against openai.chatgpt 26.616.x extension bundles. It is a pre-release workaround, not an upstream source patch. Because it patches minified shipped extension code, a new Codex/VS Code extension version can overwrite the patch or change the anchors so the patch no longer applies.

    Please run the dry-run flow before applying:

    npm run scan
    npm run apply:dry
    npm run apply

    To undo it:

    npm run restore

    Feedback would be very helpful, especially reports about version drift, missing anchors, and workspace-history edge cases.

  12. AbrahamWilton commented on Jun 20, 2026

    @AbrahamWilton

    This is soo usefull! thanks. I just tested a few moments and works like a charm, but I have a question, this fix will only separated just at visual level or will separate at logical level, like you know, codex will not mix context or will do?

    Image
  13. 38 remaining items

  14. omry commented on Oct 13, 2026

    @omry
    Author

    @etraut-openai: Is this getting close to sufficient user support to prioritize?

    Thanks.

  15. chrishaly commented on Oct 14, 2026

    @chrishaly

    I support workspace-scoped session filtering.

    One additional request: please provide an option to automatically restore
    the last active session for each workspace when opening the Codex extension.

    Each workspace should remember its own last active session independently.
    At minimum, the session picker should offer a "Current workspace only"
    filter and remember that preference.

  16. mklilley commented on Oct 15, 2026

    @mklilley

    I support this request too 🙏

  17. tnoetzel commented on Oct 15, 2026

    @tnoetzel

    Please implement this. It's a serious problem impacting any dev with more than one project... which is, presumably, most serious devs.

  18. geraldnguyen commented on Oct 16, 2026

    @geraldnguyen

    Supporting this feature request.
    GH copilot separated chats from different projects. I was shocked to find this feature wasn't available.

  19. DImagine commented on Oct 16, 2026

    @DImagine

    +1 Supporting this feature request.

  20. indhra commented on Oct 17, 2026

    @indhra

    is this fixed?

  21. AwinHuang commented on Oct 21, 2026

    @AwinHuang

    Adding my use case: please support organizing and filtering Codex conversations by the active VS Code workspace, including multi-root .code-workspace workspaces.

    I use VS Code workspaces to group multiple folders for a project. However, conversations created while working in one workspace are still visible when I switch to another workspace, leaving unrelated project conversations mixed together.

    Expected behavior

    • Open workspace A: show the Codex conversations associated with workspace A.
    • Open workspace B: show the Codex conversations associated with workspace B.
    • Treat a saved multi-root workspace as an organization unit, rather than requiring users to manage each folder separately.
    • Offer a clear "Current workspace / All conversations" toggle, with the selected scope remembered.

    The important distinction is that a VS Code workspace can contain several folders or repositories. Filtering only by a single chat's working directory would not fully address this workflow; the conversation list should respect the workspace association.

    This should work through the normal VS Code workspace-opening flow, without requiring separate CODEX_HOME directories, separate VS Code user-data directories, duplicated configuration, or custom launch shortcuts. Manually prefixing conversation names helps identify them but does not remove unrelated conversations from the list.

    Environment: Windows x64, VS Code 1.142.0, Codex extension (openai.chatgpt) 26.1007.21434.

    The requested improvement is workspace-based conversation organization and visibility filtering; a separate account or security boundary is not required.

  22. Grapehool commented on Oct 21, 2026

    @Grapehool

    I support this feature request. This is a critical feature, please implement this!

  23. yfNJU commented on Oct 24, 2026

    @yfNJU

    I strongly support this request too!

  24. balabommablock-cpu commented on Oct 27, 2026

    @balabommablock-cpu

    Reading the 55 comments, people want three things, in this order:

    1. Current workspace first. Threads from the open folder by default, with an "All projects" switch (some people move folders, or want old threads back).
    2. Show where each thread lives. A folder name next to each thread, so a thread from another repo is never resumed by mistake. Several people hit exactly that (max5800, PanPelota, LenisLin).
    3. Multi-root .code-workspace support, and later, reopen the last thread for each workspace.

    The CLI already does #1 with cwd, and thread/list takes a cwd filter. But that filter is an exact match, so a thread started in repo/packages/web won't show in a window opened at repo, and multi-root needs a list of paths.

    The app-server also has experimental projects now (#38940): a project has ordered roots, thread/start takes a projectId, and thread/list can filter by it. That looks like a close fit for a VS Code workspace:

    • one VS Code workspace (a folder or a .code-workspace file) maps to one project, with its folders as roots
    • new threads start with that projectId, and the history list filters by it, with "All projects" as the escape hatch
    • old threads get matched once by cwd under any root, so history doesn't look empty after the update

    Smallest first version: filter to the current project, add the "All projects" toggle, and show a folder label on each thread. Last-thread restore can come later.

    I can't see the extension code, so I may be missing why this is harder there. Could a maintainer say whether projects are the intended path?

  25. harishsk commented on Nov 3, 2026

    @harishsk

    I would also like this feature in the Codex VS Code extension. When I open different project folders, I see Codex chats from all my projects together, which makes it harder to find the conversations relevant to the folder I am working in.

    Please add a “Current project / All projects” filter to the chat history, default to the current project folder, and remember the selection per VS Code workspace. Chats from other projects should remain available through the explicit “All projects” option.

    My goal is to keep each project's chat list local to that project when switching folders in VS Code.

  26. cixiangtao commented on Nov 3, 2026

    @cixiangtao

    @harishsk The “Current project / All projects” switch with a per-workspace preference is exactly the workflow I built Codex Project Chats for. Disclosure: I’m the author.

    Following up on the patch-based workaround I shared earlier in this issue, this is now available as a standalone companion extension:

    • Defaults to Current project, with an explicit All projects option, and remembers the selection per VS Code workspace.
    • Groups existing local conversations by their recorded working directory, with title search and project paths to distinguish similarly named folders.
    • Clicking a conversation opens it in the existing official Codex sidebar so you can continue there.

    Install: VS Code Marketplace
    Source and screenshots: GitHub

    It adds a separate project-history view without modifying the official extension. Current-project matching uses exact workspace-root directories, including multiple roots; subdirectories and worktrees remain separate groups accessible through All projects.

    End-to-end verification currently covers macOS Apple Silicon; other platforms and remote workspaces are not yet verified end to end. This is an independent, unofficial project, and the grouping is for navigation, not a sandbox or access-control boundary.

    I still support adding this directly to the official history UI; sharing this as an available workaround in the meantime.

  27. onemsg commented on Nov 12, 2026

    @onemsg

    Adding another concrete use case for this request from VS Code on macOS / Apple Silicon, with Codex extension openai.chatgpt version 26.1106.51428.

    When I open the chat history in Project A, conversations created in Projects B and C are also listed. I want to see only the current project's conversations while working in that project. Scanning unrelated history adds friction when switching between repositories.

    A small, focused UI improvement would address this:

    • Add a Current project / All projects selector to the chat history list.
    • Use Current project as the default, and remember the user's selection across reloads.
    • Apply the selected scope consistently to both the visible history list and history search.
    • For multi-root VS Code workspaces, include conversations associated with the workspace's folders.
    • Keep other projects' conversations intact and accessible through All projects; filtering should not require archiving, deleting, or moving session files.

    The key acceptance case is: with Project A open, selecting Current project hides conversations from unrelated Projects B and C; switching to All projects makes those conversations accessible again.

    Posting here to support the existing tracking issue rather than opening a duplicate.

  28. raulcarlomagno commented on Nov 13, 2026

    @raulcarlomagno

    Hi, I think that this issue must have high priority, it's a basic feature....

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 requestextensionIssues related to the VS Code extensionsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions