[BUG] claude --resume crashes with undefined is not an object when session contains diff metadata with missing filePath
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?
aclaude --resume crashes with undefined is not an object (evaluating 'H.startsWith') at cljs:822848:/ when the session JSONL contains structuredPatch/diffPatch metadata with an undefined filePath property.
The crash occurs in function Q0K({filePath:H, structuredPatch:$, originalFile:q}) which calls H.startsWith(J0()) without null-checking H. When a session's diff metadata has a missing or undefined filePath, the TUI renderer crashes and the entire session becomes unresumable.
What Should Happen?
aclaude --resume should gracefully handle session JSONL files that contain structuredPatch/diffPatch metadata with a missing or undefined filePath. The fix would be a simple optional chaining check (H?.startsWith instead of H.startsWith) in the Q0K function, so that sessions with malformed diff metadata can still be resumed without crashing the TUI renderer.
Error Messages/Logs
Steps to Reproduce
a1. Have a long Claude Code session with multiple file edits (Edit tool calls)
- Session completes normally
- 3. Run
claude --resumeto resume the session - 4. Claude crashes with:
undefined is not an object (evaluating 'H.startsWith')
The session JSONL file contains structuredPatch/diffPatch entries where the filePath property is undefined. This causes the TUI renderer to crash when trying to call .startsWith() on an undefined value.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.86 (Claude Code)
Platform
AWS Bedrock
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗