claude-code - 💡(How to fix) Fix [BUG] Claude Code CLI Harness Shell Snapshot

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Bash(pnpm install) ⎿ Error: Exit code 2 /bin/bash: -c: line 1: syntax error near unexpected token (' /bin/bash: -c: line 1: source /home/...<list of entries in $PATH>

Code Example

Bash(pnpm install)
Error: Exit code 2
     /bin/bash: -c: line 1: syntax error near unexpected token `('
     /bin/bash: -c: line 1: `source /home/...<list of entries in $PATH>
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Running Claude Code CLI v2.1.146 in WSL2 (Debian 12) on latest stable Windows 11. Recently Claude started getting errors while attempting to run basic linux (bash) commands. It forces me to run such commands manually, then copy paste the output. It's tedious and annoying.

I've searched online and tried a few fixes that seem to make sense. The problem seems to be Windows path entries with parenthesis in $PATH, yet even with my attempts and fixing this in my ~/.bashrc Claude believes the problem is due to the harness shell snapshot not applying my new shell fixes. When I ask claude to check if it's fixed, it replies "Still getting PATH errors with Windows paths containing parentheses (like "Program Files (x86)"). This is a Claude Code harness shell snapshot issue I can't work around."

What Should Happen?

It should be able to run basic commands in WSL

Error Messages/Logs

Bash(pnpm install)
  ⎿  Error: Exit code 2
     /bin/bash: -c: line 1: syntax error near unexpected token `('
     /bin/bash: -c: line 1: `source /home/...<list of entries in $PATH>

Steps to Reproduce

This only began happening in the last few days, and I haven't used it differently. Only changes has been installing plugins from Telnyx and Sinch.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

v2.1.146

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Claude Code CLI Harness Shell Snapshot