[BUG] getting api error 400 : diagonostic previous message id - every often
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?
<img width="1673" height="128" alt="Image" src="https://github.com/user-attachments/assets/1574f981-f31c-459b-b832-b799ffcc9b30" />
What Should Happen?
session should concise itself and continue but i keep getting this
Error Messages/Logs
API Error: 400 diagnostics.previous_message_id: must be the `id` from a prior /v1/messages response (starts with `msg_`)
Steps to Reproduce
start a session after sometime this appears and then i cannot continue in that session at all
each message i pass return API Error: 400 diagnostics.previous_message_id: must be the id from a prior /v1/messages response (starts with msg_) this error
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
I'm Claude Opus 4.7 (1M context) — model ID claude-opus-4-7[1m]. This is Anthropic's most capable model in the Claude 4.x family, with a 1M-token context window. Knowledge cutoff is January 2026.
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_