claude-code - 💡(How to fix) Fix REPL crash on interactive `--resume` of large session JSONL (19MB / 2554 events); non-interactive `-p` resume succeeds (2.1.119, macOS arm64) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53131Fetched 2026-04-26 05:23:35
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
1
Participants
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Interactive claude --resume of a 19MB / 2554-event session JSONL crashes the REPL on startup, dumping minified source context to the terminal followed by a small async stack ending at cli.js:18815. The same session loads cleanly under non-interactive claude --resume <id> -p "..." mode, so the JSONL itself is valid — the crash is in the interactive REPL render path.

This is not the wave of *KH is not a function resume crashes filed against 2.1.120 over the past 24h (#53044, #53053, #53064, #53067, #53089, #53092, #53094, #53097, #53118). I'm on 2.1.119 and the symptom is different: no thrown function-undefined error, just a source-context dump with a tiny async stack.

Error Message

}}var fL3,TkK=1000,JL3=300,ML3=5000;var Bb8=Z(()=>{P_();k_();Np();YI();OkK();__();HV();fL3=(LmH(),E8(ZmH))});var DkK={};J_(DkK,{useScheduledTasks:()=>XL3});function XL3({isLoading:H,assistantMode:_,setMessages:q}){...} ... [several more KB of minified source from the REPL component tree, including the pjuseCallback that computes spinnerTip via kGK(), the Ej6 sandbox-permission callback, and theuseEffect` that writes "Error: sandbox required but unavailable" to stderr] ...

  • <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9251:5663)
  • WC (/$bunfs/root/src/entrypoints/cli.js:492:63749)
  • pj (/$bunfs/root/src/entrypoints/cli.js:492:76948)
  • fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
  • pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
  • fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
  • pj (/$bunfs/root/src/entrypoints/cli.js:492:76926)
  • fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
  • pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
  • fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
  • async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18815:2361)

Root Cause

Interactive claude --resume of a 19MB / 2554-event session JSONL crashes the REPL on startup, dumping minified source context to the terminal followed by a small async stack ending at cli.js:18815. The same session loads cleanly under non-interactive claude --resume <id> -p "..." mode, so the JSONL itself is valid — the crash is in the interactive REPL render path.

This is not the wave of *KH is not a function resume crashes filed against 2.1.120 over the past 24h (#53044, #53053, #53064, #53067, #53089, #53092, #53094, #53097, #53118). I'm on 2.1.119 and the symptom is different: no thrown function-undefined error, just a source-context dump with a tiny async stack.

Fix Action

Workaround

Non-interactive resume (-p) works. Interactively the session is unreachable; users must start fresh.

Code Example

# Crashes — interactive resume
claude --resume e455a3ea-b7bd-4667-b735-e7aac8bf971e

# Succeeds — non-interactive resume of the same session
claude --resume e455a3ea-b7bd-4667-b735-e7aac8bf971e -p "echo hello"
# → "hello", exit 0

---

}`}var fL3,TkK=1000,JL3=300,ML3=5000;var Bb8=Z(()=>{P_();k_();Np();YI();OkK();__();HV();fL3=(LmH(),E8(ZmH))});var DkK={};J_(DkK,{useScheduledTasks:()=>XL3});function
XL3({isLoading:H,assistantMode:_,setMessages:q}){...}
... [several more KB of minified source from the REPL component tree, including the `pj` useCallback that
     computes spinnerTip via kGK(), the Ej6 sandbox-permission callback, and the `useEffect` that writes
     "Error: sandbox required but unavailable" to stderr] ...

- <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9251:5663)
- WC (/$bunfs/root/src/entrypoints/cli.js:492:63749)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76948)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76926)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18815:2361)
RAW_BUFFERClick to expand / collapse

Summary

Interactive claude --resume of a 19MB / 2554-event session JSONL crashes the REPL on startup, dumping minified source context to the terminal followed by a small async stack ending at cli.js:18815. The same session loads cleanly under non-interactive claude --resume <id> -p "..." mode, so the JSONL itself is valid — the crash is in the interactive REPL render path.

This is not the wave of *KH is not a function resume crashes filed against 2.1.120 over the past 24h (#53044, #53053, #53064, #53067, #53089, #53092, #53094, #53097, #53118). I'm on 2.1.119 and the symptom is different: no thrown function-undefined error, just a source-context dump with a tiny async stack.

Environment

Claude Code2.1.119
OSmacOS 26.4.1 (Build 25E253), arm64
Host Nodev25.9.0 (CLI runs in bundled Bun)
Shellbash
TerminaliTerm2

Session was written entirely by 2.1.119 (no mid-session version drift).

Repro

# Crashes — interactive resume
claude --resume e455a3ea-b7bd-4667-b735-e7aac8bf971e

# Succeeds — non-interactive resume of the same session
claude --resume e455a3ea-b7bd-4667-b735-e7aac8bf971e -p "echo hello"
# → "hello", exit 0

The session that triggers it has these properties:

  • Size: 19 MB JSONL, 2554 entries, largest single line 1.23 MB
  • Composition: 1106 assistant + 634 user + ~800 metadata entries (permission-mode, agent-name, custom-title, file-history-snapshot, last-prompt, attachment, queue-operation, system)
  • Sidecars: 7.2 MB in <session-id>/ directory (16 subagent files, 2 tool-result sidecars)
  • The 1.23MB line (line 1104) is a single tool_result entry where both message and toolUseResult are ~615KB each — the same payload appears stored twice on the same record.

Expected

Interactive --resume should either succeed (if the session is valid, which -p resume confirms) or fail with a clear, user-facing error message — not crash mid-render with a minified source dump.

Actual

What gets rendered to the terminal at crash (truncated for length — happy to paste full output if useful):

}`}var fL3,TkK=1000,JL3=300,ML3=5000;var Bb8=Z(()=>{P_();k_();Np();YI();OkK();__();HV();fL3=(LmH(),E8(ZmH))});var DkK={};J_(DkK,{useScheduledTasks:()=>XL3});function
XL3({isLoading:H,assistantMode:_,setMessages:q}){...}
... [several more KB of minified source from the REPL component tree, including the `pj` useCallback that
     computes spinnerTip via kGK(), the Ej6 sandbox-permission callback, and the `useEffect` that writes
     "Error: sandbox required but unavailable" to stderr] ...

- <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9251:5663)
- WC (/$bunfs/root/src/entrypoints/cli.js:492:63749)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76948)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76926)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18815:2361)

The stack alternates between pj (3 different source positions: 76948, 77745, 76926) and fT (always at 76827) — looks like a .then() async chain in the REPL component tree, not a true call-stack overflow. The visible source region around pj includes the spinner-tip useCallback (kGK({theme, readFileState, bashTools}).then(...)) and the useScheduledTasks hook (pb8).

Diagnostics — things ruled out

To save triage time:

  • Not #49876 (null-byte truncation): tr -dc '\0' < session.jsonl | wc -c → 0
  • Not #41992 (empty text block corruption): grep -c '"text":""' session.jsonl → 0
  • Not a corrupt JSONL: every line parses as valid JSON; non-interactive -p resume works against the same file
  • Not #53044 et al. (2.1.120 regressions): I'm on 2.1.119
  • Not a heap exhaustion of the V8/Bun process in the obvious sense: no SIGABRT message, the process renders source then exits with the stack above
  • Not sandbox-related: no sandbox config in ~/.claude/settings.json or project settings.local.json. The sandbox-error text visible in the dumped source is just incidental code in the same region of cli.js.

Possibly related

  • #19025 — JSONL exceeds V8 heap limit on resume. Different symptom (SIGABRT) but related theme.
  • #52840 — Rewind/time-travel picker hangs on ~40MB / 15k-event transcripts. Different feature, but suggests size-dependent rendering issues exist elsewhere.
  • #43941/resume shows old compaction summary. Same area of code.

Notes / hypothesis (low confidence)

The fact that -p resume works but interactive resume crashes points at a render-time issue, not a session-load issue. The visible source frames during the crash include:

  1. The pj useCallback that computes spinner-tip metadata from message history — fires after each turn or replay batch
  2. The useScheduledTasks hook that schedules wake-ups for /loop jobs

If the resume code path replays N messages through the same per-turn callbacks that a live session uses, anything O(n) per message becomes O(n²) on a 1740-message replay. That's speculation though — the maintainers will know better.

Workaround

Non-interactive resume (-p) works. Interactively the session is unreachable; users must start fresh.

extent analysis

TL;DR

The issue is likely caused by a render-time problem in the interactive REPL resume path, and a potential workaround is to use non-interactive resume with the -p flag.

Guidance

  • Verify that the issue is specific to interactive resume by comparing the behavior with non-interactive resume using the -p flag.
  • Investigate the pj useCallback and useScheduledTasks hook in the REPL component tree, as they are visible in the stack trace and may be related to the render-time issue.
  • Consider the possibility of a size-dependent rendering issue, as suggested by related issues #19025 and #52840.
  • Check if the session JSONL file is valid and not corrupted, as confirmed by the fact that non-interactive resume works.

Example

No code snippet is provided, as the issue is more related to the overall behavior of the interactive REPL resume path rather than a specific code snippet.

Notes

The issue may be related to the size of the session JSONL file (19MB, 2554 events) and the rendering of the REPL component tree. The fact that non-interactive resume works suggests that the issue is specific to the interactive resume path.

Recommendation

Apply the workaround of using non-interactive resume with the -p flag, as it is confirmed to work for the same session JSONL file. This will allow users to access the session data, although interactively it is currently unreachable.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING