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
------------------

  1. Open a folder that is NOT a Git repository.
  2. Switch to the Codex tab.
  3. 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.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #29492
  • #29408
  • #28631

Powered by Codex Action

mdyks01 · 2 months ago

Close duplicate to #29492

Yassycodes · 2 months ago

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.

crash2kx · 1 month ago

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 .git directory inside a default Codex chat workspace under %USERPROFILE%\Documents\Codex\....

ETW showed Codex repeatedly launching:

git.exe -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --show-toplevel
git.exe config --null --get core.fsmonitor

Before removing the empty .git, a 120s sample saw 115 new git.exe processes, 96 new conhost.exe processes, and MsMpEng.exe at ~55.6% of one CPU core.

After deleting only that empty .git directory, a 60s sample saw 0 new git.exe / conhost.exe processes and MsMpEng.exe dropped to ~1.1% of one CPU core.

I posted the detailed confirmation on #29911 since it matches the empty .git variant more directly.

suiyuebaobao · 1 month ago

The continuous git.exe spawning 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 new git.exe and 137 new taskkill.exe processes 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.