Codex CLI becomes unusable if the working directory from which it was launched is moved or removed
Resolved 💬 3 comments Opened Aug 13, 2025 by techjoec Closed Aug 13, 2025
What version of Codex is running?
0.21.0
Which model were you using?
n/a
What platform is your computer?
Windows 11 w/wsl2 running Ubuntu
What steps can reproduce the bug?
If you run codex from WSL in a directory such as C:\FOO\BAR\ and while inside the Codex CLI session C:\FOO\BAR\ is moved to C:\FOO\BLAH\ all future executions fail with "No such file or directory (os error 2)". Codex CLI seemed unable to cwd or execute other tricks to recover, and has to terminate to be usable again.
What is the expected behavior?
Either refuse to delete/move/etc the CWD from codex's launch, or ideally just handle it gracefully somehow. Sorry, not sure on a specific fix approach, but it definitely confused me for far too long tonight.
What do you see instead?
No such file or directory (os error 2)
Additional information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗