Codex Desktop on Windows triggers kernel Token/Toke growth via repeated git.exe process creation
Windows Codex Desktop triggers kernel Token/Toke object growth via repeated git.exe process creation
Summary
On Windows 11, Codex Desktop appears to trigger sustained growth of Windows kernel Token objects / pool tag Toke.
The local ETW evidence points to the Codex Desktop GUI process repeatedly launching git.exe for repository/root detection. Closing Codex stops the Token object growth; reopening Codex starts it again.
This does not look like a normal Codex.exe user-space memory leak. The missing RAM is mostly kernel/system memory: Paged Pool, Nonpaged Pool, Page Table, and very high kernel object counts.
Environment
- OS: Windows 11 Pro, build
28000 - RAM:
63.38 GB - Codex package:
OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0 - Codex executable/product version observed locally:
149.0.7827.197 - Git path used by Codex:
C:\Program Files\Git\cmd\git.exe
High-level symptom
Task Manager/RAMMap showed high used RAM that was not attributable to normal user processes.
Local counters showed:
Tokenobjects around1.25Mto1.29MTokenhandles only around2.1KPaged Poolaround6.9 GBNonpaged Poolaround2.55 GB- User-mode Codex working set was much smaller than the missing RAM.
The Token objects vs Token handles mismatch suggests kernel-held references, not visible user handles.
Close/reopen confirmation
After closing Codex Desktop:
- Observation window:
2026-07-02T16:37:38to2026-07-02T16:52:39 CodexProcesses=0throughoutToken objects:1,289,018 -> 1,288,882- Delta:
-136over 15 minutes
After reopening Codex Desktop:
- Observation window: 60 seconds
CodexProcesses=9Token objects:1,289,270 -> 1,289,550- Delta:
+280in 60 seconds
ETW/WPR evidence
Two local WPR pool traces were captured and analyzed with TraceEvent.
First trace:
- Events read:
126,078,389 Tokeallocations:42,299Tokefrees:41,848- Net
Tokecount:451 - Net
Tokebytes:812,544 - Largest outstanding
Tokestack: first processCodex.exe,Count=420,Bytes=752,448
Second mostly-idle trace:
- Events read:
131,809,943 Tokeallocations:36,605Tokefrees:36,415- Net
Tokecount:190 - Net
Tokebytes:355,200 - Largest outstanding
Tokestack: first processCodex.exe,Count=272,Bytes=487,488
Symbolized kernel stack:
NtCreateUserProcess
PspAllocateProcess
PspInitializeProcessSecurity
SeSubProcessToken
SepDuplicateToken
ObCreateObjectEx
ObpAllocateObject
ExAllocatePoolWithTag
This is the Windows process creation / security token duplication path.
Process-start evidence
The second trace contained 1,264 process start events.
Largest direct parent group:
- Parent:
Codex.exe, PID18932 - Child:
git.exe - Count:
263starts in approximately54.6seconds
Command-line grouping:
225starts:
"C:\Program Files\Git\cmd\git.exe" -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --show-toplevel
38starts:
"C:\Program Files\Git\cmd\git.exe" config --null --get core.fsmonitor
Additional direct child starts from Codex.exe:
powershell.exe:55starts, mostly process inventory viaGet-CimInstance Win32_Process
Local app inspection
Read-only inspection of the installed app.asar showed code paths using:
gitManager.getWorktreeRepository(...)git rev-parse --show-toplevelcore.fsmonitor
I did not find a user-facing setting in this build to disable the Git polling / review Git query behavior.
Expected behavior
Codex Desktop should not create hundreds of git.exe child processes per minute for stable workspace root detection, and should not cause unreclaimable Windows kernel Token/Toke object growth during long-running sessions.
Actual behavior
Codex Desktop repeatedly launches git.exe from the GUI process. On this system, that process churn correlates with Token/Toke growth in the Windows kernel. Closing Codex stops new growth; reopening Codex resumes growth.
Related public issues
- https://github.com/openai/codex/issues/17229
- https://github.com/openai/codex/issues/29700
- https://github.com/openai/codex/issues/29729
- https://github.com/openai/codex/issues/30389
Privacy / attachments
I have local ETW traces and CSV summaries, but the raw ETL files are very large and may contain local paths/process details. I would prefer not to attach full logs or ETL files publicly. I can provide sanitized summaries or share raw traces privately if requested by OpenAI maintainers.
---
Additional issue-age context checked on 2026-07-02
Related Windows Git/process and memory-retention reports are not isolated:
- #16786 opened 2026-04-04, still open: repeated git.exe on Windows.
- #17229 opened 2026-04-09, still open: Codex Windows App repeatedly starts git.exe.
- #20567 opened 2026-05-01, still open: git.exe/conhost.exe remain after app close.
- #29700 opened 2026-06-23, still open: memory leak / kernel memory symptoms.
- #29729 opened 2026-06-23, closed as duplicate: stale git.exe process/token objects.
- #30389 opened 2026-06-28, closed as completed: Windows kernel memory retention.
The current local evidence adds ETW/WPR stack-level data and close/reopen token-object deltas.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Post-reboot update: I found a much more specific local trigger.
After a fresh Windows reboot, the active Codex workspace contained an empty
.gitdirectory. It was not a valid Git repository:Even though this
.gitwas invalid,Codex.exerepeatedly launched:10-minute measurement before removing the empty
.gittrigger:9,937 -> 24,321+14,384, about+1,424/min0.763 GB -> 0.823 GB0.642 GB -> 0.659 GBgit.exeprocesses were present and parented byCodex.exeI then renamed the empty
.gitdirectory out of the workspace path, without deleting it.10-minute measurement after removing the empty
.gittrigger:26,734 -> 27,112+378, about+37.7/min1,597 -> 1,597git.exeprocesses:0 -> 0So the strongest minimal repro candidate is:
.gitdirectory, not a valid Git repo.git.exe rev-parse --show-toplevelcalls fromCodex.exe..gitdirectory and observe that repeatedgit.execalls stop and Token growth drops sharply.This points specifically to invalid/empty
.githandling causing a repeated Git probing loop, rather than normal Git repo activity.Follow-up valid Git repo test:
I tested whether the same
git.exechurn reproduces with a valid Git repository and clean status. It did not reproduce the massive loop seen with an empty/invalid.git.Setup:
.gitcreated withgit init.git rev-parse --show-toplevelsucceeded.git rev-parse --is-inside-work-treereturnedtrue.git status --porcelain=v1 -zwas empty before and after the measurement..git/info/excludeso the repo status stayed clean.10-minute measurement:
27,333 -> 28,404+1,071, about+106.7/min1,660 -> 1,656git.exeprocesses:0 -> 0git.exeprocess count:2git.exe > 0:1 / 1211.130 GB -> 1.171 GB0.970 GB -> 0.997 GBComparison:
.git:+14,384Token objects in 606 seconds, about+1,424/min, repeatedgit.exe rev-parse --show-toplevel.+1,071Token objects in 602 seconds, about+106.7/min,git.exeobserved in only one sampled interval.Limitations:
Conclusion: the rapid
git.exeprobing loop appears specific to empty/invalid.githandling. A valid Git repository with clean status did not reproduce the same churn in this test.Additional minimal workspace repro requested through OpenAI Support case
10865001.Git version/source
git --version:git version 2.54.0.windows.1C:\Program Files\Git\cmd\git.exeObserved repeated commands:
Minimal projectless Codex workspace repro
I attempted to pre-create an empty folder with an empty
.gitand open that exact folder through a Codex projectless thread. The available thread API created a fresh workspace with a-2suffix instead, so I could not force the exact pre-existing-folder-open sequence through that API.I then tested in that brand-new projectless Codex workspace by creating an empty
.gitwhile the workspace was open in Codex. The workspace was otherwise empty except for Codex'soutputsdirectory.Setup:
.gitentry count:0git rev-parse --show-toplevel:fatal: not a git repository, exit code128Phase A, empty
.gitpresent while Codex was open:2026-07-02 20:09:12to2026-07-02 20:19:53local time,641seconds27130,592 -> 46,559+15,967, about+1,494.57/min1,684 -> 1,685git.exeprocesses:2 -> 2git.exeprocess count:4git.exe > 0:244 / 271,90.04%1.540 GB -> 1.685 GB, delta+0.145 GB1.414 GB -> 1.461 GB, delta+0.047 GBRemove
.gitwhile Codex remains openI renamed/removed
.gitfrom the workspace path while Codex was still open and did not restart Codex before the next measurement.Phase B, after renaming/removing the empty
.git, no Codex restart:2026-07-02 20:21:16to2026-07-02 20:31:56local time,640seconds12147,660 -> 47,561-99, about-9.28/min1,696 -> 1,683git.exeprocesses:0 -> 0git.exeprocess count:0git.exe > 0:01.743 GB -> 1.770 GB, delta+0.027 GB1.492 GB -> 1.496 GB, delta+0.004 GBConclusion: the empty/invalid
.gittrigger reproduces strongly in a minimal projectless Codex workspace. Removing/renaming the empty.gitwhile Codex remains open stops thegit.exeloop and Token object growth without requiring a Codex restart. This lines up with the earlier valid-repo test: a valid clean Git repo did not reproduce the massivegit.exeloop.I am seeing what appears to be the same issue on Windows 11.
In-app Codex feedback session ID:
019ee25c-ca99-7c93-b434-1997d09c7386
Environment:
Observed behavior:
Controlled observations:
Example measurement with Codex active and OneDrive closed:
Example measurement after stopping Codex / ChatGPT / OneDrive:
This looks consistent with the issue described here: Codex appears to trigger Windows kernel memory / pool growth. In my case OneDrive and endpoint protection may amplify the issue, but Codex appears to be the repeatable trigger.
Independent reproduction on two Windows PCs (desktop app and native PowerShell CLI)
I independently reproduced the same progressive whole-system slowdown on two different, high-end Windows computers. This is not ordinary CPU or RAM exhaustion: after Codex has run long goals for hours to days, mouse/keyboard input, window dragging, video playback, and Windows generally become increasingly stuttery. Closing task/UI windows does not restore responsiveness; a Windows Restart restores it immediately for another few hours.
Environment for the measured reproduction
OpenAI.Codex_26.707.9981.00.144.20.144.4[windows] sandbox = "elevated"Live measurements while Windows was severely degraded
The machine still had about 139 GB available RAM. Total CPU was only about 18–22%, with no meaningful processor queue, paging, disk, GPU, DPC, or thermal pressure.
Instead, the abnormal state was:
lsass.exehad roughly 82,000–90,000 handles and often consumed close to one logical CPU core.82,584 -> 82,669in 30 seconds (+85)82,847 -> 83,002in about 57 seconds (+155)dwm.exewas consuming roughly 1.2–1.6 CPU cores, matching the visible whole-desktop/window-dragging stutter despite low GPU activity.git.exeprocesses. At least one observedgit.exewas directly parented by the desktop host process.After one of the two goals entered the paused state, Git concurrency fell to approximately 4–6 processes, and one LSASS sample changed from
89,971 -> 89,949over 30 seconds. This suggests pausing/stopping the workload reduces new churn, but the accumulated Windows state does not materially recover.Native Windows sandbox churn
A read-only count of one day's Codex Windows sandbox log showed approximately:
setup refresh: spawningentriesThe log shows
codex-windows-sandbox-setup.exebeing spawned and ACL setup being applied for nearly every shell command. This is consistent with the process/security-token churn described in this issue.Other observations
config.toml, but temporarily disabling Defender as a diagnostic test had zero visible effect on the system lag. This makes Defender an unlikely primary cause in this reproduction.Interpretation / request
This independently supports the mechanism in this issue: high-frequency Codex Git and native Windows sandbox process creation appears to cause sustained security-token/kernel-object retention, eventually overloading LSASS/DWM and degrading the entire desktop. It also overlaps with the kernel-pool evidence in #31212.
Please investigate:
git.exeprocesses.Related reports: #31212, #17229, #16374, #28855, #16786 and discussion #14758.
Raw session databases, source paths, repositories, and unredacted logs are intentionally not attached publicly. Sanitized samples or private diagnostics can be provided to OpenAI maintainers if requested.
Controlled post-restart A/B: leak resumes after goals restart with invalid
.gittrigger removedFollowing the earlier report, I ran this controlled sequence on native Windows:
.gitdirectories implicated by the minimal reproduction, and verified that neither original.gitpath existed.A 46-second active measurement after resuming showed:
git.exe: 15-24 throughout the interval.gitpaths remained absentDuring the corresponding roughly two-minute sandbox-log interval, I counted:
setup refresh: spawningeventsInterpretation: an empty/invalid
.gitdirectory appears to be a real amplifier/minimal trigger, but it is not the root cause in this reproduction. Resuming native-Windows goals restored LSASS handle growth plus sustained Git and sandbox setup/ACL churn after that trigger was removed. This points toward a broader repeated process-creation / Windows sandbox setup / ACL or security-token cleanup problem.No raw logs, private paths, repository source, or session content are attached.
One-hour unattended measurement: sustained LSASS handle growth
I followed the short measurement with an uninterrupted one-hour test. The computer was left untouched, with only the same two native-Windows Codex goals running as active workloads.
To minimize observer effect, one persistent read-only PowerShell process sampled LSASS once per minute. No repeated Codex diagnostic commands were issued during the interval.
Measurement period: July 17, 2026, 11:59:50–12:59:50 CEST
Duration: 60.0153 minutes
Samples: 61
Results:
The regression slope closely matches the end-to-end average, demonstrating sustained growth rather than the result being caused by a single spike.
The previous 46-second measurement showed approximately +163 handles/minute during a burst of activity. This longer unattended measurement indicates that approximately +40 handles/minute is a more representative sustained rate under these two goals.
For additional context, the clean post-restart LSASS count was approximately 1,986 handles. It has now reached 5,145, an increase of 3,159 handles. If the measured hourly rate remained constant, reaching approximately 100,000 handles from the current state would take roughly 39 hours. This is an extrapolation, not a prediction, because workload intensity and cleanup activity vary.
No raw logs, private paths, repository source, or session content are attached.