Repository navigation
Description
Summary
Codex Desktop on Windows with a WSL project is extremely slow for every command/tool invocation.
This does not appear to be caused by WSL itself, the repository, Git, Node, .NET, or shell startup. The same project is fast when using Codex CLI directly inside WSL.
Using strace on the WSL codex app-server process shows that a large share of file/process syscalls repeatedly touch the Desktop plugin cache under:
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins
This suggests that Codex Desktop WSL mode repeatedly scans plugin/cache files over /mnt/c, causing severe latency.
Environment
- Codex Desktop version:
OpenAI.Codex_26.601.2237.0_x64__2p2nqsd0c76g0 - Codex CLI version:
codex-cli 0.136.0 - OS: Windows + WSL
- WSL distro: Ubuntu 26.04
- Project opened from WSL path:
\\wsl$\Ubuntu\home\<WslUser>\repos\<RepoName> - Repository path inside WSL:
/home/<WslUser>/repos/<RepoName>
Observed behavior
Codex Desktop in WSL mode is extremely slow for every command/tool invocation, not only during initial startup.
Even simple read-only prompts take a long time before or between shell commands. The same repository is fast when using Codex CLI directly inside WSL.
The WSL codex app-server process runs as:
/mnt/c/Users/<WindowsUser>/.codex/bin/wsl/<hash>/codex app-server --analytics-default-enabled
Its process environment includes Windows-backed paths:
CODEX_HOME=/mnt/c/Users/<WindowsUser>/.codex
TEMP=/mnt/c/Users/<WindowsUser>/AppData/Local/Temp
TMP=/mnt/c/Users/<WindowsUser>/AppData/Local/Temp
PWD=/mnt/c/Program Files/WindowsApps/OpenAI.Codex_<version>/app/resources
What was ruled out
WSL itself is fast:
wsl.exe --exec /bin/true: ~0.1s
Interactive Bash startup is fast after fixing unrelated shell initialization:
bash -i -c "exit": ~0.35s
Git is fast:
git status -sb: ~0.2s
Repository traversal is fast when excluding known heavy/generated folders:
find excluding node_modules, .angular/cache, bin, obj, etc.: ~0.35s
Backend and frontend builds complete successfully inside WSL.
Codex CLI directly inside WSL is fast on the same project.
Plugin cache details
The Desktop plugin cache under /mnt/c contains thousands of files/directories:
Path: /mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins
Size: ~38 MB
Files: ~4,646
Directories: ~2,400
Previously the cache was approximately:
Size: ~55 MB
Files: ~4,675
Directories: ~2,411
Temporarily renaming this directory made Codex Desktop faster, but after restart/re-scan the latency returned.
strace evidence
While Codex Desktop was slow, I attached strace to the WSL codex app-server process:
sudo timeout 20 strace -f -tt -T \
-e trace=file,process \
-p <codex-app-server-pid> \
-o /tmp/codex-strace-plugins.logSummary from a 20-second sample:
total file/process syscall lines: 17,481
lines touching /mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins: 7,426
lines touching actual repo under /home/<WslUser>/repos/<RepoName>: 569
So around 42% of logged file/process syscalls touched the Codex plugin cache, while only around 3% touched the actual repository.
Example paths observed in strace:
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins/plugins/life-science-research/skills/gtex-eqtl-skill/SKILL.md
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins/plugins/life-science-research/skills/gwas-catalog-skill/SKILL.md
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins/plugins/life-science-research/.codex-plugin/plugin.json
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins/plugins/life-science-research/.claude-plugin/plugin.json
The trace showed many repeated calls such as:
readlink(...)
stat(...)
lstat(...)
open(...)
against files and directories under /mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins.
Expected behavior
Codex Desktop WSL mode should not repeatedly scan thousands of plugin/cache files from /mnt/c for every command/tool invocation.
High-churn cache/temp/plugin data should either live inside the Linux filesystem or be cached efficiently so that simple commands do not repeatedly incur /mnt/c traversal overhead.
Actual behavior
Codex Desktop WSL mode repeatedly performs many filesystem operations against:
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins
This causes severe latency for each command/tool invocation.
Workaround
Using Codex CLI directly inside WSL is fast and does not show the same slowdown.
Temporarily renaming the Desktop plugin cache directory improves performance briefly:
mv /mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins \
/mnt/c/Users/<WindowsUser>/.codex/.tmp/plugins.bakHowever, Codex Desktop recreates/re-scans the plugin cache later, and the slowdown returns.
Privacy note
All usernames, repository names, hostnames, and company-specific paths in this report have been anonymized.
Activity
github-actions commentedon Jun 3, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
ckorherr commentedon Jun 3, 2026
Thanks for the workaround. I can actually use Codex again now.
You can create a file called "plugins" so the folder does not get recreated.
w1peee commentedon Jun 3, 2026
Thanks for the suggestion.
For me, the solution was to clear the contents of
C:\Users\User\.codex\.tmp\plugins\plugins\After that, Codex became fast again, and new plugins are no longer being added automatically.
stankitsis commentedon Jun 3, 2026
Confirmed on a VS Code dev container (WSL2/Docker, /root/.codex bind-mounted from C:\ over 9p/drvfs). Plugin cache /root/.codex/.tmp = ~40MB / ~4,734 files.
Moving ONLY that dir onto a native overlay fs took the bundled 0.136.0-alpha.2 engine from 2m21s to ~5s. Same engine, same config, same auth; only the cache filesystem changed (it even rebuilt bigger, 77MB / ~4,791 files, and still ~5s). So the regression is per-turn cache rescanning, amplified by the slow 9p mount.
Workaround: put ~/.codex/.tmp on a native filesystem like a Docker volume mounted at /root/.codex/.tmp (keep config.toml/auth.json on the host mount for persistence).
garfieldmax commentedon Jun 3, 2026
i have same setup. windows +wsl (where repo is)
stankitsis commentedon Jun 3, 2026
The Docker volume bit is specific to my setup (a docker-compose dev container). If you have Windows + WSL and no container, you need a different mechanism, but the same idea: get ~/.codex/.tmp off /mnt/c and onto the WSL-native ext4 disk. You're not moving the Codex app, just the cache folder that the WSL-side app-server scans every turn.
You need to find out where CODEX_HOME resolves. In your WSL shell:
echo $CODEX_HOME
mount | grep -i codex # or check if ~/.codex is under /mnt/c
If .codex lives under /mnt/c, that's the slow path.
Fix:
1 (simpler). Point CODEX_HOME at a WSL-native path so the agent stops reading the Windows .codex over /mnt/c (e.g. export CODEX_HOME=$HOME/.codex with $HOME on the WSL ext4 disk). The trade-off here is login won't be shared with the Windows Desktop app, so you'd sign in once inside WSL.
2. The OP already noted running the Codex CLI directly inside WSL avoids the slowdown, which is the same thing: a WSL-native CODEX_HOME instead of one on /mnt/c.
If you must keep .codex on the Windows side for the desktop app, you can instead symlink just the .tmp cache to a WSL-native path, but that's much messier.
shoui520 commentedon Jun 4, 2026
Can confirm this is a real issue for me too.
VaniaMi commentedon Jun 5, 2026
Confirmed.
My plugin cache was:
/mnt/c/Users//.codex/.tmp/plugins
46M
7418 entries
After stopping Codex Desktop and renaming that folder, a simple
pingwent from >60 seconds to under 5 seconds after restart.So the root cause is very likely the Desktop app-server repeatedly touching/scanning the plugin cache under
/mnt/c/...in Windows + WSL mode.marceloangelopita1 commentedon Jun 5, 2026
I hit a very similar issue on Windows + WSL with Codex Desktop.
Environment:
/home/<wsl-user>/projetos/sudoku/mnt/c/Users/<windows-user>/.codex/bin/wsl/<hash>/codex app-serverCODEX_HOMEin the Desktop WSL app-server environment:/mnt/c/Users/<windows-user>/.codexTEMP/TMPalso pointed to/mnt/c/Users/<windows-user>/AppData/Local/TempSymptoms:
Local observations:
.codexdirectory was about 381 MB./mnt/c/Users/<windows-user>/.codex/.tmp/pluginswas about 65 MB.CODEX_HOME=/mnt/c/Users/<windows-user>/.codex.Workaround that fixed it:
Backed up
C:\Users\<windows-user>\.codex\config.tomlAdded/changed:
Renamed:
C:\Users\<windows-user>\.codex\.tmp\pluginsto:
C:\Users\<windows-user>\.codex\.tmp\plugins.disabled-<timestamp>Restarted Codex Desktop.
Result:
pwdtest./mnt/c, not the model, WSL itself, Git, GitHub CLI, or the repository.artemrizhov commentedon Jun 8, 2026
This may also be related to #25715
I can confirm that moving the Codex Desktop
CODEX_HOMEfrom the Windows filesystem to the WSL/Linux filesystem fixed the severe slowdown for me.Observed behavior before the workaround:
Project was already located inside the Linux filesystem, not under
/mnt/c.Codex TUI inside WSL was fast: asking it to inspect the project took about 30 seconds.
Codex Desktop on Windows in WSL mode was much slower on the same kind of task:
The slowdown happened repeatedly between steps, especially during “Thinking”, so it did not look like normal model latency.
The workaround that helped:
Fully exit Codex Desktop via Exit, not just close the window.
I created a separate Linux-native Codex home for Desktop:
mkdir -p ~/.codex-desktoprsync:~/.profileinside WSL:codex app-serverprocess picked it up:Expected result:
After this, Codex Desktop became fast again.
My conclusion: in this case the bottleneck was not the project location, WSL itself, Git, or model speed. The problem appears to be Codex Desktop using Windows-backed
.codexstate/cache from inside WSL, especially paths under/mnt/c/Users/.../.codex. Moving Desktop’sCODEX_HOMEto the Linux filesystem removed the repeated Windows↔WSL filesystem overhead.WilliamRickard commentedon Oct 14, 2026
Additional Windows Desktop + WSL reproduction on a newer build (14 Oct 2026), with measured directory traversal and idle-resource impact.
Environment (anonymised):
OpenAI.Codex_26.1007.9446.0, WSL enginecodex-cli 0.162.0-alpha.17.2.codex app-server:CODEX_HOME=/mnt/c/Users/<user>/.codex;CODEX_SQLITE_HOME=/home/<user>/.codex/sqlite. The working project is already on native WSL ext4.CODEX_HOME/.tmp/pluginscontains 3,676 files and 1,945 directories;plugins/cachecontains 1,239 files and 450 directories.Read-only reproduction: Enumerate the same cached tree using
os.walkfrom Windows and WSL. A separate test copied the cache once into an isolated temporary ext4 directory; this was not substituted into the live application and was automatically deleted..tmp/pluginstraversal/mnt/cSame 3,676 files / 1,945 directories in the WSL comparisons: about 774× faster from ext4. This is a filesystem microbenchmark, not an end-to-end Codex speedup or established power saving.
Observed background behaviour with the Desktop window minimised: In a 30-second process sample, Windows
vmmemWSLaveraged 52.4% of one CPU core and the WSL-integrated COM Surrogatedllhost.exegroup averaged 32.4% of one core (the busy instance loadsvp9fs.dllandwshhyperv.dll). These totals are observational; they do not prove how much is caused by plugin scans versus unrelated work. The WSLcodex app-serverseparately showed a recurring ~7–15% of one core, with repeatedplugin/installedand configuration-related events. Its SQLite files are already on ext4, so this is not fixed merely by settingCODEX_SQLITE_HOME.Request: Is there a supported cache-only override for Desktop WSL mode that keeps
CODEX_HOME(auth, config, sessions) on Windows but redirects temporary/curated/plugin discovery caches to WSL-native ext4? If the June fix for #26985 addressed this, the above appears to be a regression in the October build. Please consider ensuring startup sync, plugin listing, skills discovery and cache refresh all resolve the same native runtime-cache root, with an explicit fallback and tests for Windows Desktop + WSL. The current source still derives.tmp/pluginsfromcodex_homeincodex-rs/core-plugins/src/startup_sync.rsandloader.rs.I avoided changing
CODEX_HOMEor replacing active cache directories because those risk splitting live Desktop state and disrupting unattended agents.WilliamRickard commentedon Oct 14, 2026
Follow-up: I traced the current
openai/codexsource paths and prepared a prototype opt-in cache-only patch for review. This is a source proposal, not a compiled or deployed fix.The current curated checkout is derived from
CODEX_HOMEincodex-rs/core-plugins/src/startup_sync.rs, whileloader.rsseparately hardcodes.tmp/plugins. The prototype introduces a WSL-onlyCODEX_WSL_CURATED_CACHE_ROOTpath resolver (default unchanged), and ensures the curated checkout, SHA marker, sync lock and cache-refresh loader use it consistently.Safety/limitations: No authentication/config/session relocation; no automatic migration; no change to
PluginStore's separateCODEX_HOME/plugins/cacheinstalled-plugin root; no Desktop-side environment wiring yet. The override is intended as an upstream API proposal. It is not present in shipping Codex. The WSL path should be on native ext4, not a symlink back into DrvFS.Validation:
git apply --checkandgit applysucceeded against the current fetched upstream files, including a textual round-trip. Three Linux-gated unit tests exercise legacy fallback, explicit native cache path, and rejection of relative//mntpaths. I could not compile or run the Rust tests, so maintainers should runcargo test -p codex-core-plugins curated_wsl_cache_root_testsand existing curated-plugin/marketplace suites and review formatting and security before considering it.Draft patch (two files, default path preserved):
Proposed diff (180 lines)
The previous reproduction measured
/mnt/cdirectory enumeration at 21.667 s median vs 0.028 s on a temporary ext4 copy, but this patch has not been benchmarked in the running app-server and does not yet establish wattage savings. A production-quality solution should consider installed-plugin cache separation and coordinated Windows Desktop environment propagation.WilliamRickard commentedon Oct 15, 2026
Second-stage follow-up, 15 October 2026: I extended the earlier curated-only proposal into a consistent seven-file opt-in WSL runtime-cache-root source prototype. This supersedes the diff in my previous comment.
The existing Desktop-launched WSL
CODEX_HOMEremains on Windows for persistent authentication/config/session state. The proposedCODEX_WSL_RUNTIME_ROOT(not a shipping setting) is Linux+WSL-only and defaults to the old paths when unset. It consistently changes:<root>/.tmp/plugins.<root>/plugins/cache.Source verification:
git apply --check --whitespace=error-allPASSED against clean default-branch source fetched today.git applyPASSED, and all seven patched files match the intended edits. Not compiled or run with Rust/Cargo. No active Codex process, service, cache or configuration was changed.Important blockers before production: (1) The Windows Desktop launcher currently injects
CODEX_SQLITE_HOMEinto WSL but does not pass this proposed variable; app-server and executor environments must be aligned. (2) Existing installed-plugin bundles must be safely materialised or migrated and permission/trust tests passed. (3) Root validation must be hardened against symlinks/mount aliases, with missing-root and rollback cases tested. (4) Other runtime data, including.tmp/bundled-marketplacesand arg0 helpers, is not moved by this draft. (5) Run all related Rust tests and benchmark actual Codex idle watts; the 774× filesystem enumeration microbenchmark is not a demonstrated electricity saving.Source-only patch for maintainer review (seven files):
View prototype diff
This is a proposed engineering direction, not a workaround to apply to existing released builds. The running Desktop app remains available and unmodified.
WilliamRickard commentedon Oct 15, 2026
15 October 2026 follow-up: direct ETW attribution of a live WSL/DrvFs workload. This supplies evidence beyond the prior filesystem microbenchmark and source-only runtime-cache proposal.
Instrumentation (Windows Desktop + WSL2): Using the 9P provider GUID
e13c8d52-b153-571f-78c5-1d4098af2a1efrom Microsoft's WSL diagnostic profile, a verbose (level 5), 16-second ETW trace recorded 68,884 9P events (~4,305/s), with zero tracerpt-reported losses. Every provider event came from Windowsdllhost.exePID 23524, which loadsvp9fs.dllandwshhyperv.dll. The host consumed about 53% of a logical CPU core during the tracing interval, including tracing overhead. The same provider at level 4 emitted no usable activity.A second, correlated 10-second trace recorded 64,832 9P events (~6,483/s). During those same 10 seconds, WSL Linux reported ~5,832 Hyper-V callback interrupts/s and ~5,716 TASKLET softirqs/s. These are different event types, so this is evidence of a high-frequency path, not proof of 1:1 event causation.
Host file-path attribution: A separate 10-second, level-4
Microsoft-Windows-Kernel-FileETW trace recorded 10,908 kernel file-I/O events from the samedllhost.exePID. Using file-name events andFileObject/FileKey/Irplinkage, 10,691 were assigned to a path category:CODEX_HOME/.tmp/pluginscurated cacheCODEX_HOME/plugins/cacheinstalled bundlesCODEX_HOMEfilesFinding: 65.0% of the Windows 9P host's file events involve just the two plugin caches, and 89.8% involve Codex paths overall, in that captured interval. These counts are ETW events, not unique filesystem requests. A Windows path does not by itself prove which Linux process originated the operation. The workload was live and tracing has overhead; no savings in watts are claimed. Further time-aligned read-only checking found Codex streaming/session log events during both capture intervals, and no logged
plugin/installed,plugin/listor plugin-manager events. These traces therefore establish high 9P cache access during active Codex work, not a proven idle polling loop.This is direct evidence for the unified runtime-cache-path approach outlined in my seven-file source proposal: move both frequently traversed plugin-cache trees to WSL-native ext4 with a consistent loader, synchroniser and executor path resolver, while preserving persistent auth/config/sessions. The installed binary currently has no supported knob for this. I have not changed the live Codex cache, launcher, WSL or BIOS.
Raw traces remain only on the local workstation because they contain filesystem metadata and potentially sensitive paths. Only aggregate counts are posted here.
fbernklau commentedon Oct 20, 2026
Additional measurements from Windows Desktop + WSL on 2026-10-20: skill discovery remains slow in a current installed build, including the installed
plugins/cachetree rather than only the legacy.tmp/pluginscatalogue.Environment: packaged Windows app
26.1013.4894.0, build20770; bundled WSL agent0.163.0-alpha.10.2; Ubuntu-24.04; Windows-backed DesktopCODEX_HOME; SQLite on WSL ext4; 22 installed plugins / 91 discovered skills / 15 saved project roots. This is an existing profile after earlier recovery, not a clean-install reproduction.Using the bundled Linux app-server, the existing Codex home and a temporary snapshot of its SQLite state, these sequential single-cwd measurements without strace returned:
A separate traced probe (initialization, plugin inventory and three skill queries) recorded 28,840 trace lines, including 17,195 readlink, 3,253 lstat and 1,836 getdents64 calls. These counts cover the entire probe, not one scan. The traversal includes skill assets/reference subdirectories. Tracing itself increased cold-scan timings to roughly 12 seconds; the untraced values above are the appropriate latency comparison.
During a normal packaged Desktop start, the live log instead showed:
The installed app has forced skills-reload paths after bundled-plugin reconciliation and primary-runtime setup; both main renderer and overlay query skills. These observations make repeated invalidation/coalescing worth investigating. They do not establish the exact cache-invalidation sequence inside the live backend.
Earlier local pruning of the generated legacy marketplace catalogue reduced all-project plugin inventory latency (about 30 seconds to 6–8 seconds), but did not resolve cold Desktop startup. The measurements above are after that partial improvement. No installed plugins were disabled for these new measurements.
A separate executor plugin-copy failure occurred during the same startup. Its detailed report and self-contained abort/queue reproduction have been added to #55417. That mechanism should be tracked separately from the filesystem scan cost; we are not assuming one fix resolves both.
I checked the official changelog and currently available app update on 2026-10-20: the installed app reports
up_to_date, and I did not find a confirmed released fix for this specific scan/reload behavior. Older reports of improvement or community cache-root prototypes should not be treated as confirmation for this build.Request: Please identify a supported shipping correction/build and coalesce/cache discovery so Windows Desktop + WSL remains responsive without user-created home copies, links/redirection or disabling the installed plugin set. The user requires the Desktop app with WSL; CLI/VS Code substitution does not meet their workflow.
Raw filesystem traces remain local because they contain paths. Only sanitized aggregate results are posted. Submitted with the user's authorization using Codex assistance.
sufeeeringGavinM commentedon Nov 15, 2026
Additional Windows + WSL reproduction with a plugin-preserving workaround
This appears related to this issue and #26766. I am adding measurements rather than opening another report. The installation is a Windows desktop build in the 26.1013 family with its WSL backend.
Observed behavior:
Diagnostic comparison using the same collection of several dozen project roots:
These are sequential local app-server RPC measurements, not controlled end-to-end UI timings. The desktop and other background work remained active, and cache warming may contribute. All 39 baseline skills were retained in the final configuration.
Local mitigation:
This is a local workaround, not an upstream fix or a generally supported installation recipe. Relocating a marketplace source blindly can change its identity and hide installed capabilities; one such experiment was rejected after capability verification. The final configuration preserved the original primary-runtime marketplace source.
Suggested upstream areas to investigate: reuse discovery results across roots with equivalent configuration; avoid repeated full Windows-mounted catalog scans; coalesce retries instead of overlapping timed-out discovery calls; keep cache refresh off the chat-readiness path; provide a supported WSL-local cache setting independent of account/session storage.
No raw logs, prompts, personal paths, project names, account information, machine identifiers, request IDs, chat IDs, or exact event timestamps are included in this comment. Performance numbers above describe backend components only and do not prove the entire message-send delay has disappeared.