Interactive --resume crashes with "JSON Parse error: Unexpected identifier" loading a large (~400MB+) session transcript
Status Open
Reported on v2.1.218
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 0 comments · opened Jul 23, 2026
Version: 2.1.218 (Claude Code), Bun runtime, Windows 11
Update: the original title/body on this issue described the wrong cause (guessed it was --resume <value> argument parsing). Root cause is now isolated below — the crash is tied to session transcript file size, not the resume argument.
Actual behavior
Resuming a specific session via the interactive picker (claude --resume / claude -r, no argument, select from the list) loads the session, then immediately crashes, before any input is typed:
ERROR JSON Parse error: Unexpected identifier "..."
- at <parse> (:0)
- at parse (unknown)
- Bt (B:/~BUN/root/src/entrypoints/cli.js:85:302)
- kVp (B:/~BUN/root/src/entrypoints/cli.js:18086:51014)
- Jn (B:/~BUN/root/src/entrypoints/cli.js:2101:21364)
- fS (B:/~BUN/root/src/entrypoints/cli.js:2101:40461)
- lO (B:/~BUN/root/src/entrypoints/cli.js:2101:51387)
- iLe (B:/~BUN/root/src/entrypoints/cli.js:2101:89050)
- oLe (B:/~BUN/root/src/entrypoints/cli.js:2101:88003)
- cge (B:/~BUN/root/src/entrypoints/cli.js:2101:87823)
- X9 (B:/~BUN/root/src/entrypoints/cli.js:2101:84476)
What's been ruled out
- Not the
--resume <value>argument: the picker itself comes up fine, session is selected from the list (not typed), and the crash happens after the session finishes loading. - Not file corruption: every line of the session's
.jsonltranscript, and every subagent transcript/meta file under it, parses individually as valid JSON (checked with a script, zero failures). - Not a local hook problem: this user has three
SessionStarthooks configured (two PowerShell scripts, one Node CLI) that print plain, non-JSON text to stdout. Temporarily emptyinghooks.SessionStartentirely insettings.jsonand retrying did not change the outcome — same crash, same stack. - Not reproducible headless:
claude --resume <session-id> --print "hi"against the same session completes normally and returns a response. The crash is specific to the interactive/TUI resume path.
What's confirmed
- The affected session's transcript file is ~434 MB (
433,753,526bytes) — one of the largest sessions in this project's history (166k+ JSONL lines, one very active session with dozens of subagent transcripts alongside it). - Other, smaller sessions in the same project (tens of MB, tens of thousands of lines) resume without issue, both headless and (per user report) interactively.
- This strongly points at a bug in the interactive resume loader specifically for very large transcript files, e.g., a buffer/chunk-size limit being hit while reading or pre-processing the file, where the truncation boundary lands mid-string inside JSON content.
Steps to reproduce
- Accumulate a single Claude Code session transcript in the multi-hundred-MB range (e.g., a long session with many large subagent transcripts).
- Start a fresh
claudeprocess, run--resume/-r, and select that session from the interactive picker. - Session loads and displays history, then immediately crashes with the error above, before any further input.
Workaround
None found yet — headless resume (--resume <id> --print "...") works, but interactive resume of this specific large session does not.