[BUG] API Error: 400 The request body is not valid JSON: unexpected character: line 1 column 1 (char 0)
Open 💬 0 comments Opened Jul 13, 2026 by sholub89
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?
Claude Code sessions break after compaction if it had URL in context.
What Should Happen?
It should continue to work :)
Error Messages/Logs
API Error: 400 The request body is not valid JSON: unexpected character: line 1 column 1 (char 0)
Steps to Reproduce
- Start new session in Claude Code
- Pass any message with URL, for example
can you read this document https://www.anthropic.com/news ? - Execute
/compactcommand, wait until completed - Ask any follow up question -> observe session is broken due to
API Error: 400 The request body is not valid JSON: unexpected character: line 1 column 1 (char 0)error
<img width="1581" height="1071" alt="Image" src="https://github.com/user-attachments/assets/0f1e4126-3cf3-44a8-9173-0eb3067f5755" />
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.207 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_