Skip to main content

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:

ViewHow it launchesWhat that shell reads
interactiveyour terminal~/.bashrc, ~/.profile if login
loginwsl.exe bash -lc, MCP "command": "wsl"~/.profile (unless bash_profile / bash_login)
execwsl.exe -e sh -c, bash -c, spawnnothing
herethe process running wsl-shadowinherited 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

StatusMeaning
okevery measured view resolves to Linux, same version
shadowa Linux build exists, and a view gets Windows
windows-onlya view gets Windows, and no Linux build exists
unreachablea Linux build exists, and a view finds nothing
driftevery view is Linux, but versions disagree
missingnowhere
unmeasuredthat view could not be run; the tool does not guess
expected-windowsWindows build you marked expected (cursor / code by default, or --expect-windows)

Exit codes

  • 0: every measured tool is fine
  • 1: shadow / windows-only / unreachable / drift / invisible npm global bin / bad MCP under --mcp
  • 2: a --require tool 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