Closed
Description
Problem Description
I'm trying to run Claude Code through VS Code's tasks.json configuration in a WSL environment, but getting a "command not found" error.

Environment
- OS: Windows 11 with WSL2
- WSL Distribution: Ubuntu-22.04
- VS Code: Using tasks.json to run Claude in WSL terminal(* WSL terminal is the default terminal)
Current Configuration
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Claude in WSL Terminal",
"type": "shell",
"command": "claude",
"options": {
"shell": {
"executable": "wsl.exe",
"args": [
"-e",
"bash",
"-c"
]
}
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
Error Output
bash: line 1: claude: command not found
The terminal process "wsl.exe -e bash -c claude" terminated with exit code: 127.
Attempted Solutions
I've checked the following:
- Node.js and npm are properly installed in WSL
- Tried running
which claude
, then get a proper result "/home/[username]/.nvm/versions/node/v22.16.0/bin/claude"
I'm new to using tasks in VS Code.
Any guidance on the proper setup would be greatly appreciated!