Windows Codex Desktop Local mode: agent commands run from C:\ while integrated terminal uses project directory

Open 💬 3 comments Opened May 3, 2026 by cyruan815

What version of the Codex App are you using (From “About Codex” dialog)?

26.429.30905

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

In Codex Desktop on Windows, I opened a project with Add Project / Open Project and started a Local mode thread under that project.

The integrated terminal is correctly opened in the project directory:

D:\path\to\project

However, when I ask the Codex agent in the chat to run:

Get-Location

the agent command output returns:

C:\

So the integrated terminal and the agent-run command environment appear to have different current working directories.

This is confusing because the UI shows the thread is under the project and Local mode is selected, but agent-run PowerShell commands do not start in the project directory.

What steps can reproduce the bug?

Uploaded thread: 019ded06-0f99-7473-9e89-b2073dfee992

Steps to reproduce:

  1. Open Codex Desktop on Windows.
  2. Use Add Project / Open Project.
  3. Select a project folder, for example:

D:\path\to\project

  1. In the left sidebar, click the project entry and create a new thread from that project.
  2. Make sure the bottom mode selector shows Local mode.
  3. In the Codex chat, ask the agent to run:

Get-Location

  1. Observe that the chat/tool output returns:

C:\

  1. Open the integrated terminal in the same thread.
  2. Run:

Get-Location

  1. Observe that the integrated terminal returns the correct project path:

D:\path\to\project

The integrated terminal cwd is correct, but the agent command runner cwd is C:\.

What is the expected behavior?

In a Local mode project thread, agent-run PowerShell commands should start in the selected project directory, matching the integrated terminal cwd.

For this project, when the agent runs:

Get-Location

I expect it to return:

D:\path\to\project

instead of:

C:\

The integrated terminal and the agent command runner should use the same project working directory, or the agent command runner should inherit the Local project cwd.

Additional information

Screenshots show:

  1. The thread is under the project in the sidebar.
  2. Local mode is selected at the bottom of the composer.
  3. The integrated terminal returns the correct project path:

D:\path\to\project

  1. The agent-run chat command Get-Location returns:

C:\

Workaround:
If I explicitly prepend every agent command with:

Set-Location -LiteralPath "D:\path\to\project";

then commands work as expected. But this has to be done inside the same command invocation, because the next agent-run command may again start from C:\.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗