Omniscio

OmniscioGuidesClaude Code on Windows requires git-bash

Claude Code on Windows requires git-bash, and what to install or point it at

On Windows, Claude Code gives Claude a shell to run commands in. It has two candidates, Git Bash and a native PowerShell tool, and normally shows this line only when neither one can be found.

Checked against Anthropic's Claude Code documentation and changelog on November 25, 2026. By the Omniscio team. Updated .

What is the exact message?

Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win).
If installed but not in PATH, set environment variable pointing to your bash.exe,
similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe

That is the wording the VS Code panel prints, quoted from a bug report and wrapped here to fit the page; the terminal shows the same sentence without the line breaks. The message reads as though Git Bash were mandatory; Anthropic's documentation says it is not, and the rest of this page is about which half of the sentence you are actually in.

What does it mean?

Anthropic's install troubleshooting page puts it plainly: Git for Windows is optional, Claude Code uses the PowerShell tool when Git Bash is absent, so this error means neither shell was found.

That single sentence splits every reader of this page in two. Install Git for Windows and the Bash tool works; install nothing and make PowerShell reachable instead, and Claude Code runs your commands there. What it cannot do is run with no shell at all.

Which shell you get, and when

  • Git Bash is the shell that comes with Git for Windows. With that installed, the Bash tool runs commands in Git Bash and the PowerShell tool is available alongside it; because that tool is on by default for claude.ai and Console accounts, PowerShell is then the primary shell.
  • Without Git for Windows, the PowerShell tool is enabled automatically.
  • The PowerShell tool is on by default once Git Bash is present, for a claude.ai login and for an Anthropic Console account (the account you use at platform.claude.com); on Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry sessions it needs CLAUDE_CODE_USE_POWERSHELL_TOOL=1, and 0 turns it off.
  • Claude Code auto-detects pwsh.exe, which is PowerShell 7 or later, and falls back to powershell.exe, which is Windows PowerShell 5.1.

Why the second half of the message exists

Git can be installed on a machine and still be invisible to Claude Code, so the message names the variable that tells Claude Code exactly where to look. That variable is checked before the automatic search, which is why it is the fix for an install in an unusual folder.

How do I fix it?

Which of these is yours?

Two commands in PowerShell tell you before you change anything:

where.exe git
claude --version
  • No path printed for git: Git is not installed, so install Git for Windows.
  • A path printed that ends in Git\cmd\git.exe: Git is installed and Claude Code is not finding it, so point it at that install's bin\bash.exe.
  • Git installed and the version is 2.1.120 or later: the PowerShell route can work instead, with no Git at all.

Before any of that, if you are in the VS Code panel and claude --version in a terminal is 2.1.98 or later, update the extension first: before 2.1.98 the panel could raise this message while Git Bash was configured correctly.

Install Git for Windows

  1. Download it from git-scm.com/downloads/win and run the installer.
  2. During setup, select "Add to PATH" so your terminals find Git too. A standard install also lands in C:\Program Files\Git, which Claude Code checks first, so the second half of the error does not apply to it.
  3. Restart your terminal, then start claude again. A terminal that was already open keeps the PATH it started with.

Or give Claude Code a PowerShell to use

This route needs v2.1.120 or later, the release that made Git for Windows optional by running PowerShell when it is absent. On an older build, update Claude Code first or take the Git for Windows route above.

  1. Windows PowerShell's default folder is C:\Windows\System32\WindowsPowerShell\v1.0\. Add that folder to your user PATH (Start, then "Edit the system environment variables", then Environment Variables), or install PowerShell 7, which provides pwsh.
  2. Restart your terminal, then start claude again. From v2.1.327 the start-up check also looks in the standard install locations itself, so a current build often needs no PATH edit at all; claude --version tells you which build you have.

Point Claude Code at a Git install it cannot find

Find it with where.exe git in PowerShell, which usually reports ...\Git\cmd\git.exe. Take bin\bash.exe from the same Git installation, in the bin folder beside that cmd one, and set it in the env block of your user settings file, which on Windows is %USERPROFILE%\.claude\settings.json. Create the file if it is not there yet:

{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

When the variable is unset, Claude Code looks in C:\Program Files\Git and C:\Program Files (x86)\Git first, then takes bin\bash.exe from the git on your PATH.

Start a new session after saving the file: Claude Code reads the env block when a session starts.

It skips a git that sits in the folder you launched Claude Code from, or below one whose path contains node_modules or a virtual-environment folder such as .venv or env. A project that ships its own Git therefore cannot have it picked up by accident; a Git you really do keep in a folder like that is exactly what the variable is for.

Why the variable sometimes changes nothing

Claude Code accepts only a file named bash.exe, sh.exe, bash or sh. Point the variable at Git for Windows' git-bash.exe launcher, or at a path that does not exist, and it is ignored: Claude Code auto-detects as though the variable were unset and logs a warning you only see with --debug.

Before v2.1.219 the check was looser, and a path that did not exist ended startup with Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path instead. If you find that older line in a log, you are on a build older than 2.1.219 and updating changes which message you get, not the fix.

If both shells are installed and it still fails

Anthropic's next step is endpoint security. AppLocker, Group Policy software restriction policies and EDR agents can stop claude.exe from starting the processes it spawns, so ask IT to allowlist claude.exe, cmd.exe and bash.exe in the endpoint protection policy.

How do I know it is fixed?

  • Claude Code starts instead of printing the error. The check happens before the session opens, so reaching a prompt is the confirmation.
  • Ask Claude to run a shell command and watch the result, not the tool's name. Once Git Bash is installed the PowerShell tool is on by default, so a command running in PowerShell is the expected outcome, not a failure.
  • If you set the variable, run claude --debug and look for the warning about the path. No warning means the file name and the path were both accepted.

Where these answers come from

Common questions

What does "Claude Code on Windows requires git-bash" mean?

It means neither shell Claude Code can use was found. Git for Windows is optional, and without it Claude Code runs commands through its PowerShell tool, so the message appears when Git Bash is missing and PowerShell is not on your PATH. The fix is to make one of the two available.

Is Git Bash required on Windows?

No. Anthropic's setup page says Git for Windows is optional on native Windows and that Claude Code uses the PowerShell tool when it is absent. Git for Windows is still what enables the Bash tool and the Monitor tool, so a session without it runs shell commands in PowerShell instead.

Where does Claude Code look for bash.exe?

It checks C:\Program Files\Git and C:\Program Files (x86)\Git first, then takes bin\bash.exe from the git on your PATH. It skips a git that sits in the folder you launched Claude Code from, or below one whose path contains node_modules or a virtual-environment folder such as .venv or env.

I set CLAUDE_CODE_GIT_BASH_PATH and it still fails. Why?

Check the file's name. Claude Code accepts only a file called bash.exe, sh.exe, bash or sh, so pointing the variable at Git for Windows' git-bash.exe launcher is ignored and Claude Code falls back to auto-detection with a warning you only see under --debug. A variable pointing at a path that does not exist is ignored the same way.

Does this message appear in the VS Code extension too?

Yes. The extension runs its own bundled copy of Claude Code, so the same start-up check applies in the panel. Before v2.1.98 that check could fire there as a false positive while Git Bash was already configured, so update the extension first; then fixing the shell on the machine covers both.

What if both shells are installed and the error still appears?

Anthropic's next suspect is endpoint security. AppLocker, Group Policy software restriction policies and EDR agents can stop claude.exe from starting the processes it spawns, so IT has to allowlist claude.exe together with cmd.exe and bash.exe.