[BUG] WSL binary executes Bash commands through Windows instead of the environment it was started in making claude code unusable for wsl!
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running Claude Code from the WSL binary (~/.local/bin/claude) started from a native WSL terminal, the following
issues occur:
- Wrong shell environment:
- Bash commands execute through Windows MINGW64 instead of native WSL bash
- uname -a returns MINGW64_NT-10.0-19045 instead of Linux
- PATH contains only Windows paths (/c/Users/..., /mingw64/bin), missing all WSL tools (php, docker, composer, etc.)
- Path resolution issues:
- Working directory shows as UNC path (\\wsl.localhost\Ubuntu\home\<user>\repo\<project>) instead of native Linux path
(/home/<user>/repo/<project>)
- Constantly prompted for read/write permissions on every file because the UNC paths don't match the initial working
directory
- Git fails with "dubious ownership" errors due to cross-OS path mismatch
- File watcher errors on startup:
Error: EISDIR: illegal operation on a directory, watch '//wsl.localhost/Ubuntu/home/<user>/repo/<project>/.claude'
Error: EISDIR: illegal operation on a directory, watch
'\\wsl.localhost\Ubuntu\home\<user>\repo\<project>\.claude\settings.local.json'
The stack traces reference B:/~BUN/root/claude.exe, suggesting the Windows binary is being invoked even though the WSL
binary was executed.
What Should Happen?
- When the WSL binary (~/.local/bin/claude) is started from a WSL terminal, all commands should execute in the native WSL environment that claude code is running from
- Working directory should be the native Linux path (/home/<user>/repo/<project>)
- Bash commands should have access to WSL-installed tools (php, docker, git, etc.)
- No permission prompts for files within the working directory
Error Messages/Logs
> claude
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise wh
ich was not handled with .catch(). The promise rejected with the reason:
Error: EISDIR: illegal operation on a directory, watch '//wsl.localhost/Ubuntu/home/brad/repo/wishlist/.claude'
at watch (unknown)
at new FSWatcher (node:fs:29:31)
at watch (node:fs:296:23)
at KVL (B:/~BUN/root/claude.exe:168:12437)
at hif (B:/~BUN/root/claude.exe:168:17647)
at _watchWithNodeFs (B:/~BUN/root/claude.exe:168:12918)
at _handleDir (B:/~BUN/root/claude.exe:168:15659)
at async _addToNodeFs (B:/~BUN/root/claude.exe:168:16244)
at async <anonymous> (B:/~BUN/root/claude.exe:168:25654)
at processTicksAndRejections (native:7:39)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise wh
ich was not handled with .catch(). The promise rejected with the reason:
Error: EISDIR: illegal operation on a directory, watch '\\wsl.localhost\Ubuntu\home\brad\repo\wishlist\.claude\settings.
local.json'
at watch (unknown)
at new FSWatcher (node:fs:29:31)
at watch (node:fs:296:23)
at KVL (B:/~BUN/root/claude.exe:168:12437)
at hif (B:/~BUN/root/claude.exe:168:17647)
at _watchWithNodeFs (B:/~BUN/root/claude.exe:168:12918)
at _handleFile (B:/~BUN/root/claude.exe:168:13661)
at _addToNodeFs (B:/~BUN/root/claude.exe:168:16688)
at processTicksAndRejections (native:7:39)
Steps to Reproduce
install git bash (mingwin64), install native claud code for windows via powershell iex command (i used it on windows first), open ubuntu wsl temrinal, install native linux veriosn via install.sh | bash command on teh website.
Run claude from inside wsl ask it to run bash commands to check its shell environment.
it shouldnt even know or care about anything to do with windows but it does.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.14 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗