Better error message for broken symlink `~/.codex`

Resolved 💬 1 comment Opened Sep 16, 2025 by rben01 Closed Nov 23, 2025

What version of Codex is running?

codex-cli 0.36.0

Which model were you using?

N/A

What platform is your computer?

Darwin 25.0.0 arm64 arm

What steps can reproduce the bug?

In order to sync my codex config across machines, I store it in a git repo located elsewhere and then I symlink ~/.codex to the right folder in that repo. Recently I renamed the git repo folder but forgot to update the ~/.codex symlink. This resulted in needing to reauthenticate (which didn't raise any flags because I'd just updated macOS, so I figured some kind of cache had been cleared or similar). However, authentication failed with an opaque Error: File exists (os error 17), as did trying to just run codex. Only after trying to cd ~/.codex and getting a much more descriptive error did I realize what the issue was.

What is the expected behavior?

When encountering this error, a more descriptive error should be displayed to the user, such as “broken symlink ~/.codex”. The error message displayed when cd ~/.codex failed was cd: '/Users/rben01/.codex' is a broken symbolic link to '/Users/rben01/path/to/folder'.

What do you see instead?

Error: File exists (os error 17)

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗