[BUG] Crash on session resume: "null is not an object (evaluating 'q.split')" in diff/edit renderer (regression of #38633)
Preflight Checklist
- [x] I have searched existing issues and this appears to be a regression of previously-closed reports (#37454, #38633, #38869)
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Restarted my computer while a session was open. When the terminal/tab reopened and resumed the session, the CLI crashed immediately with:
ERROR null is not an object (evaluating 'q.split')
The stack trace points into the diff/Edit-tool-result renderer (minified, but the crashing function receives file content and calls .split() on it without a null guard):
- Ie7 (/$bunfs/root/src/entrypoints/cli.js:3212:1690)
- LV7 (/$bunfs/root/src/entrypoints/cli.js:2663:6380)
- aA (/$bunfs/root/src/entrypoints/cli.js:681:20998)
- Rf (/$bunfs/root/src/entrypoints/cli.js:681:39542)
- $YH (/$bunfs/root/src/entrypoints/cli.js:681:50236)
- IV (/$bunfs/root/src/entrypoints/cli.js:681:86921)
- Eo_ (/$bunfs/root/src/entrypoints/cli.js:681:85884)
- lEH (/$bunfs/root/src/entrypoints/cli.js:681:85706)
- w7_ (/$bunfs/root/src/entrypoints/cli.js:681:82457)
- sH (/$bunfs/root/src/entrypoints/cli.js:681:6489)
- async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:16606:279)
This looks like the same root cause as #37454, #38633, and #38869: a renderer calls originalFile.split('\n') (or similar) without checking for null, which throws when the original file content isn't available (e.g. a file that no longer exists, or a snapshot that wasn't persisted). Those issues were closed/fixed previously, but the crash is back on the current version.
What Should Happen?
Resuming a session should render previous tool results gracefully even when original file content is unavailable, using a null-safe access (q?.split(...)) or a guard/fallback, instead of crashing the whole CLI.
Steps to Reproduce
- Have an active Claude Code session that includes file Edit/Write tool calls.
- Restart the computer without cleanly exiting the session.
- Reopen the terminal and resume the session (session auto-resumed on tab reopen in my case).
- CLI crashes immediately with
null is not an object (evaluating 'q.split')before rendering the conversation.
Claude Code Version
2.1.215
Platform
macOS 26.5.1 (BuildVersion 25F80), Darwin 25.5.0
Is this a regression?
Likely yes — see #37454, #38633, #38869, which describe the identical crash signature and were previously closed.