[BUG] API Error 400 - The request body is not valid JSON: str is not valid UTF-8: surrogates not allowed - mid-conversation error

Open 💬 8 comments Opened Jun 2, 2026 by siddhithaker

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?

Error appeared mid-conversation without sending any images and have to start new chat and its not remember anything where left from

What Should Happen?

its not shows this error middle of Claude code conversation as its break all flows of work

Error Messages/Logs

API Error: 400 The request body is not valid JSON: str is not valid UTF-8: surrogates not allowed: line 1 column 1 (char 0)

Steps to Reproduce

Start a conversation in Claude Code (VS Code)
Continue conversation for several exchanges
Error appears without any file/image uploads

It happen since last 3 days only

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

last version also get error

Claude Code Version

2.1.160

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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