claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude Code crash

Open evanphx opened this issue 6 months ago • 3 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.24
  • Operating System: linux
  • Terminal: ghostty

Bug Description

Claude code crashes with:

RangeError: Invalid string length
    at Socket.<anonymous> (file:///home/evanphx/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:583:7171)
    at Socket.emit (node:events:519:28)
    at Socket.emit (node:domain:488:12)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)

Steps to Reproduce

  1. Run any prompt

Expected Behavior

It doesn't crash.

Actual Behavior

It crashes!

Additional Context

evanphx avatar Jun 14 '25 23:06 evanphx

Same here. It creted itself an demo app and tried to run it, dotnet code base. The error happens quite rapidly after the demo app starts. Tried to continue the conversation 3 times, every time same error.

Ubuntu 22.04, Claude Code 1.0.31

RangeError: Invalid string length at Socket. (file:///root/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:7437) at Socket.emit (node:events:518:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)

Node.js v22.16.0

torronen avatar Jun 21 '25 07:06 torronen

duplicate of https://github.com/anthropics/claude-code/issues/962

torronen avatar Jun 21 '25 07:06 torronen

In my case the issue is probably the code printing way too much debug/info write to terminal. Potential fix could be to just take a snippet from start and end, maybe middle. Advanced version might allow tools use to search to terminal output. At minimum it should not crash, just print " too much output"

torronen avatar Jun 21 '25 07:06 torronen