← Agent directory

Claude Code

Ready Git probe / CLAUDE_CODE_GIT_BASH_PATH Windows Difficulty Easy

Works with no config by default: the installer drops a bash launcher right on the probe path; an env var can pin it explicitly.

settings.json · pin it explicitly (not needed by default; only when the probe misses)
{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Users\\<你>\\AppData\\Local\\Programs\\Niubash\\winuxcmd\\bin\\bash.exe"
  }
}

Steps

  1. Installing niubash is the whole job: the installer places a bash.exe launcher in C:\Program Files\Git\bin, exactly hitting Claude Code's first probe
  2. If the probe misses, write the env block above into the Claude Code settings.json

Verify

echo "SHELL=$SHELL"; uname -s — expect uname -s to start with MSYS_NT-

Rollback

Remove env.CLAUDE_CODE_GIT_BASH_PATH from settings.json

Notes & pitfalls

Sources

Chinese edition of this page: /agents/claude-code/