[BUG] Crash: H.indexOf is not a function — H is undefined when calling .indexOf()

Resolved 💬 1 comment Opened May 27, 2026 by lan5635 Closed Jun 28, 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?

Claude Code crashes with H.indexOf is not a function — H is undefined when .indexOf() is called on it. The crash occurs during session resume and makes the session unrecoverable.

What Should Happen?

Claude Code should not crash on a type error. The variable H should be validated as a string before calling .indexOf(), or its source should guarantee it is never undefined. The session should resume normally.

<img width="1233" height="791" alt="Image" src="https://github.com/user-attachments/assets/6e15ebd6-6b48-4fd9-8d2d-c14e4d35250a" />

Error Messages/Logs

ERROR  H.indexOf is not a function. (In 'H.indexOf(`
        `)', 'H.indexOf' is undefined)
 - dK8 (/$bunfs/root/src/entrypoints/cli.js:945:3365)
 - nj4 (/$bunfs/root/src/entrypoints/cli.js:7509:3111)
 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9413:15854)
 - gz (/$bunfs/root/src/entrypoints/cli.js:551:30342)
 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:538:9671)
 - Wa_ (/$bunfs/root/src/entrypoints/cli.js:9413:15571)
 - KM (/$bunfs/root/src/entrypoints/cli.js:551:21147)
 - zM (/$bunfs/root/src/entrypoints/cli.js:551:39923)
 - IE (/$bunfs/root/src/entrypoints/cli.js:551:50734)
 - pAH (/$bunfs/root/src/entrypoints/cli.js:551:87758)

Steps to Reproduce

  1. Run a Claude Code session that processes multi-line tool output (e.g., a long file write or large response).
  2. The CLI crashes with the H.indexOf is not a function error shown above.
  3. Try to resume with claude --resume <session-id> — the same error occurs and the session is unrecoverable.
  4. Work is lost; pressing Ctrl+C and resuming hits the same crash.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.150

Claude Code Version

2.1.150 (Claude Code)

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Windows Terminal

Additional Information

DS:Ubuntu 24.04.4 LTS (Noble Numbat) x86_64
Host:A320M-HDV R4.0
Kernel:Linux6.8.0-111-generic
Jptime:17 days,21 mins
Packages:1335(dpkg),7(snap)
Shell: zsh 5.9
Terminal:/dev/pts/8
CPU: AMD Ryzen 5 2600 (12) @ 3.40 GHz
GPU:AMD Radeon RX 580 2048SP [Discrete]
CPU Usage: 7%
Memory:4.50GiB/15.54GiB(29%)
Swap:1.35GiB/4.00GiB(34%)
Disk (/):96.02 GiB / 465.88 GiB (21%) - ext4
Connection: Windows Terminal → SSH → Tailscale → Linux server

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗