UNC path check false-positive blocks WSL paths even with bypassPermissions

Resolved 💬 4 comments Opened Apr 16, 2026 by rafamav Closed Apr 18, 2026

Problem

On Windows with WSL2, all file operations targeting WSL paths (\\wsl.localhost\Ubuntu-24.04\... or \\wsl$\Ubuntu-24.04\...) trigger a "suspicious Windows path pattern" prompt that cannot be bypassed — even with permissionMode: "bypassPermissions", skipDangerousModePermissionPrompt: true, and explicit allow rules for every UNC path variant.

The message:

Claude requested permissions to write to \\wsl.localhost\Ubuntu-24.04\home\mav\..., 
which contains a suspicious Windows path pattern that requires manual approval.

Root Cause

In cli.js, function om() detects UNC paths with this regex:

if (/\\\\[^\s\\/]+(?:@(?:\d+|ssl))?(?:[\\/]|$|\s)/i.test(q)) return true

This matches \\wsl.localhost\... the same as \\remote-server\.... The result is returned with classifierApprovable: false, which means bypass permissions cannot override it.

WSL paths are localwsl.localhost and wsl$ are Windows-native virtual filesystem mounts, not network resources. They should be whitelisted.

Impact

Any developer on Windows using WSL2 (which is the standard Docker/Linux dev setup on Windows) gets permission prompts on every file edit. This makes Claude Code significantly harder to use for the large population of Windows+WSL2 developers.

Suggested Fix

Whitelist \\wsl.localhost\ and \\wsl$\ prefixes in the UNC path check, since they are guaranteed-local filesystem mounts:

function om(q) {
  if (N1() !== "windows") return false;
  // WSL paths are local, not network
  if (/^\\\\(wsl\.localhost|wsl\$)\\/i.test(q)) return false;
  if (/^\/\/(wsl\.localhost|wsl\$)\//i.test(q)) return false;
  // ... rest of checks
}

Environment

  • Windows 11 + WSL2 (Ubuntu 24.04)
  • Claude Code v2.1.94
  • Settings: permissionMode: "bypassPermissions", explicit allow rules for all UNC path variants in permissions.allow

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗