Codex CLI calls on rg (ripgrep) persists despite prompt response is complete
Open 💬 2 comments Opened Dec 4, 2025 by 3SMMZRjWgS
What version of Codex is running?
Codex CLI 0.64.0
What subscription do you have?
ChatGPT Pro
Which model were you using?
gpt-5.1 high
What platform is your computer?
Windows 11 Pro (non-WSL); ripgrep (rg) 15.1.0
What issue are you seeing?
Codex calls on rg for file operations, but then once the prompt has been finished, the background rg process continues running. I have to go into Windows Task Manager to manually shut it down or else high CPU/SSD activities will persist even though the prompt response is complete.
What steps can reproduce the bug?
Uploaded thread: 019ae7c9-b8cc-7473-ad24-6940c802f282
What is the expected behavior?
rg and any other processes that were triggered in response to a prompt would be shut down once the prompt is responded and completed.
Additional information
_No response_
2 Comments
I'm experiencing this same issue on Windows 11 Pro with WSL and the Codex VS Code extension.
What's happening: After Codex finishes a task, the VS Code extension keeps spawning ripgrep processes in a tight loop that never terminate, pegging CPU at ~98%%. The processes appear and disappear continuously in Task Manager.
Root cause detail: The spawned rg.exe commands are searching for Codex skill asset files using WSL Linux-style paths from the Windows side, so the searches never find anything and keep retrying. The glob patterns contain /home/daniel/.codex/skills/.system/ (a WSL path) but rg.exe is running as a native Windows process, so the path doesn't resolve. This causes an infinite retry loop of ripgrep invocations.
Example command lines:
Parent process: All rg.exe instances are children of a VS Code process (Code.exe).
Workaround: Restarting VS Code stops the loop. taskkill /IM rg.exe /F also works temporarily but they respawn until VS Code is restarted.
Environment: Windows 11 Pro, WSL2 installed, VS Code (latest), Codex VS Code extension
Thank you for triaging @dancingmadkefka, I'm experiencing the same thing. CPU spikes to 100%, and stays pegged until I restart my machine. In my current setup, I SSH to a Windows host (no WSL2), but have Codex running in WSL2.
The only workaround I had that doesn't require me to restart my host is to simply disable Codex running in WSL:
chatgpt.runCodexInWindowsSubsystemForLinux: falseI hope this is fixed soon. Makes Codex unusable in in the mode the agents prefer