[BUG] Crash: undefined is not an object (evaluating 'H.command') in isSearchOrReadCommand on Windows

Resolved 💬 5 comments Opened May 19, 2026 by YuWuChen82 Closed May 20, 2026

Environment

  • Claude Code version: 2.1.144
  • OS: Windows 11 Home China 10.0.22000
  • Runtime: Bun

Bug Description

When running Bash tool commands in Claude Code, the CLI crashes with:

ERROR  undefined is not an object (evaluating 'H.command')
  B:/~BUN/root/src/entrypoints/cli.js:4315:2988
  - isSearchOrReadCommand (B:/~BUN/root/src/entrypoints/cli.js:4315:2988)
  - iNH (B:/~BUN/root/src/entrypoints/cli.js:4756:773)
  - KX8 (B:/~BUN/root/src/entrypoints/cli.js:4756:773)

Steps to Reproduce

  1. Use Claude Code on Windows (Bun runtime)
  2. Run any Bash tool command (e.g., lark-cli docs +fetch ...)
  3. The crash occurs intermittently when the CLI tries to classify the command via isSearchOrReadCommand

Root Cause Analysis

The function isSearchOrReadCommand expects a command object with a .command property, but receives undefined. This suggests the command object is not being properly initialized or passed in certain code paths on Windows/Bun.

Related Issue

This is a re-open of #43663 ("Crash: Cannot read properties of undefined (reading 'command')"), which was closed as stale/not-planned without being fixed. The bug still exists in version 2.1.144.

Impact

  • Every crash requires the user to restore the Claude Code session
  • Disrupts workflow when running external CLI tools (lark-cli, npm, etc.)
  • Seems to be Windows-specific

View original on GitHub ↗

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