[Bug] Shell command escaping fails with Windows paths containing quotes and pipes
On Windows, when using Bash inside Visual Studio terminal, ClaudeCode often combines commands from different environments.
For example:
Bash commands like ls and grep are used together with Windows paths (C:\...)
Windows commands like dir and findstr are executed inside Bash
This causes errors such as:
command not found
invalid paths
quoting and parsing errors
Expected Behavior
Please detect the active shell more accurately and stick to one environment only:
If Bash is used, adapt paths and commands to Bash conventions
If Windows cmd/PowerShell is used, avoid Bash-specific commands
Even a simple consistency check would greatly help.
Impact
This makes it hard to trust or directly run the suggested commands on Windows and leads to unnecessary trial and error.
Bug Description
Bash(ls -lah "C:\Users\admin\source\Repos\TopTec_Master\TopTec\bin\Release\" | grep -E "\.exe|\.bin")
⎿ Error: Exit code 127
ls: cannot access 'C:\Users\admin\source\Repos\TopTec_Master\TopTec\bin\Release" | grep -E .exe': No such file or directory
/usr/bin/bash: line 1: .bin: command not found
● Bash(dir "C:\Users\admin\source\Repos\TopTec_Master\TopTec\bin\Release\" | findstr /I "exe bin")
⎿ Error: Exit code 2
/usr/bin/bash: eval: line 1: unexpected EOF while looking for matching `"'
Environment Info
- Platform: win32
- Terminal: visualstudio
- Version: 2.1.7
- Feedback ID: 321bb7c7-0ec5-49ee-bdd1-6eb8f4d60330
Errors
[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at cEA (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3003:23303)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async hP0.<anonymous> (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:5222:708)\n at async hP0.parseAsync (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4718:4156)\n at async J_7 (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:5252:1637)\n at async G_7 (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:5175:1561)\n at async D_7 (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:5254:5850)","timestamp":"2026-01-15T14:02:58.707Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at cEA (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3003:23303)\n at async K (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3452:13161)","timestamp":"2026-01-15T14:03:02.163Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at cEA (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3003:23303)\n at async V (file:///C:/Users/admin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3452:13677)","timestamp":"2026-01-15T14:03:02.163Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗