Ado· @adocomplete · X·AI 评分55
Anthropic 员工演示用 send diagnostics 排查 Claude Code 上下文断裂
AI 导读
Ado Kukic 介绍 Claude Code 的 send diagnostics 用法,第一轮传 {previous_message_id: null},之后每轮传上一条 response id。API 保留由哈希和 token 估算构成的指纹(不含提示词)并做差异对比,返回 model_changed、system_changed、tools_changed、messages_changed 之一,以及断裂后大约减少的 token 数,无需 beta header。
正文 · 原文
Send diagnostics: {previous_message_id: null} on turn one, then the last response id on every turn after. The API keeps a fingerprint (hashes and token estimates, never your prompt) and diffs it.
You get one of: model_changed, system_changed, tools_changed, messages_changed, plus roughly how many tokens fell after the break.
No beta header needed.
来源:Ado · x.com