Skip to content

Codex Windows App keeps spawning about 1000 git command per minute NON STOP #20567

Open

Description

@msg7086

What version of the Codex App are you using (From “About Codex” dialog)?

Codex
26.429.20946
© OpenAI

What subscription do you have?

Enterprise

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

I captured Process Create events under parent Codex.exe and counted 461 git.exe command runs per 30 seconds, so 900+ runs per minute.

Rotating among below commands

C:\Programs\SmartGit\git\bin\git.exe write-tree
C:\Programs\SmartGit\git\bin\git.exe add -u
C:\Programs\SmartGit\git\bin\git.exe add -- (redacted-file-names-under-playground-directory)
C:\Programs\SmartGit\git\bin\git.exe status --porcelain=v1 -z
C:\Programs\SmartGit\git\bin\git.exe rev-parse --git-path index
C:\Programs\SmartGit\git\bin\git.exe add -A
C:\Programs\SmartGit\git\bin\git.exe ls-files --others --exclude-standard -z

Logfile of 30 seconds.csv

What steps can reproduce the bug?

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

Activity

  1. added
    app
    on May 1, 2026
  2. added
    bug
    windows-os
    on May 1, 2026
  3. msg7086 commented on May 1, 2026

    @msg7086
    Author

    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.

  4. monk-boop commented on May 5, 2026

    @monk-boop

    This didn't work. I'm getting hammered by github popups

  5. msg7086 commented on May 5, 2026

    @msg7086
    Author

    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.

  6. jrbdev1 commented on May 8, 2026

    @jrbdev1

    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.

  7. rodneyliu90 commented on May 12, 2026

    @rodneyliu90

    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.

  8. adamgwinn commented on Jun 12, 2026

    @adamgwinn

    I’m seeing what looks like the same Windows git.exe fan-out pattern, with one additional detail that may help narrow the trigger.

    Environment:

    • Windows 11
    • Git for Windows
    • Codex Desktop: pre-update package visible in process command line was OpenAI.Codex_26.608.1337.0
    • Codex later updated during my test window; I can add the exact post-update version from About Codex if useful.

    What I observed:

    • Codex spawned many git.exe processes under Codex.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:

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

  9. rwang23 commented on Jun 12, 2026

    @rwang23

    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.

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

  10. adamgwinn commented on Jun 17, 2026

    @adamgwinn

    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.

    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: 72
    • hash-object: 72
    • 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.

  11. SudoJacky commented on Jun 18, 2026

    @SudoJacky

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

  12. VMescheryakov commented on Jun 26, 2026

    @VMescheryakov

    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.

  13. vesalbehrouzi commented on Jul 20, 2026

    @vesalbehrouzi

    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

    • Windows 11 Enterprise x64, build 26200
    • Codex Desktop package: OpenAI.Codex_26.715.7063.0_x64__2p2nqsd0c76g0
    • Git for Windows 2.35.1
    • 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:

    • Toke outstanding: 5,081 -> 7,800 (+2,719)
    • Toke bytes: 9,251,392 -> 14,240,384 (+4,988,992 bytes)
    • Aggregate security-manager tags (Toke, SeAt, SeTd, SeTl, SeDt): +6,990,400 bytes

    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.

  14. suiyuebaobao commented on Jul 22, 2026

    @suiyuebaobao

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

  15. lishiao144 commented on Aug 3, 2026

    @lishiao144

    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:

    1. Run git init in the affected workspace.
    2. Remove the empty .git directory from the parent directory.
    3. The Proc/MiP2 increase dropped from approximately 2163/30s to
      approximately 20/30s, a reduction of about 99.1%.
    4. 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.

  16. Ronkiro commented on Oct 1, 2026

    @Ronkiro

    Issue still happening as of latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions