Windows Codex desktop app creates an empty .git folder, then spawns git process repetitively
Open 💬 13 comments Opened Jun 22, 2026 by MinetaS
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.616.51431 • Released Jun 21, 2026
What subscription do you have?
Pro 5x
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What issue are you seeing?
When the project is not a Git repository, Codex creates an empty .git folder, then subsequently spawns Git processes with this cmdline:
"C:\Program Files\Git\cmd\git.exe" -c core.hooksPath=NUL -c core.fsmonitor=true rev-parse --show-toplevel
"C:\Program Files\Git\cmd\git.exe" config --null --get core.fsmonitor
(and more)
This list seems to match "Observed Commands" section reported in #29408.
What steps can reproduce the bug?
It's difficult to find out which kinds of prompt exactly reproduce the bug, but at some point Windows sandbox touches .agents, .codex, .git which eventually leads to multiple empty directories.
Sandbox log (timezone is UTC+9):
[2026-06-23 06:42:35.134 codex.exe] START: C:\Users\***\.codex\.sandbox-bin\codex.exe --codex-run-as-fs-helper
[2026-06-22T21:42:35.235850600+00:00] applied deny ACE to protect C:\Users\***\***\.agents
[2026-06-22T21:42:35.236659900+00:00] applied deny ACE to protect C:\Users\***\***\.codex
[2026-06-22T21:42:35.237416+00:00] applied deny ACE to protect C:\Users\***\***\.git
What is the expected behavior?
- Codex should not create
.agents,.codex,.gitempty directories randomly. - Codex should not repeatedly spawn Git processes when
.gitfolder is empty or malformed.
Additional information
I believe this issue is the first that enlightens the connection between an unexpected sandbox behavior and the Git process issue.
13 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
#28631 reported a similar bug but it's about VS Code extension on Linux/WSL.
This issue is about Windows desktop app, but the underlying cause may be likely identical.
I have the same issue, and it is problematic because the parent directory is where the real
.gitand.codexdirectories are located. As a result, the generated empty folder must be removed before new threads can correctly see my skills and git status again.My current workaround is to delete those folders and reload the skills, but I have dozens of submodules under the parent directory, so this is quite annoying.
I have the same issue, my codex creates a .git folder inside of my project folder(1 level below the project folder with original .git) and bugs my IDE
Same problem here. My workaround is a PowerShell script that finds empty .git folders and "git init"s them.
Before that, I had a loooot of Git processes spawning continuously; now, a few at the beginning and after nothing.
Same bug is back in todays build for me - the previous fix was to delete an orphaned
.gitfolder in.codexbut there isn't one there anymore.While waiting for a fix, I've taken the workaround script tip from @Apen and vibed a PowerShell script to identify and delete those empty folders. I now run it before any new thread and resumed 'normal' operation with codex.
The script searches from the root and enumerates all empty
.git,.codex,.agentsempty folders it finds and then deletes them; really saves me a lot of time.Where is this script?
Realistically where would I even have empty
.gitfolders created "by mistake"?I reccomend you vibe code with codex yourself, tailored for your specific case.
Here is my version, tailored for a multi module project:
In my case codex creates those 2-3 empty folders for every module I open in codex
note that the main
.gitfile would be atR:\eda\cted\.git, and so is the main.codexfolder.You must admit this is an absolutely gross fix - why are orphaned
.gitfolders being created in the first place?I ended up with creating empty
.agents,.codex,.gitfiles (not folders) with proper ACLs to mitigate this for now.It's kind of unfortunate that this has not been noticed by OpenAI teams yet. I'm seeing several duplicate issues which means there are quite amount of users impacted by this specific bug in sense of the performance degradation. Hopefully this will be addressed soon.
It looks like this behavior also triggers Windows Defender to continuously scan the git-hammered folder. In my case, this doubles or triples the performance hit caused by the bug.
It's extremely noticeable. I can hear my fans spinning and a second after closing Codex, everything quiets down.
this problem fuck me every day😭,can god resolve this,because company us tfs still