[BUG] Crash on conversation resume: "null is not an object (evaluating 'q.split')" in diff renderer
Status Fixed / completed
Reported on v2.1.81
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 5 comments · opened Mar 25, 2026 · closed Apr 10, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Resuming a conversation with claude --resume crashes immediately with null is not an object (evaluating 'q.split'). The crash is in the structured patch renderer (pl7) which calls originalFile.split('\n') without a null guard. When originalFile is null (e.g. for a newly created file or one that no longer exists on disk), .split() throws a TypeError and the CLI exits.
What Should Happen?
The conversation should resume and render previous tool results gracefully, even when the original file content is unavailable. A null-safe access (q?.split(...)) or guard should prevent the crash.
Error Messages/Logs
ERROR null is not an object (evaluating 'q.split')
pl7 (/$bunfs/root/src/entrypoints/cli.js:3163:2024)
cX7 (cli.js:2603:45367)
h9 → a1 → D7_ → nV_ → BQT → iV_ → X7_ → a_ (rendering pipeline)
Steps to Reproduce
Steps to Reproduce:
1. Start a Claude Code conversation that involves file edits (Write or Edit tool) 2. End the conversation 3. Run claude --resume to resume it 4. CLI crashes with the above error before rendering the conversation
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.81
Claude Code Version
2.1.83
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Other
Additional Information
My terminal is Ghosty with fish shell
5 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Additional root cause analysis
I hit the same crash on v2.1.83 (macOS arm64, Bedrock) resuming a 26,668-line conversation originally created on v2.1.71.
Root cause
The
pl7function (Edit tool success renderer incli.js:3163) callsoriginalFile.split('\n')without a null guard. TheoriginalFilevalue is resolved fromfile-history-snapshotentries in the conversation JSONL, keyed by the assistant message's UUID. When no snapshot exists for a given UUID,originalFileisnull.In my case, 297 out of 328 Edit tool_use entries had no corresponding
file-history-snapshot. The conversation was forked from another session (has aforkedFromfield in line 0) — the fork likely didn't carry over snapshots from the parent.Minimal fix
Workaround (patching the JSONL)
I was able to resume by injecting missing
file-history-snapshotentries into the JSONL. For each assistant message UUID that contained an Edit tool_use but had no snapshot, I added:This prevents the null crash. Historical diffs won't render accurately (uses current file content instead of the original), but the conversation loads and is fully usable.
Script to automate: read all lines, find Edit tool_use UUIDs missing from snapshot messageIds, inject entries with current disk content, write back. Backup first.
Working workaround: binary patch (macOS arm64, v2.1.83)
The file-history-snapshot JSONL patching I described above does not work — the renderer resolves
originalFilethrough a different mechanism than snapshotmessageIdlookup.What does work is patching the binary directly. The crash is in
pl7whereq.split()is called on nulloriginalFile. The fix replacesq.split(...)??nullwith(q??"").split(...)— exact same byte length, safe in-place patch:Then re-sign for macOS:
macOS will show a Gatekeeper warning on first run — go to System Settings → Privacy & Security → Allow Anyway.
Confirmed working: resumes a 26,668-line conversation with 44 subagents and 328 Edit tool calls that previously crashed instantly.
Update: v2.1.84 has a SECOND crash in the same function
After upgrading to v2.1.84, the
originalFile.split()crash is still present (not fixed upstream). Additionally, there's a second null-safety issue:filePathcan also beundefined, causingundefined.startsWith().The actual function in the binary (v2.1.84) is called
fs6, notpl7(source-mapped name):Updated binary patch for v2.1.84
Two same-length replacements (both found at 2 positions each):
Then re-sign:
Allow in System Settings → Privacy & Security on first run.
Confirmed working on a 26K-line conversation with 44 subagents.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.