thedotmack/claude-mem · warning

Git Bash not found. claude-mem hooks require bash, and Claud

Error message

Git Bash not found. claude-mem hooks require bash, and Claude Code resolves it via Git for Windows on Windows. Install Git for Windows (https://git-scm.com/download/win), or if bash is installed somewhere non-standard, set CLAUDE_CODE_GIT_BASH_PATH to the full path of bash.exe.

What it means

On Windows, the installer checks for Git Bash (bash.exe) via checkWindowsGitBash() because claude-mem hooks require bash and Claude Code on Windows resolves bash through Git for Windows. If the check fails, the installer logs this message as a warning (not a hard stop) explaining how to install Git for Windows or point CLAUDE_CODE_GIT_BASH_PATH at a non-standard bash.exe. Per the source comment, warning rather than failing is intentional: the operator may install Git for Windows later and hooks start working without a reinstall.

Source

Thrown at src/npx-cli/commands/install.ts:2005

  const dot = styleText('dim', '·');
  const segments = [`${styleText('bold', 'claude-mem')} ${styleText('cyan', `v${version}`)}`];
  if (existingVersion && existingVersion !== version) {
    segments.push(`installed ${styleText('yellow', `v${existingVersion}`)}`);
  } else if (existingVersion) {
    segments.push(styleText('dim', 'reinstall'));
  }
  log.info(segments.join(` ${dot} `));

  // All claude-mem hooks run via `"shell": "bash"`; on Windows, Claude Code
  // resolves that through Git for Windows with no WSL fallback. Surfacing it
  // here — rather than letting the first hook throw an unbranded error — is
  // a warning, not a hard stop: the operator may install Git for Windows
  // after this run and hooks will start working without a reinstall.
  if (IS_WINDOWS) {
    const gitBash = checkWindowsGitBash();
    if (!gitBash.ok) {
      log.warn(gitBash.detail);
    }
  }

  if (alreadyInstalled) {
    if (process.stdin.isTTY) {
      const shouldContinue = await p.confirm({
        message: 'Overwrite existing installation?',
        initialValue: true,
      });

      if (p.isCancel(shouldContinue) || !shouldContinue) {
        p.cancel('Installation cancelled.');
        process.exit(0);
      }
    }
  }

  let selectedIDEs: string[];

View on GitHub (pinned to 8bc631a71a)

Solutions

  1. Install Git for Windows from https://git-scm.com/download/win and re-run the install.
  2. If bash.exe is already installed in a non-standard location, set CLAUDE_CODE_GIT_BASH_PATH to the full path of bash.exe and re-run install.
  3. Verify bash.exe runs from a terminal (e.g. "C:\Program Files\Git\bin\bash.exe" --version).
  4. If you plan to install Git later, you may proceed past this warning; hooks will start working once bash is available.

Example fix

// before
set CLAUDE_CODE_GIT_BASH_PATH=        (unset, bash not found)
// after
set CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe
npx claude-mem install
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'fs';
const candidates = [process.env.CLAUDE_CODE_GIT_BASH_PATH, 'C:\\Program Files\\Git\\bin\\bash.exe'].filter(Boolean) as string[];
const ok = candidates.some(p => existsSync(p));
if (!ok) console.warn('Install Git for Windows or set CLAUDE_CODE_GIT_BASH_PATH.');

Prevention

When it happens

Trigger: IS_WINDOWS is true and checkWindowsGitBash() returns ok:false — Git for Windows is not installed, bash.exe is not in the locations Claude Code searches, or bash.exe is installed in a non-standard location and CLAUDE_CODE_GIT_BASH_PATH is not set.

Common situations: Fresh Windows machine without Git for Windows; Git installed via a stripped-down distribution without bash; bash.exe in a custom directory (scoop/chocolatey paths) not discovered automatically; WSL-only bash, which Claude Code does not use.

Understand the failure class

Background: "X is not installed. Please install it with pip install Y": missing optional dependency errors — ImportError/ValueError raised when a library's optional extra was never installed — this error's family across 22 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@8bc631a71a (2026-09-09). Data as JSON: /api/errors/d0ab72c73921cd3d. Report an issue: GitHub.