[BUG] Claude Code incorrectly parses taskkill arguments in Git Bash, prepending Git installation path

Resolved 💬 5 comments Opened Jul 29, 2025 by rweijnen Closed Jan 3, 2026

[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

  1. Use Claude Code on a Windows system with Git Bash
  2. Attempt to kill a process using taskkill /PID <process_id> /F
  3. Try alternative syntax like taskkill //PID <process_id> //F
  4. 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 /F should kill process with PID 64076
  • taskkill /im dotnet.exe /f should 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.

View original on GitHub ↗

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