Bash tool fails when Windows username contains a single quote

Resolved 💬 4 comments Opened Feb 19, 2026 by huakoh Closed Feb 23, 2026

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

  1. Have a Windows username containing a single quote (e.g., Le'novo)
  2. Launch Claude Code from the home directory (C:\Users\Le'novo)
  3. 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.

View original on GitHub ↗

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