Empty `.codex` file created at repo root
Resolved 💬 3 comments Opened Mar 31, 2026 by howardjohn Closed Apr 2, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.4
What platform is your computer?
Linux
What terminal emulator and version are you using (if applicable)?
Alacritty + Tmux
What issue are you seeing?
When I use codex I get a .codex file (not folder) in the root of my repo. This file is empty and seems to serve no purpose (other than to annoy me 🙂 ). This seems new since 0.118
What steps can reproduce the bug?
run codex, ls -a
What is the expected behavior?
_No response_
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
https://github.com/openai/codex/issues/16088
I can reproduce this on native Ubuntu/Linux as well, and I have some A/B evidence that may help narrow the cause.
Environment:
0.118.0/usr/bin/bwrapversion0.9.0Observed artifact:
.codex0444Example metadata from
stat .codeximmediately after creation:What I tested:
1. When Linux sandboxing is broken, the file does not appear
With Ubuntu/AppArmor restrictions in the failing state:
In that state, Codex work that failed early because the local sandbox was broken did not create
.codexin the repo.2. When Linux sandboxing works,
.codexappearsI reproduced the same
.codexcreation under two different ways of making sandboxing work:A. Targeted AppArmor workaround
After installing a path-scoped AppArmor exception for the native Codex binary:
Then real Codex work in a repo caused
.codexto appear.B. Global sysctl workaround instead of AppArmor profile
I removed the AppArmor profile, then used the broader workaround:
After that, sandboxing worked again and the same
.codexfile was created during Codex work.This seems important: the artifact is not tied to the AppArmor profile workaround itself. It happens under both workaround methods. The common factor is that the Linux sandbox path is functional.
3. It is not just
/reviewI first noticed it with
/review, but after more testing I confirmed that once sandboxing is functional, any real local Codex work path seems able to trigger it.4. It is not every Codex invocation
Some shallow invocations did not reproduce it, for example trivial
codex exectests. The file appeared when Codex started doing actual repo-local work.Likely interpretation
This looks like a native Linux variant of the same general bug described in #16088:
.codexpath is being materialized incorrectly as a host-side empty file,.codex/directory only when explicitly intended.The strongest native-Linux signal from my side is:
.codex.codexappears.codexappearsSo the trigger seems to be successful local Linux sandbox execution plus real repo-local work, not the specific workaround used to enable sandboxing.