[BUG] Bash calls fail when Windows PATH environment variable contains parentheses

Resolved 💬 5 comments Opened Apr 18, 2026 by mr-efficient Closed Jun 20, 2026

Preflight Checklist

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

What's Wrong?

The Bash tool takes the process env's Windows PATH, translates entries to POSIX, and injects it unquoted. Since the PATH contains (x86) entries, bash parses them as subshell syntax. That fails to parse.

What Should Happen?

All I know is, Claude Code bash commands worked a week ago, and they broke somewhere around 2.1.111. I haven't changed my PATH. Claude suggests rewriting the entries with Program Files (x86) as 8.3 short-form paths?

Error Messages/Logs

Bash(echo "bash works"; pwd)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: syntax error near unexpected token `('
     /usr/bin/bash: -c: line 1: `source /c/Users/k_wilson/.claude/shell-snapshots/snapshot-bash-1776515829143-7rtapz.sh
     2>/dev/null || true && PATH=C:/Users/k_wilson/.engine_cli_venv/Scripts:/mingw64/bin:/usr/bin:/c/Users/k_wilson/bin:
     /c/Users/k_wilson/.engine_cli_venv/Scripts:/c/Program Files/Microsoft/jdk-21.0.10.7-hotspot/bin:/c/Program Files
     (x86)/SCE/ORBIS/Tools/Publishing Tools/bin:/c/Program Files (x86)/SCE/ORBIS SDKs/12.500/host_tools/bin:/c/Program
     Files (x86)/SCE/ORBIS/Tools/Target Manager Server/bin:/c/Program Files (x86)/SCE/Prospero/Tools/Publishing
     Tools/bin:/c/Program Files (x86)/SCE/Prospero/Tools/Target Manager Server/bin:/c/Program Files (x86)/SCE/Prospero
     SDKs/11.000/host_tools/bin:/c/Program Files (x86)/SCE/Common/SceVSI-VS17/bin:/c/Program
     Files/Python312/Scripts:/c/Program Files/Python312:/c/Program Files/Eclipse
     Adoptium/jdk-17.0.5.8-hotspot/bin:/c/Program Files (x86)/SCE/Common/SceVSI-VS16/bin:/c/Windows/system32:/c/Windows:
     /c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program
     Files/SafeNet/Authentication/SAC/x64:/c/Program Files/SafeNet/Authentication/SAC/x32:/c/Windows/CCM:/c/Program
     Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/dotnet:/c/Program Files/PuTTY:/c/Program
     Files/LLVM/bin:/c/ProgramData/chocolatey/bin:/c/Program Files/nodejs:/c/Program Files/7-Zip:/c/Program
     Files/CMake/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:
     /c/WINDOWS/System32/OpenSSH:/cmd:/c/Program Files/Amazon/AWSCLIV2:/c/Program Files (x86)/Windows Kits/10/Windows
     Performance Toolkit:/c/Program Files/Perforce:/c/Program Files (x86)/SCE/ORBIS/Tools/New Razor
     GPU/bin/CommandTools/bin:/c/Program Files/Docker/Docker/resources/bin:/c/Users/k_wilson/.cargo/bin:/c/Users/k_wilso
     n/AppData/Local/Microsoft/WindowsApps:/c/Users/k_wilson/AppData/Local/Microsoft/WinGet/Packages/Kubernetes.kubectl_
     Microsoft.Winget.Source_8wekyb3d8bbwe:/c/Users/k_wilson/AppData/Local/Programs/Fiddler:/c/Users/k_wilson/AppData/Ro
     aming/npm:/c/Users/k_wilson/.dotnet/tools:/c/Users/k_wilson/go/bin:/c/Users/k_wilson/AppData/Local/Microsoft/Window
     sApps:/c/Users/k_wilson/AppData/Local/Epic Games/UgsCmd:/c/Users/k_wilson/.local/bin'

Steps to Reproduce

  1. Add any folder in C:\Program Files (x86) to your Windows PATH environment variable.
  2. Launch Claude Code
  3. Ask Claude to execute any bash command to test

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.110

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗