Warn before accessing a project that conflicts with the thread’s selected workspace
What variant of Codex are you using?
Codex Desktop
What subscription do you have?
Plus
What feature would you like to see?
Codex Desktop should detect when a prompt explicitly identifies a project path or repository that conflicts with the workspace selected for the current thread.
Before reading files, running commands, or making changes in the other project, Codex should warn the user and require confirmation.
Example
- Open Project A in Codex Desktop and start a new thread.
- Accidentally paste a prompt intended for Project B.
- The prompt explicitly says to confirm that the working directory is Project B and check its Git branch.
- Project B exists locally and its branch matches the pasted prompt.
- Codex silently uses an explicit working directory to inspect Project B, even though the thread is still associated with Project A.
This happened in a real session. Codex successfully inspected Project B and reported that everything matched. It did not identify the conflict between the selected workspace and the prompt.
No files were modified in this instance, but the same flow could have continued with edits, dependency installation, builds, commits, or deployment commands in Project B while the conversation remained grouped under Project A.
Why this matters
This is a subtle data-integrity and safety risk because the operation may succeed without producing any obvious error.
It can cause:
- edits or commands in the wrong repository;
- project-specific
AGENTS.mdinstructions being mixed; - conversation history being grouped under the wrong project;
- relative-path commands operating in Project A while commands with explicit paths operate in Project B;
- builds, Git operations, and browser verification targeting different projects;
- confusion when the thread is resumed or compacted later.
The silent-success case is more dangerous than a failed command because the user may not realize that project boundaries have been crossed.
Suggested behavior
When all of the following are true:
- the thread is associated with a saved project/workspace;
- the prompt explicitly specifies a filesystem path or repository;
- that path resolves to a different project or Git root;
Codex should pause before accessing it and show a warning such as:
This thread is associated with Project A, but your prompt refers to Project B. Continue in Project B, switch projects, or cancel?
This should be a confirmation guardrail rather than a prohibition, so intentional multi-repository workflows remain possible.
The check should compare at least:
- thread workspace root;
- current working directory;
- resolved Git repository root;
- explicitly requested project path.
Expected behavior
Codex should not silently treat a project path in a potentially copied prompt as overriding the workspace selected for the conversation.
Environment
- Product: Codex Desktop
- Version: 26.623.13972.0
- Platform: Windows x64
- Subscription: Plus
Related issues
This appears related to, but distinct from:
- #24224 — workspace state leaking across concurrent sessions
- #28977 — showing project, cwd, and Git branch in the thread UI
- #16403 — refreshing project instructions after cwd changes
- #5237 — reading files outside the working directory
Those issues concern leaked state, visibility, instruction refresh, or filesystem access. This request concerns detecting a direct semantic conflict between the selected thread workspace and a different project explicitly named in the prompt.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗