Skip to main content

wsl-shadow

Check which npm an AI agent actually runs on WSL.

bunx wsl-shadow --json

Same distro, different PATH.

What this solves

WSL appends the Windows PATH. nvm/fnm load from ~/.bashrc, which agent shells skip, so they resolve /mnt/c/.../nodejs/npm and a Windows prefix.

View How an agent launches it What that shell reads
interactive your terminal ~/.bashrc, ~/.profile if login
login wsl.exe bash -lc, MCP "command": "wsl" ~/.profile (unless bash_profile / bash_login)
exec wsl.exe -e sh -c, bash -c, spawn no profile files
here the process running wsl-shadow inherited PATH

Status codes, exit codes, and sample measured output: Introduction.

Upstream issues: same PATH bleed, filed elsewhere

What it reports

  • Four views

    Your terminal, bash -lc, sh -c/spawn, and the current process.

  • --json + exit codes

    0/1/2 for agents and CI. --preflight prints a PATH prefix for a harness.

  • Confirm before write

    Dry-run, type apply, undo only what it recorded. Details in CLI docs.