A comprehensive guide to run Claudia GUI on Windows using WSL (Windows Subsystem for Linux) as a compatibility bridge.
This fix enables Claudia to run on Windows by:
- Installing Claude CLI in WSL where it works natively
- Creating a Windows bridge script (
claude.bat
) that Claudia can communicate with - Automatically detecting and adapting to different Claude CLI versions
- Providing pre-flight checks to ensure everything is configured correctly
- Handling Windows-specific build issues and icon problems
Before starting, ensure you have:
Component | Description | Installation | Notes |
---|---|---|---|
Windows 10/11 | With latest updates | Windows Update | |
WSL 2 | Windows Subsystem for Linux | wsl --install in Admin PowerShell |
May already be installed |
Ubuntu | Linux distribution for WSL | Microsoft Store | Default WSL distro |
Node.js 18+ | Required in WSL for Claude Code | Install via NodeSource in WSL | NOT Windows Node.js |
Bun | JavaScript runtime (Windows) | bun.sh | Install in Windows, not WSL |
Rust | For building Tauri | rustup.rs | Install in Windows |
VS Build Tools | C++ compiler | Download | Select "Desktop development with C++" |
Claudia | The app source code | Clone from GitHub | |
RAM | Minimum 4GB recommended | System requirement |
- Download all files from this gist to your Claudia folder (.gist_v4.2)
- Apply the main.rs patch from
2-claude_binary_patch.rs
- Run
3-setup-windows.bat
(installs Claude CLI in WSL and creates bridge) - Fix Windows compatibility issues in build scripts (see Step 5C)
- Run
bun install
andbun run build
in Windows CMD/PowerShell - Build with
bun run tauri build
in Windows CMD/PowerShell - Launch with
4-start-claudia.bat
Note: Follow the numbered order (2 → 3 → 4) for the setup files!
-
Check if components are already installed:
# In Windows CMD/PowerShell: wsl --status bun --version rustc --version # In WSL: wsl bash -lc "claude --version"
-
If Claude Code is already installed in WSL, skip to Step 3.
-
Open PowerShell as Administrator
# Install WSL with Ubuntu wsl --install
-
Restart your computer
-
Set up Ubuntu
- Ubuntu will open after restart
- Create username and password
- Keep these credentials safe
⚠️ Important: Claude Code does NOT run directly on Windows. It must be installed inside WSL.⚠️ Critical: Make sure you're using WSL Node.js, NOT Windows Node.js!
-
Open Ubuntu/WSL Terminal
-
Install Node.js 18+ via NodeSource (Recommended)
# Update package list sudo apt update # Install curl if not present sudo apt install -y curl # Add NodeSource repository for Node.js 20.x curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - # Install Node.js sudo apt install -y nodejs # Verify installation (should show v20.x or higher) node --version npm --version
-
Configure npm for Linux (Important for WSL)
# Ensure npm uses Linux paths, not Windows npm config set prefix ~/.npm-global npm config set os linux # Add npm global bin to PATH echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc source ~/.bashrc
-
Install Claude Code
# Install Claude Code globally (do NOT use sudo) npm install -g @anthropic-ai/claude-code # If you encounter platform detection errors, use: npm install -g @anthropic-ai/claude-code --force --no-os-check # Verify installation claude --version
-
Troubleshooting Node/npm in WSL
If
which npm
shows/mnt/c/...
(Windows path), you're using Windows npm:# Check if using Windows npm/node which npm which node # If pointing to /mnt/c/, remove Windows paths from WSL # Edit ~/.bashrc and remove any Windows PATH additions nano ~/.bashrc # Remove lines that add /mnt/c/... to PATH
-
Install Bun (in Windows, NOT WSL)
- Visit https://bun.sh/
- Run the PowerShell command (NOT as admin)
- Verify:
bun --version
-
Install Rust (in Windows, NOT WSL)
- Visit https://rustup.rs/
- Run the installer
- Verify:
rustc --version
-
Install Visual Studio Build Tools
- Download from Microsoft
- Select "Desktop development with C++"
- Install and restart if needed
-
Clone Claudia (if not already done)
git clone https://github.com/getAsterisk/claudia.git cd claudia
-
Create .gist_v4.2 folder and download fix files
mkdir .gist_v4.2
- Save all files from this gist into
.gist_v4.2
folder:1-claudia-windows-fix.md
(this file)2-claude_binary_patch.rs
3-setup-windows.bat
4-start-claudia.bat
5-apply-patches.bat
(NEW - automatic patching)README.md
- Save all files from this gist into
⚠️ Important: Follow the numbered order of the files! 💡 Why this order? Patching first ensures code compatibility before setting up the bridge.
- Open
src-tauri/src/main.rs
- Add the version checking code from
2-claude_binary_patch.rs
- Important: Keep existing imports and handlers, just add the version check code
- This patch: Allows Claudia to accept multiple Claude CLI versions
-
Navigate to .gist_v4.2 folder and run:
3-setup-windows.bat
-
This will:
- ✅ Create the Windows bridge script (
claude.bat
) - ✅ Set up required directories
- ✅ Configure PATH variables
- ✅ Install/update Claude Code in WSL (if needed)
- ✅ Create the Windows bridge script (
-
Important Note: The default path to npm must be followed.
C:\Users\USERNAME\AppData\Roaming\npm\claude.bat
If Claude Code is already installed, some errors are normal
Choose ONE of these methods:
- Run the patch script:
cd .gist_v4.2 5-apply-patches.bat
- Done! The script applies all patches automatically.
Only 3 simple search & replace operations needed:
-
File:
scripts/fetch-and-build.js
- Find:
await runCommand('cp'
- Replace entire line with:
if (process.platform === 'win32') { await runCommand('robocopy', [srcPath, destPath, '/E', '/NFL', '/NDL', '/NJH', '/NJS', '/nc', '/ns', '/np']); } else { await runCommand('cp', ['-r', srcPath, destPath]); }
- Find:
-
File:
scripts/build-executables.js
- Find:
spawn(command, args, { stdio: 'inherit' }
- Replace with:
spawn(command, args, { stdio: 'inherit', shell: process.platform === 'win32' }
- Find:
-
File:
src-tauri/tauri.conf.json
- Find:
"icons/icon.png"
- Add after it:
,
and new line"icons/icon.ico"
- Find:
-
Place the start script in main Claudia directory:
copy .gist_v4.2\4-start-claudia.bat start-claudia.bat
-
Important: The script must be in the root Claudia folder, not in .gist_v4.2
If you encounter icon format errors:
-
Create an icons backup folder:
mkdir C:\Development\icons
-
Copy working icons (if provided) to
src-tauri/icons/
-
Common icon error:
- Error:
resource file icon.ico is not in 3.00 format
- Solution: Use properly formatted .ico files or icon generation tools
- Error:
⚠️ CRITICAL: All build commands MUST be run in Windows CMD/PowerShell, NOT in WSL!
-
Install dependencies (in Windows CMD)
bun install
-
Build frontend (in Windows CMD)
bun run build
-
Build Tauri app (in Windows CMD)
bun run tauri build
-
Ensure start-claudia.bat is in the main Claudia folder
- The file must be copied from
.gist_v4.2\4-start-claudia.bat
to the root directory - Final location:
C:\path\to\claudia\start-claudia.bat
(NOT in .gist_v4.2)
- The file must be copied from
-
Always use
start-claudia.bat
to launch (not4-start-claudia.bat
)- Double-click the file or run from CMD
- This script performs pre-flight checks
- If any check fails, follow the on-screen instructions
graph LR
A[Claudia GUI] -->|calls| B[claude.bat]
B -->|forwards to| C[WSL]
C -->|executes| D[Claude CLI]
D -->|returns| C
C -->|returns| B
B -->|returns| A
Key Components:
- Claude CLI - Runs natively in WSL/Linux environment
- claude.bat - Windows bridge script that:
- Detects Claude CLI version automatically
- Filters incompatible Windows arguments
- Handles proper command escaping
- Patched main.rs - Accepts multiple Claude versions
- start-claudia.bat - Pre-flight checker and launcher
Error | Cause | Solution |
---|---|---|
claude: command not found |
CLI not installed in WSL | Run 2-setup-windows.bat again |
claude.bat is not recognized |
PATH not configured | Add C:\Users\USERNAME\AppData\Roaming\npm to system PATH |
Failed to load settings |
Missing ~/.claude directory | Run setup script or wsl mkdir -p ~/.claude |
Version mismatch |
Old patch version | Ensure you applied v4.2 patch |
Wrong WSL distribution |
Multiple WSL installs | Edit claude.bat, set WSL_DISTRO=Ubuntu |
icon.ico not in 3.00 format |
Invalid icon format | Use provided icons or regenerate |
cp command not found |
Unix commands in Windows | Apply build script patches |
ENOENT: spawn bun |
Missing shell option | Apply build-executables.js patch |
Couldn't find a .ico icon |
Missing icon in config | Add icon.ico to tauri.conf.json |
pkg-config not found |
Building in WSL instead of Windows | Build in Windows CMD, not WSL |
NEVER run build commands in WSL! Common mistakes:
- ❌ Running
cargo build
in WSL terminal - ❌ Running
bun run build
in WSL terminal - ✅ Always use Windows CMD or PowerShell
- ✅ The start-claudia.bat script runs in the correct environment
Run these commands to verify your setup:
# Check WSL
wsl --status
# Check Claude in WSL
wsl bash -lc "~/.npm-global/bin/claude --version"
# Check bridge
claude --version
# Check Bun
bun --version
# Check Rust
rustc --version
If claude.bat
is not found:
- Press
Win + X
→ System → Advanced system settings - Click "Environment Variables"
- Under "User variables", select "Path" and click "Edit"
- Add new entry:
C:\Users\USERNAME\AppData\Roaming\npm
(replace USERNAME with your actual username) - Click OK and restart Command Prompt
Feature | v4.1 | v4.2 |
---|---|---|
Build Script Patches | Not mentioned | Detailed Windows fixes |
Icon Handling | Basic | Comprehensive troubleshooting |
Build Location | Unclear | Explicit Windows CMD requirement |
Error Documentation | Basic | Extensive with solutions |
Pre-installation Checks | None | Check existing installations |
Script Modifications | Main.rs only | Multiple script patches |
- Added Windows-specific build script patches
- Clear warnings about build location (Windows vs WSL)
- Comprehensive icon error handling
- Robocopy exit code handling
- Shell spawn fixes for Windows
- Better error messages and solutions
- Development Mode: The start script runs Claudia in dev mode by default
- Production Build: For production, use
bun run tauri build
instead - Updates: When updating Claudia, you may need to reapply patches
- Multiple WSL: If you have multiple distributions, edit claude.bat to specify which one
- Build Environment: ALWAYS build in Windows CMD/PowerShell, NEVER in WSL
Found an issue or improvement? Please contribute:
- Test the fix thoroughly
- Document any new issues
- Share your improvements with the community
This fix was developed collaboratively by the Claudia community. Special thanks to all testers and contributors who helped refine this solution for Windows users.
Version: 4.2
Last Updated: January 2025
Compatibility: Windows 10/11, WSL2, Claudia 0.1.0+
Major Contributors: Community testers who identified build script issues, icon problems, and WSL/Windows confusion
I cant get this to work, even with Claude's assistance. Im seeing:
`C:\DS\claudia>4-start-claudia.bat
This script will verify your system configuration and then
launch the Claudia application.
[1/5] Verifying System Prerequisites...
Checking for 'bun'...
Checking for 'WSL'...
is was unexpected at this time.`
I tried to do things related to your last troubleshoot but it isn't working. Thanks for trying to do this.