[BUG] ERROR Invalid String Length (Claude Code crashing)

Resolved 💬 5 comments Opened Oct 29, 2025 by waldoalvarez00 Closed Jan 12, 2026

Preflight Checklist

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

What's Wrong?

Just let it running with a task and when I check the console it was crashed at the end of a task. Writing a resume.

What Should Happen?

Not crash, just finish

Error Messages/Logs

ERROR  Invalid string length

 file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:725:2651

 -  (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:725:2651)
 -  (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1253:6034)
 -  (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1539:28863)
 - OS (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:73:20238)
 - RS (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:73:20721)
 - Object.useState (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:73:27274)
 - co2.useState (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:11:7844)
 - X3 (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1539:28745)
 - Vw (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:73:19414)
 - Lv (file:///C:/Users/waldo/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:75:3226)

Steps to Reproduce

No idea. I am using Serena MCP. Maybe could be related or help with tracking the issue.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.28 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

<img width="1881" height="1059" alt="Image" src="https://github.com/user-attachments/assets/82600180-8593-495f-9a1e-5bf4626292e4" />

View original on GitHub ↗

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