Bash tool fails when Windows username contains a single quote
Bug Description
The Bash tool fails on every command when the Windows user profile path contains a single quote (').
Username: Le'novo
Home directory: C:\Users\Le'novo
Every Bash command (even simple ones like pwd, hostname) fails with:
/usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''
Steps to Reproduce
- Have a Windows username containing a single quote (e.g.,
Le'novo) - Launch Claude Code from the home directory (
C:\Users\Le'novo) - Attempt any Bash command
Expected Behavior
The Bash tool should properly escape special characters (including ') in the working directory path before passing commands to the shell.
Actual Behavior
All Bash commands fail immediately. The single quote in the path is interpreted as a shell quote character, leaving it unmatched.
Environment
- OS: Windows 11 Pro 10.0.22621
- Shell: bash (Git Bash / WSL)
- Claude Code model: claude-opus-4-6
Workaround
Launching Claude Code from a directory whose full path contains no special characters (e.g., cd C:\projects && claude).
Suggested Fix
Ensure the working directory path is properly escaped (e.g., using double quotes with proper escaping, or printf '%q') before being interpolated into the bash -c command string.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗