Repository navigation
Windows Desktop scans saved but inactive large Git repositories with ls-files --others, causing high CPU #32113
Description
Summary
Codex Desktop on Windows can start an expensive untracked-file scan for a very large, valid Git repository after that repository is saved as a project, even when it is not the active workspace.
The hot process tree is owned by Codex:
ChatGPT.exe
-> C:\Program Files\Git\cmd\git.exe
-c core.hooksPath=NUL
-c core.fsmonitor=
ls-files --others --exclude-standard -z
-> C:\Program Files\Git\mingw64\bin\git.exe
The inner git.exe saturates roughly one CPU core for a prolonged period. Removing the repository from Codex's saved projects and terminating only the Codex-owned Git process tree stops the load; no Git/TGitCache processes respawned during the immediate post-removal observation window.
Environment
- Windows 11
- Codex Desktop:
26.707.3748.0 - Git for Windows:
2.47.0.windows.1 - Repository: large, valid Unreal Engine source tree
- Approximately 258,000 tracked entries
- Repository is local, not a broken or empty
.gitdirectory - TortoiseGit cache was disabled during the reproduction
Real usernames and repository paths are intentionally redacted.
Measurements
A targeted comparison in the affected repository showed:
- Cached tracked-file listing: approximately
0.2 s git ls-files --others --exclude-standard -z: approximately14.1 s- Only one untracked file was returned in that measurement
- The most expensive traversal was under large tracked source/plugin/third-party trees
During a later occurrence, the Codex-owned inner Git process had already accumulated about 25 CPU seconds while running the same untracked-file query.
Another direct capture from the same Codex installation included a path-scoped variant against the engine tree:
ChatGPT.exe -> git.exe -> git.exe ls-files ... -- Engine
Reproduction
- Start Codex Desktop without the large repository saved/active.
- Observe that no persistent
git.exe/TGitCache.exeCPU load is present. - Add the large valid repository to Codex's saved projects.
- Keep another project active, or switch away from the large repository.
- Observe Codex spawning
git ls-files --others --exclude-standard -z. - Remove the large repository from saved projects and terminate the currently running Codex-owned Git process tree.
- The Git CPU load stops.
In the local state capture, the repository had been added to electron-saved-workspace-roots while another workspace remained in active-workspace-roots. The expensive scan still appeared. This suggests saved/inactive repositories may be eligible for Git discovery or review refresh.
Expected behavior
- Saved but inactive repositories should not be continuously or eagerly scanned.
- Untracked-file discovery should be debounced/cached and bounded for very large worktrees.
- Codex should cancel and reap obsolete Git scans when the project is switched or removed.
- Ideally expose a per-project option to disable background Git discovery/status polling.
Actual behavior
Saving the large repository is enough to make Codex initiate an expensive untracked-file traversal. On Windows, this produces visible git.exe CPU load and can make the machine sluggish.
Troubleshooting already attempted
The following did not solve the ls-files --others cost and were reverted:
core.fsmonitor=true- Git untracked cache
feature.manyFiles- index version 4
- broad repository exclude experiments
A watchdog that kills Codex-owned Git processes was also rejected as a workaround because Codex retries and its modified/untracked-file UI becomes unreliable.
Related reports
- Windows: Codex spawns many Git for Windows processes causing sustained high CPU after recent update #22085
- Windows Codex app repeatedly spawns git.exe/conhost.exe in Git workspaces, possibly contributing to Nonpaged Pool growth #26812
- Windows Desktop leaves repeated/stuck git.exe polling processes in multi-repo workspace #29408
- Codex Desktop Creates Empty
.gitDirectories, Then Repeatedly Scans Them and Triggers Windows Defender High CPU #29911 is related to invalid/empty.gitdirectories, but this reproduction uses a valid large repository. - [codex] kill timed-out Git status process groups #30235 and [codex] Report structured Git status refusals #30863 appear adjacent, but neither currently addresses Windows saved/inactive repository polling plus the expensive
ls-files --otherspath.
I can provide a short, redacted process trace or run a focused diagnostic build if maintainers need more data.
Activity
github-actions commentedon Jul 10, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
liujianhao1226-beep commentedon Jul 20, 2026
Confirmation: same review-summary → git abort → taskkill storm on Windows Desktop 26.715.7063.0
This matches the chain described in #30820 / #33776 / #32113 / #27570. Local evidence below (no prompt content, no secrets).
Environment
OpenAI.Codex26.715.7063.0 (OpenAI.Codex_2p2nqsd0c76g0)git status~50–65 ms, no merge/rebase/index.lock,fsck --connectivity-onlyOK)Symptom
codex://threads/new?path=..., background work still targets a previously saved local project in the sidebar15s process sample (during active storm, post-update)
PID-diffing style sampler (unique short-lived PIDs over 15s):
taskkill.exegit.exeBaseline with Desktop fully exited:
UniqueTaskkill=0, no ChatGPT/CodexMicroService.Desktop log signature (exact fields)
Log root:
Repeated pattern:
Aborted Git subcommands observed:
git hash-objectgit diff --no-index(per untracked file, e.g.scratch/*.py)git diff --cachedgit statusgit diffagainst HEAD for a small set of tracked changesTrigger cwd in current session (redacted base):
Also previously observed on a second local monorepo under the same parent folder.
Representative command shapes (same as other reports):
Also saw sidebar PR chip work against the same cwd:
Two-day log aggregation (local)
From recent non-empty Desktop logs:
review-summary-related Git complete lines: 4476cwd: 3706 (all failed/aborted)Git snapshot became stale: 55Important negative findings (not root cause)
git status~65 ms in the hottest project<local-project-A>restored from sidebar / local projects — clean worktree alone is not a durable fixGlobal state / project registry shape
.codex-global-state.jsoncontained multiplelocal-projectsentries and aselected-projectpointing at the dirty project. Desktop restored/scanned that project even when the user deep-linked into a different clean path. This aligns with #32113 (saved/inactive projects still scanned) and #30820 (startup restore → eager review-summary).Workspace shape that amplifies (not required for the bug, but makes it severe)
Hot project approximately:
scratch/(order of ~90+ files) plus other untracked dirs.gitignoredid not cover scratch/diagnostics dumpsreview-summaryspawns thousands ofgit hash-objectprocesses when nested repositories are present #27570), but untracked-per-filehash-object/diff --no-indexis enough to feed the cancel/taskkillloop on WindowsA/B already tried (local)
.git/info/excludegit add -Nintent-to-addRequest
Please treat this as another independent Windows confirmation on 26.715.7063.0 of:
review-summary/review_modelover restored or saved local projectstaskkill /T /Fcleanup feedback loop freezing process enumeration / Task ManagerHappy to validate a patched Desktop build quickly. Can also provide sanitized log excerpts on request.
suiyuebaobao commentedon Jul 22, 2026
The scanning of saved but inactive large repositories with
ls-files --othershere is the same class of background Git refresh workload 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.
5168413518 commentedon Oct 8, 2026
Adding an independently verified, closely related trigger to the saved/inactive repository scanning report. Our culprit was a Git root above the saved project folders, at the Windows user-profile root (not a large intended repository).
Confirmed Windows 10 workaround: accidental Git repo at
%USERPROFILE%was causing idle Codex Git scansI reproduced high idle CPU/heat in the Microsoft Store ChatGPT/Codex desktop app 26.1002.7124.0 on Windows 10. No local agent task was running; fully exiting the app reduced the load.
Evidence before the change
ChatGPT.exewas launching repeatedgit.exesubprocesses. One captured command wasgit ... ls-files --cached -z -- AppData/Local/Packages/....git -C %USERPROFILE% rev-parse --show-toplevelresolved to the entire user-profile directory.%USERPROFILE%\.gitexisted (withHEAD/ normal Git structure, but no commits, index, or remotes). Persisted Codex project directories nested under%USERPROFILE%\.codex\.chatgpt-projects\...thus inherited the profile-level Git root..gitand was unaffected.Reversible workaround that worked here
%USERPROFILE%\.gitis actually needed. Do not rename/remove it if your home directory is intentionally a Git repository.%USERPROFILE%\.gitto a timestamped.git_backup_YYYY-MM-DD; do not delete it.After: 0
git.exePIDs in 60 consecutive samples over ~13 seconds, and essentially zero CPU time attributable to the idle ChatGPT process group during that sample. The affected laptop's temperature improved. Git, Codex CLI, and an actual Work Local Git read test in the independent development repo still worked; no project files/Git history were changed.This is one confirmed local mitigation, not an upstream fix. It does not establish the cause of unrelated
taskkill.exe/WMI polling bugs or UI freezes. The likely product improvement is to avoid scanning an accidentally inherited ancestor repo outside the saved workspace scope, and bound/debounce background Git refreshes.— Пчеличко (Pchelichko)