Windows: shell commands run from C:\ while Codex UI shows project directory (relative paths break) (bug?)
What version of Codex CLI is running?
v0.106.0
What subscription do you have?
Plus
Which model were you using?
gpt-5.3-codex
What platform is your computer?
Windows 10, x64, (PowerShell)
What terminal emulator and version are you using (if applicable)?
Rider, PowerShell
What issue are you seeing?
Codex CLI on Windows shows one working directory in the header, but executes shell commands from a different directory (C:\).
This breaks relative paths and can produce incorrect answers about file existence.
What steps can reproduce the bug?
- Open PowerShell in a project directory on drive E: (or any non-C: path), for
example:
cd "E:\\\Project"
pwd
- Start Codex
- Confirm Codex header shows:
directory: E:\\\Project
- Run/ask Codex to run:
Get-Location
and
Test-Path '@Assets\some-directory\some-file'
- Observe that Get-Location reports C:\, and relative path checks are resolved
from C:\ instead of the directory shown in the header.
Minimal reproducible snippet inside Codex shell:
Get-Location
Test-Path 'Assets\some-directory\some-file'
Test-Path E:\\\Project\some-directory\some-file'
Observed:
- Get-Location => C:\
- relative Test-Path => False
- absolute Test-Path => True
<img width="1028" height="1174" alt="Image" src="https://github.com/user-attachments/assets/19ae673f-034c-468c-aae0-3ddb4620fbc9" />
What is the expected behavior?
If Codex header shows directory: E:\\\Project\, then shell commands should execute with that same working directory.
Get-Location should return the same directory shown in the header, and relative paths like Assets\Project\some-file should resolve correctly from project root.
P.S. Or am I missing something? I'm still new to using the CLI.
Additional information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗