[BUG] Shell snapshot files have malformed PATH - colons incorrectly escaped with backslashes

Resolved 💬 3 comments Opened Jan 18, 2026 by summaminutiae Closed Jan 18, 2026

Preflight Checklist

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

What's Wrong?

snapshot-bash-1768756242719-p4cllc.sh
Claude Code's shell snapshot mechanism incorrectly escapes colons in the PATH environment variable when creating snapshot files. This causes all bash commands to fail with exit code 127.

What Should Happen?

The PATH export in the snapshot should use normal colons as delimiters:
export PATH=/Users/billw/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin

Error Messages/Logs

All bash commands fail with Exit code 127 and no additional output:

  Command: echo "test"
  Result: Exit code 127

  Command: ls
  Result: Exit code 127

  Command: /bin/echo "test with absolute path"
  Result: Exit code 127

  Command: /bin/ls /
  Result: Exit code 127

  Command: /bin/bash -c 'echo test'
  Result: Exit code 127

  Command: /bin/bash --norc --noprofile -c 'echo test'
  Result: Exit code 127

  Command: :  (bash no-op builtin)
  Result: Exit code 127

  Command: true  (bash builtin)
  Result: Exit code 127

  Command: PATH=/usr/bin:/bin:/usr/sbin:/sbin echo "with explicit PATH"
  Result: Exit code 127

  Command: /usr/bin/env -i /bin/bash -c 'echo clean env'
  Result: Exit code 127

Steps to Reproduce

  1. Launch Claude Code (bash shell in Terminal.app on macOS)
  2. Run any bash command (e.g., echo test or ls)
  3. Command fails with exit code 127
  4. Examine ~/.claude/shell-snapshots/snapshot-bash-*.sh - the PATH export has escaped colons (\: instead of :)

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.12 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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