[BUG] Bash tool fails with exit code 127 for commands with Chinese characters in arguments on Windows (Git Bash)

Resolved 💬 1 comment Opened Jul 4, 2026 by hyglgithub Closed Jul 7, 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?

All Bash tool commands with Chinese characters in command arguments fail with exit code 127.

Unlike issue #31295 where characters are corrupted but commands still execute, in my case all commands with Chinese arguments fail completely. The printf pipe workaround mentioned in #31295 also fails.

What Should Happen?

Bash tool commands with Chinese characters in arguments should execute successfully, just like commands with English characters.

Error Messages/Logs

/usr/bin/bash: eval 'echo "测试中文"' < /dev/null: No such file or directory
exit code 127

Steps to Reproduce

  1. Open Claude Code on Windows with Git Bash
  1. Ask Claude to run via Bash tool:
echo "测试中文"

Result: exit code 127

  1. Ask Claude to run:
printf '{"text": "你好世界"}'

Result: exit code 127

  1. Ask Claude to run:
curl -s -X POST https://httpbin.org/post -H "Content-Type: application/json" -d '{"text": "你好世界"}'

Result: exit code 127

  1. Ask Claude to run:
printf '{"text": "你好世界"}' | curl -s -X POST https://httpbin.org/post -H "Content-Type: application/json" -d @-

Result: exit code 127 (unlike #31295, this also fails)

  1. Ask Claude to run:
grep "月"

Result: exit code 127

  1. Ask Claude to run:
git commit -m "测试提交"

Result: exit code 127

  1. Ask Claude to run:
chinese_text="测试" && echo $chinese_text

Result: exit code 127

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.201

Platform

Other

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Error Message Analysis

The "No such file or directory" error is misleading — it's NOT a real filesystem error!

Testing confirms:

  • Temporary directory is fully accessible
  • Files can be read and written normally

Possible cause: The error message shows Claude Code uses eval to execute commands. When the command string contains Chinese characters, eval may fail to parse it, causing bash to report the misleading "No such file or directory" error.

Evidence:

# These commands work fine (no Chinese in arguments)
● Bash(ls -la /c/Users/username/AppData/Local/Temp/)
● Bash(echo "test" > /c/Users/username/AppData/Local/Temp/test.txt)
● Bash(cat /c/Users/username/AppData/Local/Temp/test.txt)

# These commands fail (Chinese in arguments)
● Bash(echo "测试")
● Bash(grep "月")

What Works

English commands

● Bash(echo "test")
  ⎿  test

Commands that output Chinese (not in arguments)

● Bash(date)
  ⎿  2026年07月 4日

Reading files with Chinese content

● Write(AppData\Local\Temp\data.json)
  ⎿  {"text": "你好世界"}

● Bash(cat /c/Users/username/AppData/Local/Temp/data.json)
  ⎿  {"text": "你好世界"}

Executing scripts with Chinese content

● Write(AppData\Local\Temp\script.sh)
  ⎿  #!/bin/bash
     printf '{"text": "你好世界"}'

● Bash(bash /c/Users/username/AppData/Local/Temp/script.sh)
  ⎿  {"text": "你好世界"}

Root Cause

The issue is in Claude Code's Bash tool, not Git Bash. Running the same commands directly in Git Bash terminal works:

$ echo "测试中文"
测试中文  ← Works in Git Bash terminal

The error message shows Claude Code uses eval to execute commands. The eval command may fail to parse the command string when it contains Chinese characters.

The "No such file or directory" error is misleading - it's not a filesystem error, but appears to be a command parsing error from bash's eval.

Workaround

Use Write tool to create files or scripts, then execute them with Bash tool:

# Create data file
● Write(AppData\Local\Temp\data.json)
  ⎿  {"text": "你好世界"}

# Use file with curl
● Bash(curl -d @/c/Users/username/AppData/Local/Temp/data.json https://api.example.com)

# Or create script
● Write(AppData\Local\Temp\script.sh)
  ⎿  #!/bin/bash
     echo "你好世界"

# Execute script
● Bash(bash /c/Users/username/AppData/Local/Temp/script.sh)

Impact

In my testing, the following commands with Chinese arguments fail:

  • echo, printf
  • curl
  • grep
  • git commit -m

Important: Don't be misled by the "No such file or directory" error message. This is not a filesystem issue, but appears to be a command parsing issue in Claude Code's Bash tool.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗