claude --resume crashes with TypeError: H.trim on sessions containing hook events

Resolved 💬 3 comments Opened Feb 20, 2026 by greydove749 Closed Feb 24, 2026

Description

\claude --resume <session-id>\ crashes immediately with a TypeError in the TUI renderer. The REPL never loads. Reproducible 100% of the time on the affected session.

Error

\\\
TypeError: undefined is not an object (evaluating 'H.trim')
at fo0 (B:/~BUN/root/claude.exe:1705:4429)
at IE (B:/~BUN/root/claude.exe:100:19663)
at $2 (B:/~BUN/root/claude.exe:102:42806)
at aw (B:/~BUN/root/claude.exe:102:38344)
at df (B:/~BUN/root/claude.exe:102:38272)
at Q7 (B:/~BUN/root/claude.exe:102:38126)
at nw (B:/~BUN/root/claude.exe:102:35203)
at M0 (B:/~BUN/root/claude.exe:100:4818)
at kV (B:/~BUN/root/claude.exe:102:32449)
at B:/~BUN/root/claude.exe:106:1829
\
\\

Steps to Reproduce

  1. Run a session involving hook events (PostToolUse, Stop hooks, etc.)
  2. claude --resume <session-id>
  3. Crash on startup — session never loads

Analysis

The crash site (line 1705) contains hook event rendering for types:
hook_blocking_error, hook_non_blocking_error, hook_error_during_execution, hook_success. The renderer calls .trim() on a field (H) that is undefined — indicating a missing null-guard on an optional field (e.g. content, stderr, additionalContext) that is absent rather than null in the session record.

The session JSONL is structurally valid (123 hook references examined, no explicit nulls). The renderer does not handle absent optional fields.

Environment

  • Platform: Windows 11 Pro
  • Shell: MINGW64 / Git Bash
  • Claude Code: latest (Bun bundle)

Impact

The session is unresumable without extensive workaround.

Expected Behavior

--resume should gracefully handle absent/undefined optional fields in hook event records, not crash.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗