Windows Codex app spawns 12–13 git.exe processes per second and recreates invalid empty .git directories
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- git
- Domain
- desktop, devtools, performance
Research direction
Start by reproducing the idle process loop on Windows with a local directory containing an empty .git directory, then trace the desktop app's Git detection and process-launch path around git rev-parse --show-toplevel and the related commands listed here. Done means invalid repositories are handled without recreating empty .git directories or repeatedly spawning git.exe and conhost.exe while idle; verify with process tracing and the reported restart scenario.
Written by the indexing model from the issue text.
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.707.9981.0
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64 (Windows 11)
What issue are you seeing?
The Windows Codex desktop app enters a continuous Git process-spawning loop when local Codex project entries are not valid Git repositories.
I traced process creation at 50 ms intervals. During a 15-second period when Codex was otherwise idle:
- The main
ChatGPT.exeprocess directly launched 193git.exeprocesses. - This is approximately 12.9 direct Git launches per second.
- There were 443 total process starts during the interval.
- Many Git processes launched additional
git.exeandconhost.exechildren.
During a separate 70-second trace:
- 620
git.exestarts - 621
git.exestops - 452
conhost.exestarts - 452
conhost.exestops
The initial Git processes were confirmed as direct children of the main ChatGPT.exe, not a Codex command runner, PowerShell tool call, or user-invoked terminal.
The repeatedly executed command is:
"C:\Program Files\Git\cmd\git.exe" -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --show-toplevel
Additional Git commands include:
git.exe -c core.hooksPath=NUL -c core.fsmonitor=false rev-parse HEADgit.exe -c core.hooksPath=NUL -c core.fsmonitor=false status --porcelaingit.exe -c core.hooksPath=NUL -c core.fsmonitor=false remote -vgit.exe config --null --get core.fsmonitor
The affected non-Git project locations contain completely empty .git directories. They have no HEAD, config, index, objects, commondir, or gitdir.
Running git rev-parse --show-toplevel manually in those locations fails with exit code 128:
fatal: not a git repository (or any of the parent directories): .git
I renamed the empty .git directories to timestamped backups. The already-running app continued launching Git at approximately 12.8 times per second.
I then fully restarted only the Codex/ChatGPT desktop app. Codex recreated the empty .git directories and the new main ChatGPT.exe process immediately resumed the loop:
- 182 direct Git launches in 15 seconds
- Approximately 12.2 launches per second
- 432 total process starts
The process storm causes unnecessary CPU/process activity, additional Microsoft Defender scanning, system heating, fan noise, and reduced responsiveness. Program Compatibility Assistant CPU spikes have also been visible in Task Manager, although my two short PCA sampling windows happened to catch that service idle, so I am not claiming a directly measured PCA causal relationship.
What steps can reproduce the bug?
- Install or launch Codex desktop app version
26.707.9981.0on Windows. - Open a local Codex project that is not a Git repository.
- Allow Codex to sit idle with no agent or command actively running.
- Inspect the process tree using Task Manager, Process Explorer, or process-creation tracing.
- Observe the main
ChatGPT.exerepeatedly launchinggit.exe rev-parse --show-topleveland related Git commands. - Inspect the affected project directory and observe an empty, invalid
.gitdirectory. - Rename the empty
.gitdirectory and restart Codex. - Observe Codex recreate the empty
.gitdirectory and immediately resume launching approximately 12–13 Git processes per second.
For comparison, separate valid Git projects on the same computer return exit code 0 from git rev-parse --show-toplevel and contain normal Git metadata.
What is the expected behavior?
For a local directory that is not a valid Git repository, Codex should:
- Detect the Git failure once.
- Treat the directory as a normal non-version-controlled local project.
- Avoid creating an empty or invalid
.gitdirectory. - Cache the non-Git result or use an appropriate retry backoff.
- Recheck only after a relevant filesystem change, explicit refresh, or sufficiently long interval.
- Avoid continuously spawning
git.exeandconhost.exeprocesses while idle.
When Codex is idle and no task is running, CPU usage and background subprocess activity should return close to zero.
Additional information
Git version:
git version 2.34.1.windows.1
No usernames, private repository names, conversation contents, or unrelated local paths are included in this report.
Potentially related issues:
- #17229 — Windows app repeatedly spawning
git.exeandconhost.exe - #19201 — High-CPU loop with non-Git project entries
- #22085 — Windows Git process spawning and sustained CPU
The additional observations in this report are:
- Exact measured rate of approximately 12–13 direct Git launches per second
- Parent process confirmed as the main
ChatGPT.exe - The behavior continues while completely idle
- Empty
.gitdirectories contain no valid repository metadata - Codex recreates the invalid empty
.gitdirectories after a complete app restart - Renaming the empty directories without restarting does not stop the cached loop
- The loop persists across a new
ChatGPT.exeprocess instance
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·