| .gitattributes | ||
| .gitignore | ||
| advanced-launcher.bat | ||
| config.ini | ||
| launch-claude-code-direct.bat | ||
| launch-claude-code.bat | ||
| launch-claude-code.ps1 | ||
| LICENSE | ||
| README.md | ||
| setup.bat | ||
WSL Claude Code Launcher
A simple collection of scripts to easily launch Claude Code from Windows using WSL (Windows Subsystem for Linux).
Prerequisites
- Windows 10/11 with WSL installed and configured
- Claude Code installed in your WSL environment
- An Anthropic account with Claude Code access
Installation
- Clone or download this repository to a location on your Windows machine
- Open a WSL terminal and ensure Claude Code is installed and working
- Run
setup.batto create shortcuts on your desktop and Start Menu (optional)
Usage
Basic Usage
Simply double-click launch-claude-code.bat to start Claude Code in your WSL environment. This script will:
- Enter your WSL environment
- Source your
.bashrcfile to load environment settings - Load NVM if you're using it
- Launch Claude Code
Advanced Configuration
For more control, edit the config.ini file to customize:
- Working directory where Claude Code will be launched
- Whether to use NVM to find the Claude Code executable
- Custom path to the Claude Code executable (if not using NVM)
- Additional arguments to pass to Claude Code
Then use advanced-launcher.bat which will read these settings.
Available Launchers
launch-claude-code.bat- Standard launcher using NVMlaunch-claude-code-direct.bat- Launcher using a direct path to Claude Code executablelaunch-claude-code.ps1- PowerShell version of the launcheradvanced-launcher.bat- Configurable launcher that reads settings fromconfig.ini
Creating a Windows Shortcut Manually
You can also create a Windows shortcut manually:
- Right-click on your desktop and select New > Shortcut
- For the location, enter:
C:\Windows\System32\cmd.exe /c "wsl -e bash -c 'source ~/.bashrc && cd /mnt/d/claudecode && export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && \. \"$NVM_DIR/nvm.sh\" && claude'" - Name the shortcut (e.g., "Claude Code") and click Finish
- Optionally, right-click the shortcut, select Properties, and change the icon
This creates a direct shortcut that opens WSL, navigates to your project directory (/mnt/d/claudecode - change this to your preferred location), and runs the Claude Code command.
Customization
If the default launchers don't meet your needs, you can easily modify them:
Finding Your Claude Code Path
In your WSL environment, you can find where Claude Code is installed with:
which claude
The output will be something like:
/home/username/.nvm/versions/node/v22.14.0/bin/claude
You can use this path in the direct launcher or config.ini.
Using a Custom Working Directory
To launch Claude Code in a specific directory, either:
- Edit
config.iniand set theWorkingDirectoryvalue - Or modify the launchers to change the
cdcommand
Troubleshooting
"Command not found" Error
If you get "claude: command not found", ensure:
- Claude Code is properly installed in your WSL environment
- Your
.bashrcfile correctly loads NVM if you're using it - Try using the direct path launcher with the correct path to your Claude Code executable
WSL Not Found
If you get an error about WSL not being found:
- Ensure WSL is installed on your Windows system
- Run
wsl --list --verboseto verify your distributions - You might need to specify the distribution in the launcher with
-d Ubuntu(replace Ubuntu with your distro name)
NVM Not Loading
If NVM isn't loading properly:
- Check if your NVM setup is in
.bashrcor.profile - Modify the launcher to source the correct file
- Try the direct path launcher instead
Contributing
Contributions are welcome! Please feel free to submit a Pull Request or just Fork the source code.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Anthropic for creating Claude Code
- Microsoft for Windows Subsystem for Linux