Shell Snapshot Generation: Malformed Alias Causing Syntax Error

Resolved 💬 6 comments Opened Aug 2, 2025 by eric-handley Closed Nov 28, 2025

Bug Description

Claude Code Shell Snapshot Bug Report

Summary

Claude Code generates malformed shell snapshot files that prevent any bash commands from executing, causing all Bash tool invocations to fail with "unmatched ' " error.

Environment

  • Platform: Windows (MINGW64_NT-10.0-26100)
  • Claude Code Version: Latest (as of 2025-08-02)
  • Shell: zsh
  • User: username (no spaces in username)

Issue Description

Every attempt to use the Bash tool in Claude Code fails with the following error:

/c/Users/username/.claude/shell-snapshots/snapshot-zsh-[timestamp]-[id].sh:8: unmatched '

Root Cause

Examination of the generated snapshot file reveals a malformed alias line:

# Check for rg availability
if ! command -v rg >/dev/null 2>&1; then
  alias rg=''\''Z:fi

Additional Information

  • Generated snapshot file path: /c/Users/username/.claude/shell-snapshots/snapshot-zsh-[timestamp]-[id].sh
  • Error occurs at line 8 of snapshot file
  • Issue prevents normal development workflow using Claude Code tools

---
Report generated: 2025-08-02
Status: Blocking all bash command execution in Claude Code

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 1.0.67
  • Feedback ID: 66581ba0-f44b-4cd7-a320-6d6a468cda0a

Errors

[{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:1474:421\n    at Object.useMemo (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:65:26368)\n    at $$9.useMemo (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:46:15588)\n    at lV (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:1474:313)\n    at KR (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:65:19859)\n    at Mb (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:42848)\n    at Nb (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:38369)\n    at Bj (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:38297)\n    at _R (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:38151)\n    at MC (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:35214)","timestamp":"2025-08-02T19:20:58.935Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:1474:421\n    at Object.useMemo (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:65:26368)\n    at $$9.useMemo (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:46:15588)\n    at lV (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:1474:313)\n    at KR (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:65:19859)\n    at Mb (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:42848)\n    at Nb (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:38369)\n    at Bj (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:38297)\n    at _R (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:38151)\n    at MC (file:///Z:/clang64/lib/node_modules/@anthropic-ai/claud

Note: Error logs were truncated.

View original on GitHub ↗

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