You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex Windows App keeps spawning about 1000 git command per minute NON STOP #20567
Open Codex and stay at Playground project without opening any conversation. Won't stop if I create a new conversation. Won't stop if I restart the app. Stops when I completely exit Codex app and its system tray icon.
What is the expected behavior?
Codex won't hammer my computer with hundreds of git calls non-stop.
Additional information
No response
Reacted by Gustavo Baccan Gomes, Marr_Dev, Marshall and IBaa N. Yimcharoen
Similar to #17394 but can't say for sure it's the same situation. The w/a in that ticket didn't work.
I found a w/a that worked for me, that is to create .gitignore in the project with * in it, to exclude all files in the directory. Once this is done, no more git process hammering.
I had this same issue, and worked around it by adding a .gitignore for some large log/csv files that were in my project, and committing the rest of my unstaged changes. I believe this was caused by codex repeatedly trying git add -A which took a long time to process against several 5-10GB files.
The workload looked like file-by-file hashing of generated artifacts, especially JSON/HTML/MD/CSV/email-style files under hot output folders.
Diagnostics I collected:
I wrote a PowerShell watchdog that logs every git.exe process with parent process, grandparent process, command line, classification, path count, and recent hash-object count.
In the pre-mitigation logs, the bad rows were repeated hash-object --no-filters -- <file> invocations against generated artifacts.
After mitigation and a later Codex update, a fresh storm-only monitor run from 2026-06-11T17:35:19 to 2026-06-11T18:07:14 logged:
total git rows: 1582
HashObjectRows: 0
StormRows: 0
WouldKillStorm: 0
normal noise was mostly rev-parse, remote -v, status --porcelain, config core.fsmonitor, diff, ls-files, etc.
Mitigation that appears to have helped:
Moved future generated outputs into ignored scratch folders like _tmp/<workflow>/<run>/....
Added narrow .gitignore rules for historical hot generated folders and file types.
Updated local workflow/agent instructions so future runs do not create high-cardinality generated artifacts in Git-visible batch folders.
I also switched from a kill-all git.exe watchdog to a storm-only monitor so normal Codex Git probes are allowed and only hash-object fan-out is flagged.
My interpretation:
My repo hygiene likely amplified the issue by putting many generated artifacts in active workspaces.
But Codex probably still needs a product-side guardrail here: bounded/debounced/cached Git scans, cancellation, and avoiding per-file Git process storms over generated/ignored artifact directories.
It would also help to have a supported setting to disable or reduce Codex Git integration/polling on Windows.
I can provide a sanitized CSV excerpt from the watchdog if that would be useful.
I maintain a small workaround repo for one part of this Windows Git problem: visible/flashing git.exe console windows when Codex launches Git from the desktop app.
Important scope caveat: it does not reduce the number of Git commands Codex runs, so it is not a fix for CPU load, hash-object storms, or large generated-artifact scans. Repo hygiene / .gitignore rules are still the right mitigation for those parts of this issue.
What it can help with is the UX/security-confidence symptom where Git for Windows console windows flash repeatedly. The latest version prefers a native C++ GUI wrapper when a compiler is available, falls back to a managed wrapper otherwise, and keeps everything process-local to Codex without replacing the user's real Git or modifying persistent PATH.
Upstream, Codex still needs bounded/debounced Git scanning and hidden/no-window subprocess launch semantics on Windows.
Adding a post-update data point that may be related, but with a slightly different command shape.
Environment:
Windows 11
Codex Desktop process path after update: OpenAI.Codex_26.611.7849.0_x64__2p2nqsd0c76g0
I noticed the recent 0.140.0 release notes / #26880 mention Git/worktree responsiveness and preserving Git fsmonitor. That may help part of this issue, but I can still reproduce a Git process storm after that update.
Trigger context:
Branch/worktree cleanup in a repo with large generated/untracked artifact directories.
Switching branches exposed generated artifact folders that were no longer protected by the branch’s .gitignore.
The rows were file-by-file probes against generated artifact paths.
Local mitigation:
Added branch-independent excludes in .git/info/exclude for the generated artifact directories.
After restarting Codex and running an emergency watchdog, a fresh run showed:
hash-object: 0
StormHashObject: 0
The emergency watchdog still had to kill normal Codex Git probes temporarily while Codex settled.
My hypothesis:
The fsmonitor/worktree-read fix may reduce normal status / diff / ls-files cost.
But Codex can still enter a per-file hash-object --no-filters fan-out when large generated/untracked artifact dirs become visible during branch/worktree operations.
I can provide a sanitized watchdog CSV excerpt if useful. I’m avoiding raw logs because local paths include private project/customer names.
I did a simple test, and I think the problem is that the project has a .git folder, but doesn't have a .gitignore file, or it doesn't exclude folders that we usually exclude, such as node_modules/.
This causes the Codex app to traverse folders like node_modules/ when trying to track modified files, potentially crashing your computer. 😀
This should be treated as blocker severity for Codex Desktop.
Reason:
Codex Desktop is a coding agent whose primary workflow is opening Git workspaces. In affected workspaces, the app continuously spawns git.exe / git processes in the background while idle. On Windows, every spawned git.exe and the files it touches are inspected by Defender/corporate AV; on macOS, each git spawn can trigger Gatekeeper/code-signature checks via syspolicyd/trustd. This turns a background SCM watcher into a system-wide CPU/I/O storm.
Reacted by Untitled, tiq-ux, Andrei Simonov and AndreKR
I can corroborate this issue on a newer Codex Desktop build, and the impact extends beyond CPU usage into Windows kernel security-token pool growth (consistent with #30926).
Fresh reboot immediately before the controlled recording
GitLens was disabled for the entire recording
10-minute process trace
Total process starts/stops: 12,399 / 12,121
git.exe starts/stops: 4,038 / 4,017
Codex Desktop's main GUI process (binary name ChatGPT.exe) directly launched:
1,570 git.exe processes
1,565 taskkill.exe processes
Other direct Git parents:
VS Code: 268
Visual Studio: 134
codex.exe: 37
18 Git processes remained at the trace endpoint with parents that had already exited; they eventually cleared several minutes later.
The nearly one-for-one git.exe / taskkill.exe activity looks like a repeated command-abort/cleanup cycle. Observed commands rotated among status --porcelain, remote -v, rev-parse HEAD, rev-parse --git-dir, and config --null --get core.fsmonitor, with Codex's core.hooksPath=NUL / disabled-fsmonitor arguments.
A separate inspection of Codex Desktop logs from the same machine found 291 Git command completions: 279 were source=review_model requestKind=review-summary; 216 were abortedBeforeStart, 66 were aborted, and the longest observed command lasted 24,092 ms.
GitLens / VS Code control
GitLens was definitely inactive:
GitLens activation lines: 0
GitLens Git commands: 0
GitLens log files created: 0
VS Code's built-in Git integration logged 231 commands. This rules out GitLens as the cause and attributes the much larger burst to Codex Desktop.
Windows kernel impact
Exact PoolMon comparison over the same 10 minutes:
There was also substantial live-process growth during this workload (295 -> 539 processes; 149,712 -> 260,828 handles), and Toke correlated strongly with live process count (r=0.942). Therefore, not every allocation retained during this short interval is necessarily a permanent leak.
However, before reboot, after 10.24 days of uptime, this system had reached approximately 3.6 million outstanding Toke allocations / 6.23 GiB. Reboot reset it to 4,933 allocations / 8.56 MiB. That multi-gigabyte long-uptime retention is clearly abnormal and is consistent with sustained process churn exercising the Windows process-token duplication path described in #30926.
No third-party driver pool tag was implicated; the accumulating tags map to the Windows Security Manager (nt!se). Codex appears to be the user-mode trigger rather than the kernel allocator itself.
I have retained the raw process-event and PoolMon evidence locally and can provide sanitized CSV summaries if maintainers need them.
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.
I can reproduce this issue on Codex for Windows 26.707.3748.0
on Windows 11 build 22631.
I found a more specific trigger:
The workspace contained a .git directory that was completely empty
(no HEAD, config, index, or objects). A parent directory also contained
another empty .git directory.
Measurements before the workaround:
ETW captured 502 process starts in 20 seconds under Codex/ChatGPT:
314 git.exe, 172 conhost.exe, and 15 powershell.exe.
PoolMon showed the outstanding Proc/MiP2 allocations increasing by
approximately 2163 in 30 seconds, with no corresponding frees during
the observation period.
Leaving Codex running eventually caused system memory exhaustion.
Workaround and A/B verification:
Run git init in the affected workspace.
Remove the empty .git directory from the parent directory.
The Proc/MiP2 increase dropped from approximately 2163/30s to
approximately 20/30s, a reduction of about 99.1%.
The continuous git.exe process storm stopped.
Uninstalling Tencent PC Manager and disabling the ACE-BOOT driver did
not change the reproduction, so third-party security software is not
required to trigger the issue.
This suggests that repository discovery or Git snapshot/index refresh
enters an immediate retry loop when .git exists but is malformed or
empty.
Suggested regression cases:
Empty .git directory
Malformed .git directory or gitfile
Empty .git in a parent directory
Nested parent/child repository markers
The Git integration should treat an invalid repository as a controlled
error, use retry backoff/debouncing, and prevent concurrent or stale Git
refresh jobs from repeatedly spawning processes.
Activity
github-actions commentedon May 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
msg7086 commentedon May 1, 2026
Similar to #17394 but can't say for sure it's the same situation. The w/a in that ticket didn't work.
I found a w/a that worked for me, that is to create
.gitignorein the project with*in it, to exclude all files in the directory. Once this is done, no more git process hammering.monk-boop commentedon May 5, 2026
This didn't work. I'm getting hammered by github popups
msg7086 commentedon May 5, 2026
The w/a applies specifically to the issue I was hit. Maybe you hit a different bug.
For me once applying the w/a it stops hammering, then I can delete the
*and the issue won't come back.jrbdev1 commentedon May 8, 2026
I'm experiencing this issue as well. Windows 11 v 25H2, build 26200.8329.
Unless I put * in .gitignore it repeatedly opens Git for Windws in the background until it maxes CPU and crashed my machine.
rodneyliu90 commentedon May 12, 2026
I had this same issue, and worked around it by adding a .gitignore for some large log/csv files that were in my project, and committing the rest of my unstaged changes. I believe this was caused by codex repeatedly trying
git add -Awhich took a long time to process against several 5-10GB files.adamgwinn commentedon Jun 12, 2026
I’m seeing what looks like the same Windows
git.exefan-out pattern, with one additional detail that may help narrow the trigger.Environment:
OpenAI.Codex_26.608.1337.0What I observed:
Codex spawned many
git.exeprocesses underCodex.exe/codex.exe.During the bad state, the distinctive command was:
git.exe -c core.hooksPath=NUL -c core.fsmonitor= hash-object --no-filters -- <path>The workload looked like file-by-file hashing of generated artifacts, especially JSON/HTML/MD/CSV/email-style files under hot output folders.
Diagnostics I collected:
git.exeprocess with parent process, grandparent process, command line, classification, path count, and recenthash-objectcount.hash-object --no-filters -- <file>invocations against generated artifacts.2026-06-11T17:35:19to2026-06-11T18:07:14logged:1582HashObjectRows:0StormRows:0WouldKillStorm:0rev-parse,remote -v,status --porcelain,config core.fsmonitor,diff,ls-files, etc.Mitigation that appears to have helped:
_tmp/<workflow>/<run>/.....gitignorerules for historical hot generated folders and file types.git.exewatchdog to a storm-only monitor so normal Codex Git probes are allowed and onlyhash-objectfan-out is flagged.My interpretation:
I can provide a sanitized CSV excerpt from the watchdog if that would be useful.
rwang23 commentedon Jun 12, 2026
I maintain a small workaround repo for one part of this Windows Git problem: visible/flashing
git.execonsole windows when Codex launches Git from the desktop app.Repo: https://github.com/rwang23/codex-windows-console-guard
Important scope caveat: it does not reduce the number of Git commands Codex runs, so it is not a fix for CPU load,
hash-objectstorms, or large generated-artifact scans. Repo hygiene /.gitignorerules are still the right mitigation for those parts of this issue.What it can help with is the UX/security-confidence symptom where Git for Windows console windows flash repeatedly. The latest version prefers a native C++ GUI wrapper when a compiler is available, falls back to a managed wrapper otherwise, and keeps everything process-local to Codex without replacing the user's real Git or modifying persistent PATH.
Upstream, Codex still needs bounded/debounced Git scanning and hidden/no-window subprocess launch semantics on Windows.
adamgwinn commentedon Jun 17, 2026
Adding a post-update data point that may be related, but with a slightly different command shape.
Environment:
OpenAI.Codex_26.611.7849.0_x64__2p2nqsd0c76g0I noticed the recent
0.140.0release notes / #26880 mention Git/worktree responsiveness and preserving Git fsmonitor. That may help part of this issue, but I can still reproduce a Git process storm after that update.Trigger context:
.gitignore.Distinctive bad command:
git.exe -c core.hooksPath=NUL -c core.fsmonitor= hash-object --no-filters -- <generated-output-path>/...Watchdog evidence from 2026-06-16:
StormHashObject: 72hash-object: 72Local mitigation:
.git/info/excludefor the generated artifact directories.hash-object: 0StormHashObject: 0My hypothesis:
status/diff/ls-filescost.hash-object --no-filtersfan-out when large generated/untracked artifact dirs become visible during branch/worktree operations.I can provide a sanitized watchdog CSV excerpt if useful. I’m avoiding raw logs because local paths include private project/customer names.
SudoJacky commentedon Jun 18, 2026
I did a simple test, and I think the problem is that the project has a
.gitfolder, but doesn't have a.gitignorefile, or it doesn't exclude folders that we usually exclude, such asnode_modules/.This causes the Codex app to traverse folders like
node_modules/when trying to track modified files, potentially crashing your computer. 😀VMescheryakov commentedon Jun 26, 2026
This should be treated as blocker severity for Codex Desktop.
Reason:
Codex Desktop is a coding agent whose primary workflow is opening Git workspaces. In affected workspaces, the app continuously spawns git.exe / git processes in the background while idle. On Windows, every spawned git.exe and the files it touches are inspected by Defender/corporate AV; on macOS, each git spawn can trigger Gatekeeper/code-signature checks via syspolicyd/trustd. This turns a background SCM watcher into a system-wide CPU/I/O storm.
vesalbehrouzi commentedon Jul 20, 2026
I can corroborate this issue on a newer Codex Desktop build, and the impact extends beyond CPU usage into Windows kernel security-token pool growth (consistent with #30926).
Environment
OpenAI.Codex_26.715.7063.0_x64__2p2nqsd0c76g010-minute process trace
git.exestarts/stops: 4,038 / 4,017ChatGPT.exe) directly launched:git.exeprocessestaskkill.exeprocessescodex.exe: 37The nearly one-for-one
git.exe/taskkill.exeactivity looks like a repeated command-abort/cleanup cycle. Observed commands rotated amongstatus --porcelain,remote -v,rev-parse HEAD,rev-parse --git-dir, andconfig --null --get core.fsmonitor, with Codex'score.hooksPath=NUL/ disabled-fsmonitor arguments.A separate inspection of Codex Desktop logs from the same machine found 291 Git command completions: 279 were
source=review_model requestKind=review-summary; 216 wereabortedBeforeStart, 66 wereaborted, and the longest observed command lasted 24,092 ms.GitLens / VS Code control
GitLens was definitely inactive:
VS Code's built-in Git integration logged 231 commands. This rules out GitLens as the cause and attributes the much larger burst to Codex Desktop.
Windows kernel impact
Exact PoolMon comparison over the same 10 minutes:
Tokeoutstanding: 5,081 -> 7,800 (+2,719)Tokebytes: 9,251,392 -> 14,240,384 (+4,988,992 bytes)Toke,SeAt,SeTd,SeTl,SeDt): +6,990,400 bytesThere was also substantial live-process growth during this workload (295 -> 539 processes; 149,712 -> 260,828 handles), and
Tokecorrelated strongly with live process count (r=0.942). Therefore, not every allocation retained during this short interval is necessarily a permanent leak.However, before reboot, after 10.24 days of uptime, this system had reached approximately 3.6 million outstanding
Tokeallocations / 6.23 GiB. Reboot reset it to 4,933 allocations / 8.56 MiB. That multi-gigabyte long-uptime retention is clearly abnormal and is consistent with sustained process churn exercising the Windows process-token duplication path described in #30926.No third-party driver pool tag was implicated; the accumulating tags map to the Windows Security Manager (
nt!se). Codex appears to be the user-mode trigger rather than the kernel allocator itself.I have retained the raw process-event and PoolMon evidence locally and can provide sanitized CSV summaries if maintainers need them.
suiyuebaobao commentedon Jul 22, 2026
The nonstop Git command rate reported here closely matches the process storm 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.
lishiao144 commentedon Aug 3, 2026
I can reproduce this issue on Codex for Windows 26.707.3748.0
on Windows 11 build 22631.
I found a more specific trigger:
The workspace contained a
.gitdirectory that was completely empty(no HEAD, config, index, or objects). A parent directory also contained
another empty
.gitdirectory.Measurements before the workaround:
314 git.exe, 172 conhost.exe, and 15 powershell.exe.
approximately 2163 in 30 seconds, with no corresponding frees during
the observation period.
Workaround and A/B verification:
git initin the affected workspace..gitdirectory from the parent directory.approximately 20/30s, a reduction of about 99.1%.
Uninstalling Tencent PC Manager and disabling the ACE-BOOT driver did
not change the reproduction, so third-party security software is not
required to trigger the issue.
This suggests that repository discovery or Git snapshot/index refresh
enters an immediate retry loop when
.gitexists but is malformed orempty.
Suggested regression cases:
.gitdirectory.gitdirectory or gitfile.gitin a parent directoryThe Git integration should treat an invalid repository as a controlled
error, use retry backoff/debouncing, and prevent concurrent or stale Git
refresh jobs from repeatedly spawning processes.
Ronkiro commentedon Oct 1, 2026
Issue still happening as of latest version