Skip to content
AI Dev Toolkit.
Esc
  • Loading…

Claude Code · Install and setup

Claude Code on Windows requires either Git for Windows (for bash) or PowerShell

Fix “Claude Code on Windows requires either Git for Windows (for bash) or PowerShell”: add PowerShell to PATH or point Claude Code at bash.exe.

Message

The exact error

Claude Code
Claude Code on Windows requires either Git for Windows (for bash) or PowerShell

Also appears as:

Before v2.1.219, with CLAUDE_CODE_GIT_BASH_PATH set to a missing file
Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path
Very old versions
Claude Code is not supported on Windows.

Meaning

Why does Claude Code on Windows require Git Bash or PowerShell?

Claude Code needs a shell to run commands. Git for Windows is optional: when Git Bash is absent, Claude Code uses its PowerShell tool instead, so this error means neither shell could be found. Installing Git adds the Bash tool, which helps with Bash-based scripts and tooling. Old Claude Code versions didn’t run on Windows at all, which is where “Claude Code is not supported on Windows” comes from.

Causes

Git is installed: why can’t Claude Code find it?

  • PowerShell missing from PATH
  • Git for Windows installed somewhere Claude Code doesn’t look, such as a Scoop or portable install that isn’t on PATH
  • CLAUDE_CODE_GIT_BASH_PATH pointing at git-bash.exe or a file that doesn’t exist, so Claude Code ignores it
  • Endpoint security software blocking the shell processes
  • A very old Claude Code version

Fix

How do I fix the Git Bash or PowerShell error?

  1. Update Claude Code

    If you see “not supported on Windows”, install the current version: irm https://claude.ai/install.ps1 | iex in PowerShell, or winget install Anthropic.ClaudeCode.

  2. Make sure PowerShell is on PATH

    Its default folder is C:\Windows\System32\WindowsPowerShell\v1.0\. Add it to PATH, or install PowerShell 7 (pwsh).

  3. Or install Git for Windows

    Download Git for Windows, select “Add to PATH” during setup, then restart your terminal so it picks up the new PATH.

  4. Point Claude Code at a specific Git install

    Run where.exe git in PowerShell to find the install, then set the bin\bash.exe inside it as CLAUDE_CODE_GIT_BASH_PATH in ~/.claude/settings.json. Claude Code accepts only a file named bash.exe, sh.exe, bash or sh: Git’s git-bash.exe launcher, or a path that doesn’t exist, is ignored with a warning you can see with --debug. The settings.json builder writes the env block for you.

    Windows PowerShell
    where.exe git
    settings.json
    {
      "env": {
        "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
      }
    }
  5. If it still fails

    Endpoint security software such as AppLocker, Group Policy software restriction policies or an EDR agent may be blocking the shells. Ask IT to allowlist claude.exe and the processes it starts, including cmd.exe and bash.exe.

Explained

Where does Claude Code look for Git Bash?

When CLAUDE_CODE_GIT_BASH_PATH isn’t set, Claude Code looks for bash.exe first in the default install folders, C:\Program Files\Git and C:\Program Files (x86)\Git, then through the git on your PATH, using the bin\bash.exe from that installation. It skips a git that sits in the folder you launched Claude Code from, or below it in a path containing node_modules or a virtual-environment folder such as .venv, so a project can’t plant its own shell. If your Git lives somewhere like that, set the variable.

Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and a path that didn’t exist stopped it at startup with Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path. Updating Claude Code turns that into a warning and a fallback to auto-detection.

Explained

What does “Claude Code does not support 32-bit Windows” mean?

Windows has two PowerShell entries in the Start menu: Windows PowerShell and Windows PowerShell (x86). The x86 one runs as a 32-bit process and gives this error even on a 64-bit machine. In the same window, run [Environment]::Is64BitOperatingSystem: True means your system is fine, so close the window, open Windows PowerShell without the x86 suffix and run the install command again. False means a 32-bit edition of Windows, which Claude Code doesn’t support. For other install problems, see command not found: claude, install script returns HTML and curl (60) during install.

FAQ

Questions people ask

Do I need Git for Windows to use Claude Code?

No. Current versions use the PowerShell tool when Git Bash is absent, so Git for Windows is optional. Installing it enables the Bash tool, which helps with Bash-based scripts and tooling. You only see this error when neither shell can be found, for example when PowerShell has been removed from PATH.

Why is CLAUDE_CODE_GIT_BASH_PATH ignored?

Claude Code accepts only a file named bash.exe, sh.exe, bash or sh. Pointing it at Git’s git-bash.exe launcher, or at a path that doesn’t exist, makes Claude Code ignore the variable and auto-detect instead, logging a warning you can see with --debug. Use the bin\bash.exe inside your Git install, found with where.exe git.

Why does Claude Code say it doesn’t support 32-bit Windows on a 64-bit PC?

You probably opened “Windows PowerShell (x86)”, which runs as a 32-bit process. Run [Environment]::Is64BitOperatingSystem in that window: if it prints True, close it, open the normal Windows PowerShell entry and run the install command again. If it prints False, the Windows edition itself is 32-bit and Claude Code needs a 64-bit system.

Related

Search all Claude Code errors

Keep exploring