Windows: Opening Codex tab in non-Git workspace causes continuous git.exe spawning and high Defender CPU
Open 💬 5 comments Opened Jun 24, 2026 by mdyks01
💡 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)?
26.616.81150
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Observed
--------
- git.exe and conhost.exe continuously appear and exit.
- Microsoft Defender MsMpEng.exe CPU rises to ~8-10% and stays there.
- Behavior Monitoring is responsible.
- Simply opening the Codex tab reproduces the issue.
What steps can reproduce the bug?
Steps to reproduce
------------------
- Open a folder that is NOT a Git repository.
- Switch to the Codex tab.
- Do not issue any commands.
What is the expected behavior?
Expected
--------
Codex should detect a non-Git workspace once and stop retrying, rather than repeatedly launching git.exe.
Additional information
Additional observations
-----------------------
Opening the same project after running:
git init
completely eliminates the issue.
Opening a folder that is already a Git repository also does not reproduce the issue.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Close duplicate to #29492
Thanks for writing this up. I am seeing a related Windows Codex Desktop performance regression in #28855: since June 12, opening/using Codex Desktop can cause severe intermittent mouse/typing/system input lag, and it still persists for me on
OpenAI.Codex 26.616.10790.0.I linked your report in a broader Discussion collecting recent Windows Desktop performance reports here: https://github.com/openai/codex/discussions/29949#discussioncomment-17428007
No action needed from you unless you want to add more detail there, but I wanted to connect the reports because the recent Windows issues look related enough that they may need a canonical tracker.
Related confirmation from another Windows machine: I hit the same repeated Git-probing pattern, but in this case the immediate trigger was an empty/invalid
.gitdirectory inside a default Codex chat workspace under%USERPROFILE%\Documents\Codex\....ETW showed Codex repeatedly launching:
Before removing the empty
.git, a 120s sample saw 115 newgit.exeprocesses, 96 newconhost.exeprocesses, andMsMpEng.exeat ~55.6% of one CPU core.After deleting only that empty
.gitdirectory, a 60s sample saw 0 newgit.exe/conhost.exeprocesses andMsMpEng.exedropped to ~1.1% of one CPU core.I posted the detailed confirmation on #29911 since it matches the empty
.gitvariant more directly.The continuous
git.exespawning and downstream Defender CPU in a non-Git workspace here closely match the behavior I reproduced.I published a single-file Windows launcher for the original Microsoft Store/MSIX Codex app:
It starts Codex with a process-scoped
GIT_DIR=NUL. On my machine, the stable trace changed from 247 newgit.exeand 137 newtaskkill.exeprocesses per 10 seconds to 0 and 0 over 15 seconds; WMI Provider Host fell from about 6.6% to 0.9%.Usage: fully exit Codex from the Windows system tray, then run the script.
This is an unofficial workaround, not an upstream fix. It deliberately disables or limits Review, Changes, branch detection, commit, and other Git-backed Codex features. It does not patch Codex, modify repositories or Git configuration, write system environment variables, require elevation, terminate processes, or remove chat history. Launching Codex normally restores Git integration.