Skip to content

[BUG] All file operations fail with "Executable not found in $PATH" error on Windows - PATH not recognized #19542

Description

@Heurazio

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Environment

  • OS: Windows 11 (MSYS_NT-10.0-26200 3.6.5-22c95533.x86_64)
  • VSCode Version: Stable (latest as of 2026-01-20)
  • Claude Code Extension Version: Latest (as of 2026-01-20)
  • Git Installation: Git for Windows installed at C:\Program Files\Git
  • WSL: Windows Subsystem for Linux installed
  • Working Directory: c:\Users\<USER>\Desktop\<PROJECT>

Problem Description

All Claude Code file operation tools (Bash, Write, Edit, Read) fail with the error:
Executable not found in $PATH: "C:\Program Files\Git\bin"

Search tools work fine:

  • ✅ Glob tool works
  • ✅ Grep tool works
  • ❌ Bash tool fails
  • ❌ Write tool fails
  • ❌ Edit tool fails
  • ❌ Read tool fails

This prevents Claude Code from performing any file operations or bash commands, making the extension essentially non-functional.

Critical Findings

1. Git Bash Terminal Works Perfectly

VSCode's integrated Git Bash terminal works without issues:

<USER>@<USER>-PC MINGW64 ~/Desktop/<PROJECT>
$ pwd
/c/Users/<USER>/Desktop/<PROJECT>

$ echo $SHELL
/usr/bin/bash

$ which git
/mingw64/bin/git

$ "/c/Program Files/Git/bin/bash.exe" --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)

2. PowerShell Can Execute Bash

PowerShell successfully executes bash from the Git installation:

PS C:\Users<USER>> C:"Program Files"\Git\bin\bash.exe -c "echo test"
test

3. Windows System PATH is Configured Correctly

PowerShell shows Git paths in system PATH:

PS C:\Users<USER>> $env:Path
C:\windows\SysWOW64;C:\windows\System32;C:\Program Files\Git\cmd;C:\Program Files\Git\bin;C:\Users<USER>\AppData\Local\Microsoft\WindowsApps;...;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin


All three Git directories are present:

- `C:\Program Files\Git\bin` (contains bash.exe, sh.exe, git.exe)
- `C:\Program Files\Git\mingw64\bin`
- `C:\Program Files\Git\usr\bin`

4. Files Verified to Exist

Windows File Explorer confirms executables exist:

C:\Program Files\Git\bin\

bash.exe (47,008 bytes)
sh.exe (47,008 bytes)
git.exe (46,480 bytes)

File permissions are correct (executable).

5. VSCode Configuration is Correct

settings.json configured with Git Bash:

{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.profiles.windows": {
        "Git Bash": {
            "path": "C:\\Program Files\\Git\\bin\\bash.exe",
            "icon": "terminal-bash"
        }
    },
    "terminal.integrated.automationProfile.windows": {
        "path": "C:\\Program Files\\Git\\bin\\bash.exe"
    }
}

6. Claude Code Configuration is Minimal

.claude/settings.local.json contains only:
{}

Steps to Reproduce

  • Install Windows 11 with Git for Windows at C:\Program Files\Git
  • Add Git directories to Windows System PATH:
  • C:\Program Files\Git\bin
  • C:\Program Files\Git\mingw64\bin
  • C:\Program Files\Git\usr\bin
  • Verify paths exist and executables are present
  • Install Claude Code extension in VSCode
  • Configure VSCode with Git Bash terminal settings (including automation profile)
  • Restart computer
  • Open VSCode and Claude Code
  • Attempt to use any file operation tool (Bash, Write, Edit, Read)
  • All operations fail with: Executable not found in $PATH: "C:\Program Files\Git\bin"

What We Tried (All Failed)

1. System PATH Configuration

  • Added all three Git directories to Windows System PATH (System variables, not User)
  • Verified paths exist and contain executables
  • Multiple full computer restarts
  • Verified in PowerShell that PATH contains all Git directories
  • Issue persists

2. VSCode Terminal Configuration

Configured terminal.integrated.defaultProfile.windows to use Git Bash
Configured terminal.integrated.automationProfile.windows to use Git Bash
Multiple full VSCode restarts (close application, reopen)
Issue persists

3. Extension Reinstallation

  • Completely uninstalled Claude Code extension
  • Closed VSCode
  • Reopened VSCode
  • Reinstalled Claude Code extension
  • Closed and reopened VSCode
  • Issue persists

4. WSL Reinstallation

  • Reinstalled Windows Subsystem for Linux
  • Full system restart
  • Issue persists

5. Claude Code Permissions

  • Tried various .claude/settings.local.json configurations
  • Tried empty config {}
  • Tried wildcard permissions
  • Issue persists

6. Sandbox Bypass

  • Tried dangerouslyDisableSandbox: true parameter
  • Issue persists

7. Multiple Restart Cycles

  • Computer restarts after PATH changes
  • VSCode full restarts (not just reload)
  • Extension reinstallation with restarts
  • Issue persists through all restart cycles

Analysis

The error occurs before any command executes. The error message is identical regardless of:

  • Command being executed
  • File path being accessed
  • Tool being used (Bash, Write, Edit, Read all show same error)

Search Tools Work:

  • Glob and Grep tools work perfectly
  • Only file I/O and execution tools fail
  • Suggests the issue is specifically with tools that need shell/file system access

PATH is Not Being Recognized:
Despite:

  • Git paths being in Windows System PATH (verified in PowerShell)
  • VSCode terminal working with Git Bash
  • PowerShell being able to execute bash
  • Multiple restarts

Claude Code still reports: Executable not found in $PATH: "C:\Program Files\Git\bin"

The Error Message is Misleading:
The error says executables are not found in C:\Program Files\Git\bin, but:

  • The directory exists
  • Executables are present in that directory
  • They are executable
  • PowerShell can run them
  • The directory is in system PATH

What Should Happen?

Claude Code should:

  • Detect Git Bash from Windows system PATH
  • Use VSCode's configured automation profile
  • Execute bash commands using the configured shell
  • Create, read, and edit files in the project directory
  • Function on Windows with Git for Windows installed

Error Messages/Logs

Executable not found in $PATH: "C:\Program Files\Git\bin"

Impact
- Cannot use Claude Code for file operations
- Extension is 90% non-functional (only search tools work)
- Cannot automate project setup
- Cannot write or edit code
- Cannot execute commands
- Defeats primary purpose of the extension

Steps to Reproduce

see above

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.12 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions