Prerequisites
- Windows machine
- GitBash installed (you can get it from git-scm.com)
- Node.js version 18 or above installed (download from nodejs.org)
Step-by-Step Setup
1. Install Node.js 18+
Make sure you have Node.js 18 or newer installed. You can verify this by running in GitBash or PowerShell:
$node -v
It should return a version number 18.x or above.
2. Install the Claude Code CLI
Before installing the package, open GitBash and run this command to avoid npm script execution issues on Windows:
$export NPM_CONFIG_IGNORE_SCRIPTS=true
Now, install the Claude Code CLI globally:
$npm install -g @anthropic-ai/claude-code
3. Configure Claude Code Environment
This step is only necessary if you are using a custom API endpoint rather than the default Claude API service. If you’re using Claude directly through Anthropic’s standard API, you can skip this step.
Create or edit the following file:
C:\Users\<YourUserName>\.claude.json
Add the following lines inside the JSON, but before the "projects"
section if it exists:
json"env": {
"ANTHROPIC_BASE_URL": "<CUSTOM_URL>",
"ANTHROPIC_MODEL": "anthropic/claude-sonnet-4-20250514",
"ANTHROPIC_AUTH_TOKEN": "<YOUR_API_KEY>"
}
Make sure to replace <YOUR_API_KEY>
with your actual API key.
4. Set the Shell Environment Variable
The Claude CLI expects a Linux-like shell environment. Since we are using GitBash, we need to tell the CLI where to find it.
For PowerShell Users:
Open this file in an editor:
C:\Users\<YourUserName>\AppData\Roaming\npm\claude.ps1
Insert the following line before the first if
condition:
$env:SHELL = Join-Path $env:USERPROFILE "AppData\Local\Programs\Git\git-bash.exe"
For Command Prompt Users:
Open this file in an editor:
C:\Users\<YourUserName>\AppData\Roaming\npm\claude.cmd
Insert the following line before the first if
condition:
set SHELL=%USERPROFILE%\AppData\Local\Programs\Git\git-bash.exe
How to Run Claude Code Now
After completing the setup, you can simply run the claude
command from any terminal on your Windows machine — whether it’s Command Prompt, PowerShell, GitBash, or the terminal inside IntelliJ IDE.
claude
This will start Claude Code without requiring WSL or any additional Linux subsystem.
Using Claude Code in IntelliJ
For an even more integrated experience, you can install the Claude Code JetBrains plugin directly in IntelliJ IDEA or other JetBrains IDEs.
Once installed, you can launch Claude Code easily by clicking the Claude Code icon in your IDE.
Important Note:
This setup is a workaround to run Claude Code on Windows without WSL using GitBash. It is not an official solution provided by Anthropic or Claude developers. Use it at your own discretion, and keep an eye on official updates for native Windows support.