RangeError: String Length Overflow in Claude Code CLI Socket Handler

Resolved 💬 6 comments Opened May 25, 2025 by rayozzie Closed Nov 30, 2025

Bug Description
RangeError: Invalid string length
at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:27780)
at Socket.emit (node:events:507:28)
at Socket.emit (node:domain:489: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:189:23)
RangeError: Invalid string length
at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:27780)
at Socket.emit (node:events:507:28)
at Socket.emit (node:domain:489: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:189:23)
RangeError: Invalid string length
at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:27780)
at Socket.emit (node:events:507:28)
at Socket.emit (node:domain:489: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:189:23)
RangeError: Invalid string length
at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:27780)
at Socket.emit (node:events:507:28)
at Socket.emit (node:domain:489: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:189:23)
RangeError: Invalid string length
at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:27780)
at Socket.emit (node:events:507:28)
at Socket.emit (node:domain:489: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:189:23)
RangeError: Invalid string length
at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:27780)
at Socket.emit (node:events:507:28)
at Socket.emit (node:domain:489: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:189:23)

Environment Info

  • Platform: macos
  • Terminal: Apple_Terminal
  • Version: 1.0.3
  • Feedback ID: 4b0d94b1-866c-4228-9099-84dd238f14e8

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at cG (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:644:3513)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:15313\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:532:13335)\n    at sR1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:14562)\n    at aI (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:574:14179)\n    at FU2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1965:20997)","timestamp":"2025-05-25T12:30:00.703Z"},{"error":"Error: ENOENT: no such file or directory, scandir '/Users/rozzie/.claude/ide'\n    at Module.readdirSync (node:fs:1581:26)\n    at Object.readdirSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:540:1519)\n    at UD0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1318:16584)\n    at Da (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1319:2580)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2370:11384\n    at b7 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:21374)\n    at hZ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:40861)\n    at wW (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:34915)\n    at W5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:148:4822)\n    at $8 (file:///opt/homebrew/li

Note: Error logs were truncated.

View original on GitHub ↗

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