[BUG] Shell commands fail when Windows username contains parentheses

Resolved 💬 3 comments Opened Mar 5, 2026 by Shaxmax Closed May 4, 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?

Description

All Bash tool calls fail when the Windows username contains parentheses (e.g. User(ABC)Name).

What happens

The shell snapshot path escapes parentheses correctly:

source /c/Users/User(ABC)Name/.claude/shell-snapshots/...

But the temp/CWD tracking path uses the Windows 8.3 short name with
unescaped parentheses:

pwd -P >| /c/Users/USER(AB~1/AppData/Local/Temp/claude-xxxx-cwd

This causes a bash syntax error since ( is interpreted as a subshell:

/usr/bin/bash: -c: line 1: syntax error near unexpected token `('

## Impact
All Bash tool calls are completely broken — no git, npm, or any
shell commands can be executed.

## Environment

  • OS: Windows 11 Pro
  • Shell: Git Bash (MSYS2)
  • Username contains parentheses (e.g. academic title abbreviation)

What Should Happen?

## What should happen
The temp/CWD tracking path should properly escape or quote parentheses,
just like the shell snapshot path does. All Bash commands should execute
normally regardless of special characters in the Windows username.

Error Messages/Logs

Steps to Reproduce

  1. Have a Windows user account with parentheses in the username
  2. Open Claude Code in any project
  3. Try to execute any Bash command (e.g. git status)

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.69 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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