[BUG] claude --resume crashes with null is not an object (evaluating 'A.split')
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?
Error Message
ERROR null is not an object (evaluating 'A.split')
/$bunfs/root/claude:2725:1261
Stack trace points to VkB function:
- VkB (/$bunfs/root/claude:2725:1261)
- D2B (/$bunfs/root/claude:2355:4368)
Root Cause
In the VkB renderer (/$bunfs/root/claude:2725), the originalFile parameter A is null, but the code calls A.split('\n') without a null check:
VkB({ filePath: T, structuredPatch: R, originalFile: A }, _, { style: B, verbose: D }) {
return m4.createElement(HyR, {
firstLine: A.split('\n')[0] ?? null, // ← crashes when A is null
fileContent: A,
...
})
}
Triggering Input
The crash is triggered when resuming a session that contains a file-history-snapshot entry where a tracked file's backupFileName is null:
{
"type": "file-history-snapshot",
"snapshot": {
"trackedFileBackups": {
"src/agents/autopilot_manager.py": {
"backupFileName": null,
"version": 1,
"backupTime": "2026-04-14T08:10:25.445Z"
}
}
}
}
This happens for newly created files that have not yet been backed up (version 1, no prior backup). When --resume renders the diff for this file, originalFile is null because there is no backup to read from, and the renderer does not handle this case.
What Should Happen?
Triggering Input
The crash is triggered when resuming a session that contains a file-history-snapshot entry where a tracked file's backupFileName is null:
{
"type": "file-history-snapshot",
"snapshot": {
"trackedFileBackups": {
"src/agents/autopilot_manager.py": {
"backupFileName": null,
"version": 1,
"backupTime": "2026-04-14T08:10:25.445Z"
}
}
}
}
This happens for newly created files that have not yet been backed up (version 1, no prior backup). When --resume renders the diff for this file, originalFile is null because there is no backup to read from, and the renderer does not handle this case.
Error Messages/Logs
### Error Message
ERROR null is not an object (evaluating 'A.split')
/$bunfs/root/claude:2725:1261
Stack trace points to `VkB` function:
- VkB (/$bunfs/root/claude:2725:1261)
- D2B (/$bunfs/root/claude:2355:4368)
Steps to Reproduce
Steps to Reproduce
- Start a Claude Code session in a project
- Have Claude create a brand-new file (never existed before) — this produces a
file-history-snapshotentry withbackupFileName: null - Exit the session
- Run
claude --resume <session-id> - → Crash immediately
Expected Behavior
originalFile being null should be handled gracefully, e.g.:
firstLine: A?.split('\n')[0] ?? null
Environment
- Claude Code version: 2.1.63
- Installed via: Homebrew
- OS: macOS
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.63
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗