claude-code - 💡(How to fix) Fix [BUG] Crash: undefined is not an object (evaluating 'H.command') in isSearchOrReadCommand on Windows [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60511Fetched 2026-05-20 03:56:42
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Error Message

ERROR undefined is not an object (evaluating 'H.command')

Root Cause

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.

Code Example

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)
RAW_BUFFERClick to expand / collapse

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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Crash: undefined is not an object (evaluating 'H.command') in isSearchOrReadCommand on Windows [1 comments, 2 participants]