wsl

wsl is a command for coding agents from mitulgarg/env-doctor. It costs 0 tokens per session (1,196 once invoked), scanned B, original, MIT.

A diagnostic command for Windows Subsystem for Linux (WSL), which runs Linux tools inside Windows, and its GPU connection.

In plain words
What is it for?
Detecting WSL1, WSL2, or native Linux and checking the NVIDIA libraries, nvidia-smi access, and overall GPU forwarding status.
Why use it?
It helps identify why a GPU is or is not available inside WSL2.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mitulgarg/env-doctor/wsl
Clone the repo
git clone --depth 1 https://github.com/mitulgarg/env-doctor

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wsl

README.md
[![agentmods](https://agentmods.dev/badge/commands/mitulgarg/env-doctor/wsl.svg)](https://agentmods.dev/commands/mitulgarg/env-doctor/wsl)
Your own site
<a href="https://agentmods.dev/commands/mitulgarg/env-doctor/wsl"><img src="https://agentmods.dev/badge/commands/mitulgarg/env-doctor/wsl.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,196 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01196
Opus 5 $0.00000 $0.00598
Sonnet 5 $0.00000 $0.00239
Haiku 4.5 $0.00000 $0.00120

Measured 5d ago against content hash bb5cfb4731d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

wsl scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

→ Remove the internal NVIDIA driver: sudo apt remove --purge nvidia-* libnvidia-*
docs/commands/wsl.md · 186 lines

How it starts

The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.

wsl

Display comprehensive WSL environment information and GPU forwarding diagnostics.

Usage

env-doctor wsl [--json]

Options

Option Description
--json Output results in JSON format for programmatic consumption

Description

The wsl command runs a dedicated WSL environment analysis. It detects whether you are running inside WSL1, WSL2, or native Linux and — for WSL2 — validates the full GPU forwarding chain:

  • Whether the internal NVIDIA driver (which breaks forwarding) is present
  • Whether the WSL2 CUDA library (/usr/lib/wsl/lib/libcuda.so) exists
  • Whether nvidia-smi is reachable from inside WSL2
  • Overall GPU forwarding status

!!! note This command only runs on Linux. On macOS or Windows it will exit with an error.

Example Output

WSL2 with GPU forwarding enabled

============================================================
🐧  DETAILED WSL ANALYSIS
============================================================

📌  Environment Type: WSL2
    Kernel Version: 5.15.167.4-microsoft-standard-WSL2

🔍  GPU Forwarding Checklist:
    ✅ No internal NVIDIA driver (correct)
    ✅ WSL2 CUDA library found (/usr/lib/wsl/lib/libcuda.so)
    ✅ nvidia-smi working

✅  GPU Forwarding: Enabled
============================================================

WSL2 with GPU forwarding broken

============================================================
🐧  DETAILED WSL ANALYSIS
============================================================

📌  Environment Type: WSL2
    Kernel Version: 5.15.167.4-microsoft-standard-WSL2

🔍  GPU Forwarding Checklist:
    ❌ Internal NVIDIA driver found (breaks GPU forwarding)
    ❌ WSL2 CUDA library missing (/usr/lib/wsl/lib/libcuda.so)
    ❌ nvidia-smi not working

❌  GPU Forwarding: Not working

⚠️   Issues Detected:
    • NVIDIA driver installed inside WSL2 — this breaks GPU forwarding

💡  Recommendations:
    → Remove the internal NVIDIA driver: sudo apt remove --purge nvidia-* libnvidia-*
    → Install the NVIDIA driver on Windows, not inside WSL2
============================================================

Read the full file on GitHub · 186 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 186 lines · 0 tokens per session scan B bb5cfb4731d3

Subscribe to this mod's changes

wsl is a command published in the GitHub repository mitulgarg/env-doctor (173 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,196 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.