[BUG] Shell snapshot silently truncated at ~7.2KB on Windows (Desktop) - every Bash call fails with unexpected EOF
Summary
On Windows (Claude Desktop), the Bash tool's shell snapshot file is silently truncated at ~7.2 KB, cutting the export PATH='...' line mid-entry. The unclosed single quote makes every subsequent Bash invocation fail with:
/usr/bin/bash: -c: line 75: unexpected EOF while looking for matching `''
This looks like the same symptom family as #3577 / #19053, but the cause here is measurable truncation, not escaping.
Environment
- Claude Desktop 1.40609.0.0 (Microsoft Store package), local agent mode
- Embedded Claude Code: strings in
app.asarindicate 2.1.247 - Windows 11 Home 10.0.26200, Git Bash (Git for Windows)
- ~35 enabled plugins (official marketplace + one custom marketplace)
Evidence
- Every snapshot in
~/.claude/shell-snapshots/ends at 7187–7195 bytes, always mid-PATH, no closing quote, no trailing newline:
````
...local-agent-mode-sessions/e67ba6 <-- EOF, quote never closed
- The PATH is long because each enabled plugin contributes an entry like
.../AppData/Roaming/Claude/local-agent-mode-sessions/<uuid>/plugin_<ULID>/bin
(~105 chars each). With ~35 plugins the full snapshot would be roughly 9–10 KB.
- Truncation size + wrapper overhead ≈ 8191, which is the Windows
cmd.exe
command-line length limit — suggesting the snapshot content passes through a
command line (or cmd-expanded env var) somewhere in the writer and is silently
clipped at that boundary.
- Repairing the file on disk (closing the quote at the last complete PATH entry)
does not recover the running session — the Bash tool keeps failing with the
same error, and deleting the snapshot makes commands silently no-op (exit 0,
no output, no side effects). So the truncated content appears to be captured
in memory at write time; the file is only a byproduct. This also means
SessionStart/PreToolUse repair hooks cannot help.
Repro
- Windows + Claude Desktop, enable enough plugins that
(base PATH + N × ~105 chars) pushes the snapshot body past ~7.2 KB
(~30–40 plugins in our case).
- Start any session, run any Bash command.
- Observe
unexpected EOF while looking for matching quote, exit code 2, on
every Bash call for the whole session. Newest snapshot file ends mid-PATH.
Impact
Bash tool is completely unusable in Desktop sessions once the plugin count
crosses the threshold. Disabling plugins "fixes" it, which is how we confirmed
the length dependency — but that is not a viable workaround for users who need
their plugins.
Expected
Snapshot writer should not depend on command-line length (write via stdin/file),
or should at minimum fail loudly instead of producing a truncated script that
poisons every subsequent Bash call.