Shell snapshot $PATH not expanding — commands not found in Bash tool

Resolved 💬 3 comments Opened Mar 25, 2026 by SchlipShlop Closed Apr 24, 2026

Describe the bug
The shell snapshot file at ~/.claude/shell-snapshots/snapshot-*.sh contains:

export PATH=/home/USER/.claude/bin:$PATH

But $PATH is not expanded at snapshot creation time, resulting in the literal string $PATH being stored. When the snapshot is sourced, the shell PATH becomes:

/home/USER/.claude/bin:$PATH

This causes basic commands (grep, chmod, sudo, ls, cat, etc.) to return "command not found" when invoked through the Bash tool.

To Reproduce

  1. Run any command via the Bash tool (e.g. grep --version)
  2. Observe "command not found" error
  3. Check echo $PATH inside the Bash tool — shows literal $PATH string

Expected behavior
$PATH should expand to the user's actual PATH at snapshot creation time, or the snapshot should source the user's shell profile to get the correct PATH.

Environment

  • OS: Ubuntu 24.04.4 LTS (Noble)
  • Shell: bash

Workaround
Manually hardcode the real PATH in the snapshot file.

View original on GitHub ↗

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