WSL startup regression when ~/.agents/skills resolves to /mnt/c

Open 💬 0 comments Opened Apr 26, 2026 by dungan24

What version of Codex is running?

codex-cli 0.124.0

What platform is your computer?

WSL2 on Windows:

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64

What issue are you seeing?

Codex CLI startup is very slow in WSL when the user-level ~/.agents/skills directory resolves to a Windows-mounted path under /mnt/c.

In this setup, ~/.agents is intentionally shared across multiple coding agents and other local tooling:

~/.agents -> /mnt/c/Users/<user>/.agents
~/.agents/skills -> /mnt/c/Users/<user>/.agents/skills
~/.codex/skills -> /home/<user>/.agents-runtime/skills

Codex appears to load both:

/home/<user>/.agents-runtime/skills
/mnt/c/Users/<user>/.agents/skills

The second path is a Windows-backed filesystem path. Scanning it during startup adds roughly 10 seconds before the prompt is ready.

Other agents on the same machine do not show this slowdown:

  • opencode scans the shared ~/.agents structure in a similar way, but does not become slow.
  • Claude Code does not scan ~/.agents directly, but has ~/.agents/skills symlinked into its own skills directory and also remains fast.
  • Codex on native Windows starts within about 2 seconds with a similar shared skills setup.

Steps to reproduce

  1. In WSL2, keep a shared user skills tree on the Windows filesystem:

``text
/mnt/c/Users/<user>/.agents/skills
``

  1. Make it visible as the user-level agents directory:

``text
~/.agents -> /mnt/c/Users/<user>/.agents
``

  1. Keep Codex's WSL-local runtime skills configured separately:

``text
~/.codex/skills -> /home/<user>/.agents-runtime/skills
``

  1. Run:

``bash
/usr/bin/time -f 'elapsed=%e' codex -C /home/<user>/.codex debug prompt-input probe >/tmp/codex-baseline.json
``

  1. Temporarily hide only the Windows-backed ~/.agents/skills path from the Codex process and run the same command again.

Actual behavior

With normal Codex startup:

elapsed=10.98

With only /mnt/c/Users/<user>/.agents/skills hidden from the Codex process using bubblewrap, while leaving the WSL-local ~/.codex/skills path available:

elapsed=0.62

Earlier repeated measurements showed the same pattern:

normal Codex: roughly 7-11s
hide ~/.agents/state only: no material improvement
hide ~/.agents/skills only: roughly 0.56-0.57s

This suggests the slowdown is specifically caused by user-level ~/.agents/skills discovery on a Windows-mounted path, not by the larger ~/.agents/state directory or by the number of skills alone.

Expected behavior

Codex should not add several seconds of startup latency when ~/.agents/skills is present on WSL and resolves to a Windows-mounted path.

Possible fixes or mitigations:

  • Avoid duplicate scanning when the same skills are also exposed through ~/.codex/skills.
  • Cache or lazily refresh user-level skills metadata.
  • Add a supported config option to disable or override the user-level ~/.agents/skills discovery path.
  • Detect WSL /mnt/c paths and avoid expensive eager scans during prompt initialization.

Additional context

The documented behavior says Codex reads skills from repository, user, admin, and system locations, including USER $HOME/.agents/skills, and follows symlinks while scanning skill locations:

https://developers.openai.com/codex/skills

This is likely an edge case from the recent .agents/skills discovery support becoming active for user-level skills. The shared ~/.agents layout is useful because it is consumed by several LLM agents and by other local tooling, so moving the directory out of ~/.agents is not a practical fix.

View original on GitHub ↗