-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
area:toolsbugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsIssue specifically occurs on Windows
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
Root Cause
The shell snapshot generation is incorrectly parsing bash options from set -o output, creating standalone invalid commands instead of proper set -o statements.
Snapshot Content (lines 3-5):
or # INVALID - should be "set -o monitor" set -o onecmd # CORRECT heckhash # INVALID - should be "set -o hashall"
Shell snapshots contain invalid standalone commands or and heckhash that cause "command not found" errors.
What Should Happen?
Shell snapshots should generate valid bash commands that can be sourced without errors.
Actual Snapshot Content (lines 3-5):
or # INVALID - should be "set -o monitor" set -o onecmd # CORRECT heckhash # INVALID - should be "set -o hashall"
Error Messages/Logs
Every bash command execution produces these errors:
> /c/Users/henry/.claude/shell-snapshots/snapshot-bash-*.sh: line 3: or: command not found
> /c/Users/henry/.claude/shell-snapshots/snapshot-bash-*.sh: line 5: heckhash: command not foundSteps to Reproduce
Steps to Reproduce
- Use Claude Code on Windows with Powershell/Git Bash Mingw64
- Have
monitorand/orhashallbash options enabled - Execute any bash command via Claude Code
- Observe the errors in output
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
No response
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Powershell/Git Bash(MINGW64)
Additional Information
Additional Context
The bug appears to be in the snapshot generation logic that processes the output of set -o. It's likely:
- Missing the
set -oprefix for certain options - Incorrectly truncating option names (e.g., "monitor" → "or", "hashall" → "heckhash")
Attempted Workarounds (All Failed)
- Modifying user
.bashrcto disable options - file modification fails - Deleting snapshot files - regenerated with same bug
- Using
bash --noprofile --norc- snapshots still sourced - Editing snapshot files directly - overwritten immediately
Metadata
Metadata
Assignees
Labels
area:toolsbugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsIssue specifically occurs on Windows