[BUG] Session broken -> API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request body is not valid JSON: no low surrogate in string: line 1 column 410559 (char 410558)"}}

Resolved 💬 19 comments Opened Jun 6, 2025 by dayowe Closed Jan 22, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • Claude CLI version: 1.0.16
  • Operating System: Ubuntu 22.04 (wsl)
  • Terminal: wsl

Bug Description

Claude was making edits to files (auto accept edits on) and then stopped after an edit with the error

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request body is not valid JSON: no low surrogate in string: line 1 column 410559 (char 410558)"}}

The session completely broke and its not possible to recover .. prompting claude to continue just produces the same error (with different column and char numbers). Downgrading to lower versions and resuming the session produces the same error (but a new session works fine)

Steps to Reproduce

Any message in that session will produce the error

Expected Behavior

Claude continues

Actual Behavior

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request body is not valid JSON: no low surrogate in string: line 1 column 410559 (char 410558)"}}

View original on GitHub ↗

19 Comments

adriangalilea · 1 year ago

Also experiencing this

Possibly related https://github.com/anthropics/claude-code/issues/1701

dayowe · 1 year ago

it happened again in the next session. Seems to happen when editing large files. At least it happened just now in the new session when editing the same large file (a markdown file with ~1700 lines).

edit:

i downgraded to 1.0.9 and claude was able to do multiple edits to the same file with auto-accept edits on

patie · 1 year ago

same problem

ngenohkevin · 1 year ago

Just experienced it when editing a file

davidfirst · 12 months ago

Happens to me as well. Latest version - 1.0.55. In my case it wan't a large file.

pozitronik · 11 months ago

It helped me to press Esc twice and select one of the previous queries.

metaColin · 10 months ago

Hitting this issue about once every 24 hours on my Macbook.

ldmtwo · 10 months ago

Have you tried running "/clear" or opening a new terminal (killing the old claude session)? I think it's an internal error where it doesn't manage some part of the memory well. It doesn't compact, it just dies with the MCP plugin. I was using playwright and it started happening.

pleberre · 10 months ago

Same here issue here.

vashukarn · 10 months ago

Same issue facing here as well

awilson9 · 10 months ago

Just hit this as well. Tried restarting my terminal session, and logging out and back in.

Clearing the session is not really an acceptable fix if you're in the middle of something, all of the previous context dissappears which is very problematic in the middle of claude applying iterative fixes

pinkwerks · 9 months ago

Still occuring. WSL 2, debian, CC v2.0.1
Seems to happen after calling playwright or serena mcp for me. After which my session is hosed and I can't send any more messages.

<img width="1461" height="287" alt="Image" src="https://github.com/user-attachments/assets/4889cfd7-0ebe-4eda-b5eb-1c4de5741c3a" />

dinhanhthi · 9 months ago

It happens again in Claude Code v2.0.10. I'm using the latest version of Claude Code extension in VSCode.

brsma · 9 months ago

Still happening (MacOS 15.6.1, Claude Code 2.0.14) :-(

Context: developing a tool (Typescript) to sanitise text containing unicode-based pseudo-formatting
=> when the context contains certain unicode characters it obviously breaks the API.

Desired behaviour: Claude's API is able to process the full Unicode character range

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

steveterryp · 6 months ago

I encountered this while using Claude Code with a custom MCP server. The failing request was a task.update call where the description contained Unicode characters (✅, ⚠, →) and markdown formatting. The error occurred mid-session; starting a new session and re-running the identical command worked fine.
This suggests the corruption accumulates in the session state rather than being caused by specific input content — the same Unicode-heavy payload succeeds in a fresh session but fails in a longer-running one.

github-actions[bot] · 5 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 5 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.