You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let codex summarize the file: codex --yolo "summarize README.md"
What is the expected behavior?
A summary of the file.
What do you see instead?
Additional information
I already deleted ~/.codex and reinstalled codex. Codex is able to create files and in the same session can read those files. But in a new session it can't read those files again.
For anyone running into this problem, here is my case
The Codex cli always runs commands by calling:
bash -lc "your command"
(for example, bash -lc "ls -la" or bash -lc "pwd").
If you’re using fish (or any shell other than bash) as your main shell, this can break if your ~/.bash_profile or ~/.bashrc forces bash to immediately exec into another shell. In my case, my ~/.bash_profile looked like this:
Because of the exec /bin/zsh -l, bash never actually ran the command — it just switched over to zsh and stopped, causing empty output for codex cli
Fix:
Check your ~/.bash_profile or ~/.bashrc for any lines like exec /bin/zsh -l (or exec fish -l) and remove them. After I removed that line, Codex worked perfectly again, even though my main shell is still fish.
Reacted by Johannes Villmow, Martin Knopf and Yifei Wang
Reacted by Johannes Villmow, Martin Knopf and Yifei Wang
Activity
looper200 commentedon Sep 11, 2025
also its can't suggest files using @
MartinKnopf commentedon Sep 12, 2025
Thanks for mentioning. Fuzzy search using @ works in interactive mode. But it can't read the files that I point it to.
icianfi commentedon Sep 13, 2025
same issue here, seems sandbox limitation.
minhluuquang commentedon Sep 13, 2025
For anyone running into this problem, here is my case
The Codex cli always runs commands by calling:
bash -lc "your command"
(for example, bash -lc "ls -la" or bash -lc "pwd").
If you’re using fish (or any shell other than bash) as your main shell, this can break if your ~/.bash_profile or ~/.bashrc forces bash to immediately exec into another shell. In my case, my ~/.bash_profile looked like this:
Because of the exec /bin/zsh -l, bash never actually ran the command — it just switched over to zsh and stopped, causing empty output for codex cli
Fix:
Check your ~/.bash_profile or ~/.bashrc for any lines like exec /bin/zsh -l (or exec fish -l) and remove them. After I removed that line, Codex worked perfectly again, even though my main shell is still fish.
MartinKnopf commentedon Sep 15, 2025
Thank you @minhluuquang! Your fix worked for me.
Umupa commentedon Oct 26, 2025
I ran into a similar issue and was able to resolve it by integrating the filesystem MCP tool. Here’s the exact configuration that worked for me:
~/.codex/config.toml
With this setup, the Codex CLI can properly access and read files from the specified directory, effectively resolving the file access problem.
Feel free to replace "your/project/path" with the actual path to your project. Hope this helps!