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

Status Fixed / completed
Reported on v2.1.144
Maintainer reply None cached
Activity 5 comments · opened May 19, 2026 · 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 ↗

5 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/57995
  2. https://github.com/anthropics/claude-code/issues/59295
  3. https://github.com/anthropics/claude-code/issues/43663

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

NodeGIS · 4 months ago

相同的问题

sja512 · 4 months ago

相同的问题

a740659387 · 4 months ago

Do not use powershell 7

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.