Shell snapshot rg wrapper pins to old version after upgrade, never refreshes

Resolved 💬 3 comments Opened Mar 14, 2026 by trademomentumllc Closed Mar 18, 2026

Bug Description

When Claude Code upgrades (e.g., 2.1.75 -> 2.1.76), the shell snapshot file that provides the rg (ripgrep) wrapper function retains the old version path and is never refreshed. This causes the Grep tool to use a stale binary for the remainder of the session (and potentially across resumed sessions).

Reproduction

  1. Install Claude Code (e.g., version 2.1.75)
  2. Start a session (creates shell snapshot with rg wrapper pointing to 2.1.75)
  3. Claude auto-upgrades to 2.1.76
  4. The shell snapshot still contains:

``bash
exec -a rg /home/user/.local/share/claude/versions/2.1.75 "$@"
``

  1. All subsequent rg calls use the OLD binary

Evidence

  • Snapshot file: ~/.claude/shell-snapshots/snapshot-bash-*.sh
  • Created: Mar 13 19:04 (during 2.1.75)
  • Claude upgraded to 2.1.76: Mar 13 21:38
  • Snapshot never refreshed — rg still points to 2.1.75
  • All 4 old versions (2.1.73-2.1.76) remain on disk in ~/.local/share/claude/versions/

Impact

  • Grep tool uses stale binary: Any bug fixes or improvements to ripgrep in newer versions are not picked up
  • Version drift compounds: Over multiple upgrades, the gap between the running Claude version and the rg wrapper version grows
  • Old binaries accumulate on disk: No cleanup after upgrade (4 versions = ~940MB)
  • Potential prompt/response issues: If the ripgrep behavior changed between versions (flags, output format, performance), results may be inconsistent with what the current Claude version expects

Expected Behavior

  1. Shell snapshot should refresh the rg wrapper path after a version upgrade
  2. Old version binaries should be cleaned up after successful upgrade
  3. The rg wrapper should reference the CURRENT version, not a snapshot-time version

Environment

  • OS: Debian Linux (6.17.13+2-amd64)
  • Shell: bash
  • Claude Code: 2.1.76 (running), 2.1.75 (rg wrapper target)
  • Installation: ~/.local/share/claude/versions/

View original on GitHub ↗

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