claude-code - 💡(How to fix) Fix [BUG] TypeError: Cannot read properties of null (reading 'split') in renderToolResultMessage [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#52291Fetched 2026-04-24 06:11:02
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

When using Claude Code, the CLI crashes with a TypeError in the renderToolResultMessage function. The error occurs during tool result rendering.

Error Messages/Logs

ERROR Cannot read properties of null (reading 'split')

Code Example

ERROR  Cannot read properties of null (reading 'split')                                                                                                                                                     
                                                                                                                                                                                                              
  file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1641:1217                                                                                                                                     
                                                                                                                                                                                                              
  - Object.GZ2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1641:1217)                                                                                                                      
  - mb2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:2621:3861)                                                                                                                             
  - d7 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:20757)                                                                                                                              
  - xZ (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:39150)                                                                                                                              
  - Gd (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:49766)                                                                                                                              
  - mk (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:86041)                                                                                                                              
  - Ps (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:85015)                                                                                                                              
  - Kd (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:84840)                                                                                                                              
  - Id (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:81635)                                                                                                                              
  - J0 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:6273)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When using Claude Code, the CLI crashes with a TypeError in the renderToolResultMessage function. The error occurs during tool result rendering.

The command fails with:
TypeError: Cannot read properties of null (reading 'split')
at Object.GZ2 [as renderToolResultMessage]

What Should Happen?

Tool results should render without crashing.

Error Messages/Logs

ERROR  Cannot read properties of null (reading 'split')                                                                                                                                                     
                                                                                                                                                                                                              
  file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1641:1217                                                                                                                                     
                                                                                                                                                                                                              
  - Object.GZ2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1641:1217)                                                                                                                      
  - mb2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:2621:3861)                                                                                                                             
  - d7 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:20757)                                                                                                                              
  - xZ (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:39150)                                                                                                                              
  - Gd (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:49766)                                                                                                                              
  - mk (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:86041)                                                                                                                              
  - Ps (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:85015)                                                                                                                              
  - Kd (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:84840)                                                                                                                              
  - Id (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:81635)                                                                                                                              
  - J0 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:6273)

Steps to Reproduce

1- Open claude code using claude command 2- start resume a chat via /resume command 3- CRASH!

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.117

Claude Code Version

2.1.118

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The most likely fix is to downgrade to version 2.1.117, as the issue is reported as a regression and was working in that version.

Guidance

  • Verify that the error occurs consistently when using the /resume command in the latest version (2.1.118) of Claude Code.
  • Check if the renderToolResultMessage function has any changes between versions 2.1.117 and 2.1.118 that could be causing the TypeError.
  • Test if downgrading to version 2.1.117 resolves the issue, as it is reported to be the last working version.
  • If downgrading is not feasible, consider reaching out to the development team for a patch or fix, as this is a regression issue.

Notes

The provided error message and stack trace suggest a null value is being passed to the split method, but without the code changes between versions, it's difficult to provide a more specific fix.

Recommendation

Apply workaround: Downgrade to version 2.1.117, as it is reported to be the last working version and the issue is a regression.

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