[BUG] API Error: 400 invalid_request_error - Claude is frozen....
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?
I was working with Claude after long sessions and everything was working fine until Claude suddenly stopped working... replying to everything with API Error 400...
What Should Happen?
Claude should reply, recovery itselfs or even start working again in the same shell.... or new tabs.
Error Messages/Logs
⎿ 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 143607 (char 143606)"},"request_id":"req_011CUGrZ8Kt6WinhmfwWshXY"}
> /context
⎿ 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 123482 (char 123481)"},"request_id":"req_011CUGraVozK9rczyY8YyJHP"}
> /doctor
⎿ Claude Code diagnostics dismissed
> Hola
⎿ 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 143607 (char 143606)"},"request_id":"req_011CUGrsJgjVc3SZFBhhfH5G"}
… +947 lines (ctrl+o to expand)
⎿ 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 279960 (char 279959)"},"request_id":"req_011CUGFp9ShFD5bSJWonhQbo"}
> y ahora?
⎿ 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 279960 (char 279959)"},"request_id":"req_011CUGFuKxbwVQAHGpFfuE8Y"}
> y ahora?
⎿ 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 279960 (char 279959)"},"request_id":"req_011CUGr6hfLwJ2dV3QU2Mi7X"}
> oye, estas lanzando 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 279960 (char 279959)"},"request_id":"req_011CUGr7rb8ywN5CFaNo4Bv4"}
Steps to Reproduce
Work with Claude for more than 24 hours letting being compacted and everything...
Make a lot of background process. Then keep working as usual. At some point, ask to clear all background process. Keep asking to do task normally. Ask how's the connection to different databases. suddenly API ERROR.
Cant even say "HI " to Claude because there API Error....
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.22
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗