Windows Codex app repeatedly spawns git.exe/conhost.exe in Git workspaces, possibly contributing to Nonpaged Pool growth
Windows Codex app repeatedly spawns git.exe/conhost.exe in Git workspaces, possibly contributing to Nonpaged Pool growth
Summary
I am seeing a reproducible issue on Windows where the Codex desktop app appears to repeatedly spawn a very large number of git.exe and conhost.exe processes when a Git repository workspace/session is active.
The issue appears specific to Git repository sessions. When I switch to a non-Git folder/session, the high process creation rate drops almost immediately.
Environment
- OS: Windows 11 Home 25H2, OS Build 26200.8457
- Codex: Windows desktop app, OpenAI.Codex 26.602.4764.0
- Git: git version 2.43.0.windows.1
Project/session type
- Git repository workspace/session: issue reproduces
- Non-Git folder workspace/session: issue stops almost immediately
- Repository size: small
- Working tree: around 10 changed/untracked entries
- Manual
git status --shortruntime: about 58 ms
Observed behavior
When I open or keep a Git repository session active in Codex, git.exe and conhost.exe are spawned repeatedly at a very high rate.
In one 1-minute interval, I observed approximately:
git.exe: 1503 starts
conhost.exe: 746 starts
total process starts: 2266
In another 1-minute interval:
git.exe: 2607 starts
conhost.exe: 1303 starts
total process starts: 3915
When I switch away from the Git repository session or use a non-Git folder session, the process creation rate drops almost immediately.
ProcMon evidence
Repeated process start events include Git commands such as:
git.exe -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --git-path index
git.exe -c attr.tree= -c core.attributesFile= -c filter.lfs.clean= -c filter.lfs.smudge= -c filter.lfs.process= -c filter.lfs.required=false -c core.hooksPath=NUL -c core.fsmonitor= status --porcelain=v1 -z
git.exe -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --verify --quiet origin/main
git.exe -c core.hooksPath=NUL -c core.fsmonitor= remote
git.exe -c core.hooksPath=NUL -c core.fsmonitor= add -u
git.exe -c core.hooksPath=NUL -c core.fsmonitor= write-tree
The environment contains:
CODEX_SHELL=1
Some commands use a temporary Codex Git index:
GIT_INDEX_FILE=<temp>\codex-index-...\index
Impact
This appears to correlate with Windows Nonpaged Pool usage growing over time.
PoolMon shows growth in process-related tags including:
Proc
MiP2
PsIn
EtwS
Example PoolMon state after Codex Git activity:
Proc: Diff around 66,655, Bytes around 238 MB
MiP2: Diff around 66,656, Bytes around 102 MB
PsIn: Diff around 66,654
EtwS: Diff around 66,645
The git.exe processes do not appear to remain alive permanently. The main suspicious factor appears to be the extremely high process creation/termination rate. My best guess is that this process churn may be contributing to Windows kernel Nonpaged Pool usage accumulating over time.
I also tried reinstalling the current Windows version through Windows Update repair install while keeping apps/files/settings, but the issue still reproduces.
Expected behavior
I would expect Codex to avoid polling Git by spawning thousands of git.exe/conhost.exe processes per minute while a Git workspace is open or idle.
It would be helpful if Git status/diff/repository state could be cached, debounced, rate-limited, or handled in a way that avoids excessive subprocess churn.
Actual behavior
Opening or keeping a Git repository session active in Codex appears to trigger repeated Git subprocess creation, even when the repository is small, the working tree has only around 10 changed/untracked entries, and manual git status --short is fast.
Additional notes
This appears specific to Git repository sessions. A non-Git folder session does not show the same behavior, and switching away from the Git repository session stops the high process creation rate almost immediately.
I have redacted local user paths, machine names, and environment-specific values from the logs before sharing.
7 Comments
Adding another current Windows repro with retained
git.exeprocesses and multi-GB private memory growth.Environment
10.0.26100, 64-bitOpenAI.Codex_26.611.8604.0_x64__2p2nqsd0c76g0C:\Program Files\WindowsApps\OpenAI.Codex_26.611.8604.0_x64__2p2nqsd0c76g0\app\Codex.exegit version 2.54.0.windows.1.githas Dropbox ignore ADS set (com.dropbox.ignored=1)What I observed
After ruling out other major sources of memory pressure, Codex Desktop still appears to be the parent of heavy Git process churn in this workspace.
A high-resolution parent-PID snapshot trace over 90 seconds observed:
This trace used process parent snapshots only, not command-line capture.
During/after the trace, live
git.exeprocesses climbed to:Killing the pile with:
reset the count to zero, but the accumulation returned while the Codex Desktop project thread stayed open/active.
A later baseline, after cleanup and continued Codex use, again shows retained Git processes:
Manual
git status --shortfor the repo completed quickly (~45 ms), so ordinary Git status cost does not explain the number of retained processes by itself.Things ruled out in this case
git.exeprocesses; parent attribution pointed toCodex.exe.Impact
This can consume multiple GB of private memory just from retained
git.exeprocesses and makes a high-end Windows machine feel sluggish over time. It also complicates troubleshooting because the symptoms look like broad system memory pressure until the process tree is inspected.Expected behavior
Codex Desktop should bound/debounce Git polling and ensure spawned Git child processes are reaped. It would also help to expose a per-workspace setting to disable or reduce background Git status/snapshot polling, especially for synced folders or large/dirty repos.
Workaround
For now, using a projectless/non-repo thread for system diagnostics avoids triggering repo Git polling, and killing accumulated
git.exeprocesses temporarily restores memory. Ignoring.gitin Dropbox helps reduce sync churn but does not stop Codex from rebuilding the process pile.Adding a Windows repro/analysis pass with a tested candidate patch sketch. I am not opening a PR unless a maintainer explicitly asks for one, per
docs/contributing.md.Environment
10.0.26200OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g02.54.0.windows.163f009e9dad2e70454b7ed6434d8aa28dfb52b51Process churn measurements
I used a local PowerShell measurement script that:
Codex.exe/codex.exeancestry,Non-admin polling caveat: this likely undercounts very short-lived processes. CIM process-start events were denied in my non-admin shell with
0x80041003, and WPR failed without elevation with0xc5585011.Observed while Codex Desktop was active:
| Scope | Duration |
git.exe|conhost.exe|powershell.exe| Notes ||---|---:|---:|---:|---:|---|
| all matching processes | 20s | 21 starts, 63/min | 43 starts, 129/min | 23 starts, 69/min | includes non-Codex machine activity |
| Codex descendants only | 15s | 24 starts, 96/min | 29 starts, 116/min | 14 starts, 56/min | parent-chain filtered to
Codex.exe/codex.exe|| Codex descendants only | 30s | 30 starts, 60/min | 51 starts, 102/min | 28 starts, 56/min | measured during attempted WPR run |
The descendant-filtered runs are the most relevant. Even with polling undercounting, I still see steady
git.exeandconhost.exechurn under the Codex process tree.Source path that looks like an amplifier
Two open-source paths still fan out one Git process per untracked file:
codex-rs/tui/src/get_git_diff.rsget_git_diffrunsgit ls-files --others --exclude-standard, then runsgit diff --no-index ...once per untracked file.codex-rs/git-utils/src/info.rsdiff_against_shadoes the same.gitDiffToRemoteviacodex-rs/app-server/src/request_processors/git_processor.rs.Hypothesis: if Desktop/app-server refreshes Git diff state periodically or on workspace events, a workspace with many untracked files can amplify one refresh into many short-lived
git.exelaunches. On Windows those launches also produceconhost.exechurn, which matches the symptoms in this issue.Candidate patch sketch tested locally
I prepared a local patch, but have not opened a PR:
Focused tests passed locally:
This does not prove that the private Desktop UI is calling
gitDiffToRemoteat the problematic frequency, but it verifies that one plausible OSS amplification path can be bounded without breaking the existing focused tests.If this mitigation direction aligns with the team's intended architecture, I can turn the local patch into a focused PR after an explicit maintainer invitation.
---
Adding one smaller Windows-specific candidate in addition to the bounded-untracked-diff sketch above.
Current source path:
codex-rs/git-utils/src/info.rs::run_git_command_with_timeout_fromcodex-git-utils.tokio::process::Commandexposescreation_flags.Local candidate patch:
Why this is narrower than changing the generic shell/tool spawn path:
#[cfg(windows)].Local validation against
origin/mainf774455c3a831dfab2c6f37a1f624b8097f6f2c2:cargo test -p codex-git-utils-> 22 passedcargo fmt --check-> passed; stable rustfmt emitted repo-config warnings thatimports_granularityis nightly-onlygit diff --check-> passedBoundary:
CREATE_NO_WINDOW.As before, I will not open a PR without an explicit maintainer invitation.
Have same issue. Codex spawns a large number of git.exe every few seconds. Even though they close immediately, it causes windows pool memory to grow over time and after about 12 hrs system is sluggish/non responsive. No other way to recover apart from rebooting. Do not have this problem if I do not run codex.
Version 26.623.42026 • Released Jun 26, 2026
This bug is back again today ...
Adding another Windows Desktop data point. My visible symptom is repeated short-lived
powershell.exe/conhost.exeflashes from Codex Desktop. This looks related to the same Windows child-process churn class discussed here, even though in my trace the clearest repro was the shell snapshot/probe path rather than retainedgit.exeprocesses.Environment
10.0.26200, 64-bitOpenAI.Codex_26.623.19656.0_x64__2p2nqsd0c76g0C:\Program Files\WindowsApps\OpenAI.Codex_26.623.19656.0_x64__2p2nqsd0c76g0\app\Codex.execodex-cli 0.142.5git version 2.47.1.windows.17.6.0What I observed
With Codex Desktop open, I saw repeated visible black console flashes. A non-admin polling trace captured short-lived child processes parented by the Codex Desktop app, with matching transient
conhost.exeprocesses.The repeated command shape was:
That process was parented by:
Each probe could create a visible
conhost.exe, which is what caused the annoying cmd/terminal flash.I first disabled a BrowserOS MCP server to rule out MCP startup/process churn. The flashes still happened, so that was not the cause in this case.
Repro steps
shell_snapshotfeature enabled.shell_snapshot, fully quit and reopen Codex Desktop.Current workaround
This stopped the visible flashes for me:
Then fully quit and reopen Codex Desktop.
After the workaround, my feature state is:
So this does not disable shell tool usage. It only disables the shell snapshot feature. The likely tradeoff is worse repeated shell startup/snapshot performance, but the Desktop console flashing stopped.
Expected behavior
Codex Desktop should not spawn visible Windows console windows for background probes/snapshots. If these child processes are needed, they should be launched hidden/no-window on Windows, and high-frequency Git/shell polling should be bounded/debounced separately.
Severity escalation: 554 Git starts in 20 seconds, and current Desktop still has no true Review-off mode
A controlled Windows
Win32_ProcessStartTracecapture during Codex task switching recorded:git.exestarts in 20 secondsrev-parse,remote -v,config core.fsmonitor, andstatus --porcelainUser impact was not a cosmetic Task Manager spike: mouse input and the whole desktop stalled. This reproduced on a high-end workstation with ordinary development repositories; it is not reasonably explained by weak hardware or an enormous monorepo.
The strongest A/B was repository scope:
That containment required migrating 68 saved tasks away from their real Git roots. A user should never have to break the app's natural project/workspace association just to keep the machine responsive.
The original storm was captured on Desktop
26.707.3748.0. Read-only inspection of the current26.707.8479.0production bundle shows the Git Review setting schema still accepts only:There is still no
off. Last Turn Only is not off. It does not satisfy users who need Codex to stop passive Review/index/status work while retaining normal shell access to Git when they explicitly request it.Required action:
This has persisted across multiple releases and can make a top-tier workstation feel unusable. It needs a product fix, not another user-side cleanup workaround.
Adding a current Windows Desktop repro with an exact snapshot cadence and a controlled dirty/clean A/B.
Environment
26200OpenAI.Codex_26.707.12708.0_x642.40.1.windows.1Repeated snapshot path
While the Git-backed task remains open and no user Git action is requested, the app repeatedly launches the same temporary-index snapshot path at approximately 2.1-second intervals:
The cadence is especially damaging when one snapshot takes nearly the entire interval.
Controlled A/B
Before cleanup, the root had 519 tracked status entries and 3,809 non-ignored untracked files. A copied-index
add -upluswrite-treesnapshot had a median runtime of approximately 2,041 ms.All changes were first captured on local recovery refs. After restoring the root to a clean state, the same copied-index path produced:
Median: 200.4 ms, about a 10x improvement. A separate clean worktree measured approximately 148 ms.
Repository cleanup therefore greatly reduces per-snapshot cost, but it does not address the unconditional cadence or Windows child-process churn. Sparse worktrees should improve cost further, but they are not a substitute for scheduling control.
Current control surface
Read-only inspection of this installed bundle shows:
git-review-modeaccepts onlyfullandlast-turn-only;off,on-turn, ormanualmode;ghost_snapshotconfig structure exposes only large-untracked-file/directory and warning controls, not an enabled/disabled switch.Requested mitigation
Please add a supported per-workspace Git snapshot policy:
automaticon-turn/ event-drivenmanualoffFor
on-turn, a safe baseline could be captured at task start or immediately before the first mutating action, then refreshed at turn completion, diff/review, undo, or an explicit user/agent request. Passive project navigation should not continuously runadd -uandwrite-tree.Independently, snapshots should be single-flight, debounced, cancellable when superseded, and coalesced by normalized worktree root.