codex - 💡(How to fix) Fix On Windows, Codex cannot reliably execute rg from standard WinGet PATH location [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19157Fetched 2026-04-24 05:59:40
View on GitHub
Comments
3
Participants
3
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3closed ×1

Root Cause

This is especially painful because Codex seems to rely heavily on rg for search/file discovery, so this is not just a generic external-tool issue — it breaks core behavior.

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.122.0

What subscription do you have?

For Business

Which model were you using?

gpt-5.4

What platform is your computer?

Windows 11, x64

What terminal emulator and version are you using (if applicable)?

PowerShell

What issue are you seeing?

On native Windows, Codex cannot reliably execute rg (ripgrep) from standard PATH locations, even when rg works normally outside Codex.

In my case, rg.exe is available via WinGet in:

%LOCALAPPDATA%\Microsoft\WinGet\Links

Outside Codex, this is fine. Inside Codex native Windows, access to that location appears to be denied by the sandbox, which means Codex cannot use rg from a standard user-level install location.

This is especially painful because Codex seems to rely heavily on rg for search/file discovery, so this is not just a generic external-tool issue — it breaks core behavior.

Environment

  • OS: Windows
  • Codex: native Windows mode
  • rg installed and usable outside Codex
  • rg.exe available through WinGet alias path under %LOCALAPPDATA%\Microsoft\WinGet\Links

Problem

Inside Codex, attempting to inspect the WinGet Links directory fails even though it exists and is accessible outside Codex.

Example from inside Codex:

Get-ChildItem -Path C:\Users\<username>\AppData\Local\Microsoft\WinGet\Links

Output:

Get-ChildItem:
Line |
   2 |  Get-ChildItem -Path C:\Users\<username>\AppData\Local\Microsoft\WinGet\Li …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Access to the path 'C:\Users\<username>\AppData\Local\Microsoft\WinGet\Links' is denied.
Get-ChildItem:
Line |
   2 |  Get-ChildItem -Path C:\Users\<username>\AppData\Local\Microsoft\WinGet\Li …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'C:\Users\<username>\AppData\Local\Microsoft\WinGet\Links' because it does not exist.

Outside Codex, the same location is accessible and rg works normally.

So this appears to be a Codex native Windows sandbox/path-resolution issue rather than a broken rg install.

Why this deserves a dedicated issue

This is narrower than a general “allow extra folders in the Windows sandbox” request.

rg seems to be a core tool that Codex itself prefers to use for search/file operations, so inability to execute rg from a normal Windows user install location has an outsized impact on Codex usability.

From a user perspective, native Windows Codex becomes unreliable even though:

  • rg is installed correctly
  • PATH works outside Codex
  • the executable is in a standard per-user tool location

What steps can reproduce the bug?

Repro steps

  1. On Windows, install Codex and ripgrep via WinGet so rg works in a regular shell

  2. Confirm outside Codex:

    where.exe rg rg --version Get-ChildItem "$env:LOCALAPPDATA\Microsoft\WinGet\Links"

  3. Start Codex in native Windows mode

  4. Run:

    where.exe rg rg --version Get-ChildItem "$env:LOCALAPPDATA\Microsoft\WinGet\Links"

  5. Observe that inside Codex, access to the WinGet Links path is denied or the path appears not to exist

What is the expected behavior?

Expected behavior

One of the following should work reliably in native Windows mode:

  1. Codex can execute rg from standard PATH/user install locations such as %LOCALAPPDATA%\Microsoft\WinGet\Links
  2. Codex ships a bundled rg that is always executable in its own Windows environment
  3. Codex gracefully falls back between bundled rg and PATH rg without sandbox-related failures
  4. Codex includes standard Windows user-level executable alias locations in its default readable/executable allowlist

Actual behavior

Codex native Windows appears unable to access %LOCALAPPDATA%\Microsoft\WinGet\Links, so it cannot reliably discover or execute rg from there.

Additional information

Notes

This seems related to Windows sandboxing / path allowlisting rather than to WinGet itself.

It may also be related to the existing Windows rg issues around bundled executables and WindowsApps, but this report is specifically about the inability to use a correctly installed PATH rg from a standard WinGet alias location.

Suggested fix

Please make native Windows Codex reliably able to use rg, since it appears to be part of Codex’s normal operating model.

Concrete options:

  • add %LOCALAPPDATA%\Microsoft\WinGet\Links to the default Windows readable/executable roots
  • explicitly special-case rg
  • improve fallback behavior when bundled rg is inaccessible
  • document how to grant this path for command discovery/execution if that is the intended model

Impact

This makes native Windows significantly less usable, because one of Codex’s key search tools cannot be relied on even when installed correctly on the host machine.

extent analysis

TL;DR

The issue can be resolved by adding the %LOCALAPPDATA%\Microsoft\WinGet\Links directory to the default Windows readable/executable roots in Codex's native Windows mode.

Guidance

  • Verify that the %LOCALAPPDATA%\Microsoft\WinGet\Links directory is accessible outside of Codex by running the command Get-ChildItem "$env:LOCALAPPDATA\Microsoft\WinGet\Links" in PowerShell.
  • Check if Codex has any configuration options to add custom directories to its readable/executable roots.
  • Consider explicitly special-casing rg in Codex's configuration to allow it to execute from the WinGet alias location.
  • Test if improving fallback behavior when the bundled rg is inaccessible resolves the issue.

Example

No code snippet is provided as the issue is related to configuration and directory access.

Notes

The issue seems to be related to Windows sandboxing and path allowlisting, and resolving it may require changes to Codex's configuration or the underlying Windows environment.

Recommendation

Apply a workaround by adding the %LOCALAPPDATA%\Microsoft\WinGet\Links directory to the default Windows readable/executable roots in Codex's native Windows mode, as this is the most direct solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

One of the following should work reliably in native Windows mode:

  1. Codex can execute rg from standard PATH/user install locations such as %LOCALAPPDATA%\Microsoft\WinGet\Links
  2. Codex ships a bundled rg that is always executable in its own Windows environment
  3. Codex gracefully falls back between bundled rg and PATH rg without sandbox-related failures
  4. Codex includes standard Windows user-level executable alias locations in its default readable/executable allowlist

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING