[BUG] Bash error: parse error near `\n'
Resolved 💬 3 comments Opened Aug 28, 2025 by Libao-Yang Closed Jan 7, 2026
Environment
- Platform (select one):
- [X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.95 (Claude Code)
- Operating System: Ubuntu 22.04.5 LTS (accessed via SSH from macOS)
- Terminal: iTerm2
Bug Description
When running commands in Claude Code, the following error appears:
Thinking…
Let me create the new directory structure first:
● Bash(mkdir -p /home/xxx/...)
⎿ Error: /home/libaoy/.claude/shell-snapshots/snapshot-zsh-1756373077253-0dv4lw.sh:4485: parse error near `\n'
✻ Thinking…
Let me fix that command by breaking it down:
● Bash(mkdir -p /home/xxx/...)
⎿ Error: /home/libaoy/.claude/shell-snapshots/snapshot-zsh-1756373077253-0dv4lw.sh:4485: parse error near `\n'
● Bash(mkdir -p /home/xxx/...)
⎿ Error: /home/libaoy/.claude/shell-snapshots/snapshot-zsh-1756373077253-0dv4lw.sh:4485: parse error near `\n'
Steps to Reproduce
I’m not sure how to reproduce this, but I encounter the error every time I run a query. It seems to be related to executing system commands. I already tried reinstalling, but the issue persists.
Expected Behavior
Bash commands run normally without errors.
Actual Behavior
The referenced line does not exist in the script.
Additional Context
I also checked the script mentioned in the error message, and it does not contain line 4485.
<img width="2876" height="170" alt="Image" src="https://github.com/user-attachments/assets/59140a47-2291-4577-b645-d22f33c63571" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗