[BUG] Shell tool doesn't refresh PATH environment variable mid-session
Status Open
Reported on v2.1.216
Maintainer reply None cached
Activity 0 comments · opened Jul 21, 2026
Bug Description
Bash/PowerShell tool doesn't pick up PATH changes made mid-session
Claude Code's shell tool processes snapshot PATH at session start and never re-read it. If a CLI is installed mid-session (e.g. via winget install), it's immediately usable in a fresh terminal but stays command not found in Claude's Bash/PowerShell tool until the whole session restarts. Would help if the tool re-resolved PATH per-command, or at least detected "not found" + recently-changed PATH and suggested a restart instead of just erroring.
Environment Info
- Platform: win32
- Terminal: xterm-256color
- Version: 2.1.216
- Feedback ID: a262b8d6-087d-41ee-9d9a-537aaa3365a1
Errors
[{"error":"TelemetrySafeError: VirtualMessageList: itemKeys/messages length desync (keys=17 messages=16 range=[0,17))\n at A_b (B:/~BUN/root/src/entrypoints/cli.js:14712:8188)\n at f8p (B:/~BUN/root/src/entrypoints/cli.js:14712:1103)\n at ai (B:/~BUN/root/src/entrypoints/cli.js:3267:21369)\n at tA (B:/~BUN/root/src/entrypoints/cli.js:3267:40462)\n at G$ (B:/~BUN/root/src/entrypoints/cli.js:3267:51393)\n at w4e (B:/~BUN/root/src/entrypoints/cli.js:3267:89071)\n at rle (B:/~BUN/root/src/entrypoints/cli.js:3267:88015)\n at tle (B:/~BUN/root/src/entrypoints/cli.js:3267:87834)\n at D8 (B:/~BUN/root/src/entrypoints/cli.js:3267:84091)\n at Lt (B:/~BUN/root/src/entrypoints/cli.js:3267:6672)","timestamp":"2026-07-21T01:01:40.236Z"}]