Getting Started
Introduction
What wsl-shadow is, why agent shells see Windows npm, and what it measures.
wsl-shadow reports when your interactive WSL shell and an AI agent on the same distro resolve node / npm / bun to different programs. It can propose fixes. It only writes when you type apply.
What it measures
Four shell views:
| View | How it launches | 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 | nothing |
| here | the process running wsl-shadow | inherited PATH |
WSL appends the Windows PATH. nvm and fnm usually load from ~/.bashrc. Agent shells often never read that file, so they get /mnt/c/.../nodejs/npm and a Windows prefix.
Status codes
| Status | Meaning |
|---|---|
ok | every measured view resolves to Linux, same version |
shadow | a Linux build exists, and a view gets Windows |
windows-only | a view gets Windows, and no Linux build exists |
unreachable | a Linux build exists, and a view finds nothing |
drift | every view is Linux, but versions disagree |
missing | nowhere |
unmeasured | that view could not be run; the tool does not guess |
expected-windows | Windows build you marked expected (cursor / code by default, or --expect-windows) |
Exit codes
0: every measured tool is fine1: shadow / windows-only / unreachable / drift / invisible npm global bin / bad MCP under--mcp2: a--requiretool is missing
--mcp is read-only.
Measured output
WSL2 Ubuntu + nvm; Node also on Windows. Paths anonymized.
$ wsl-shadow --view=interactive,login,exec
unreachable node
interactive /home/alex/.nvm/.../bin/node
login (not found) <- fails
exec (not found) <- fails
shadow npm
interactive /home/alex/.nvm/.../bin/npm
login /mnt/c/.../nodejs/npm <- fails
exec /mnt/c/.../nodejs/npm <- fails