[BUG] Claude Code incorrectly parses taskkill arguments in Git Bash, prepending Git installation path
[BUG] Claude Code incorrectly parses taskkill arguments in Git Bash, prepending Git installation path
Environment
- Platform (select one):
- [x] Other: Claude Code CLI
- Claude CLI version: 1.0.62
- Operating System: Windows (with Git Bash)
- Terminal: Git Bash
Bug Description
Claude Code fails to execute Windows taskkill commands properly when running in Git Bash environment. The tool appears to be incorrectly parsing command-line arguments, prepending the Git installation path (C:/Program Files/Git/) to argument flags like /PID and /im, causing the commands to fail with "Invalid argument/option" errors.
Steps to Reproduce
- Use Claude Code on a Windows system with Git Bash
- Attempt to kill a process using
taskkill /PID <process_id> /F - Try alternative syntax like
taskkill //PID <process_id> //F - Attempt to kill by image name using
taskkill /im <process_name> /f
Expected Behavior
The taskkill commands should execute properly and terminate the specified processes. Commands like:
taskkill /PID 64076 /Fshould kill process with PID 64076taskkill /im dotnet.exe /fshould kill all dotnet.exe processes
Actual Behavior
All taskkill commands fail with errors like:
ERROR: Invalid argument/option - 'C:/Program Files/Git/PID'ERROR: Invalid argument/option - 'C:/Program Files/Git/im'
The system incorrectly interprets the /PID and /im flags as Unix-style paths and prepends the Git installation directory path to them.
Additional Context
This appears to be a path translation issue specific to Git Bash on Windows, where MSYS2 (the underlying system for Git Bash) is incorrectly converting what it thinks are Unix paths. The issue affects various taskkill argument formats including both single and double forward slashes. A potential workaround might be to use cmd.exe directly or escape the arguments differently for the Git Bash environment.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗