Why the server hands back an encrypted context you're only going to echo
A twenty-turn conversation that triggers context compaction returns two things, a readable summary and an encrypted blob, and only the encrypted blob actually restores what compaction saved.
When a long Claude conversation triggers compaction, the response that comes back carries two different fields, and it's easy to assume the wrong one is the important part. There's a readable summary you can actually look at and understand, and there's an opaque encrypted blob that looks like noise. The natural guess is that the readable text, being the part a person can parse, is what carries the conversation's memory forward. It isn't, and building a multi-turn app around that assumption breaks context in exactly the cases where compaction matters most.
What compaction actually returns
When a conversation gets long enough, compaction fires and hands back two things: a content field with the earlier conversation summarized in plain English, and an encrypted_content field, a sealed string. In a twenty-turn conversation that overflows and triggers compaction, threading the readable summary text alone into the next call causes context to break. Threading the encrypted blob back instead holds. That's the concrete test case the distinction rests on.
Display text versus a server-verifiable token
The reason for that difference comes down to what each field is actually for. The readable text is display and debug output, meant for a person to read, not for the model to rely on. The encrypted blob is a server-verifiable token that reconstructs the full compressed context, including turn boundaries, roles, and metadata, all the structural information that plain prose summarization throws away in the process of making it readable. On the next call, passing only the blob doesn't cause the server to replay all twenty prior messages. It rebuilds the full context directly from the token, restoring everything compaction had saved. That doesn't make the readable summary pointless, it's still exactly what you'd want to show a user or write to a log. It's just not what the model needs to remember the conversation.
What this means for a real implementation
For anyone building a multi-turn app on the Anthropic SDK, the practical implication is specific: detect a compaction block in the response, and thread the encrypted_content blob, not the human-readable summary, back into the next messages array. Sending the summary text instead is the mistake that breaks context in longer sessions, precisely because that text was never meant to carry the conversation's state.
Key takeaways
- Compaction returns two fields: a readable summary meant for humans, and an encrypted blob meant for the server.
- Only the encrypted blob is a server-verifiable token that reconstructs turn boundaries, roles, and metadata.
- Passing the summary alone into the next call breaks context in a twenty-turn test case; passing the blob holds.
- On the next call, the blob lets the server rebuild full context directly, without replaying every prior message.
- The readable summary still has value for display and logging, it's just the wrong field to pass back into the conversation.
Try it yourself
If you're building a multi-turn PHP app with the Anthropic SDK, detect a compaction block in the response and write the code that threads the encrypted_content blob back into the next messages array instead of the summary text, then check what breaks if you send the summary instead. This walkthrough is part of Humanitarians AI's Claude Basics series.
Chapters
Full transcript(auto-generated, with timestamps)
Is the summary what Claude remembers?
[0:00]Someone assumes the readable summary Claude hands back is what it remembers. It's not. It's just what's shown to you. So, why does the server hand back an encrypted blob you're only going to echo? When a chat gets long, compaction fires
Two things come back: summary and blob
[0:12]And hands you back two things: a readable summary and an opaque encrypted blob. The natural guess is that the summary, the part you can read, is what carries the memory forward. Pass it alone into the next call and the context breaks anyway. Here's the concrete case.
The anchor: a twenty-turn conversation
[0:27]A 20-turn conversation overflows and compaction fires. You get back content, earlier conversation summarized in plain English right next to encrypted content, a sealed string starting epobcioidxgc. Thread the readable text into the next call and context breaks. Thread the blob back instead and it holds. Here's why.
Why: display text vs. server-verifiable token
[0:45]The readable text is display in debug only. It's for you, not for the model. The encrypted blob is a server-verifiable token. It reconstructs the full compressed context, turn boundaries, roles, metadata, everything the plain summary throws away.
The anchor returns: one token, not a replay
[1:00]So, on the next call, you pass only the blob. The server doesn't replay 20 messages. It rebuilds the full context straight from the token. Passing the blob restores everything compaction saved. It doesn't make the readable summary useless, since that text is still exactly what you'd show a user or a log. The readable summary is
Carry-out
[1:18]For your eyes. The encrypted blob is what actually carries the conversation's memory forward. Your turn. Here's the
Your turn
[1:24]Prompt. Read it with me. You're building a multi-turn PHP app with the Anthropic SDK. Show me how to detect a compaction block in the response and write the code that threads the encrypted content blob, not the human-readable summary, back into the next messages array. Explain what breaks if you send the summary text instead. Liam in for Bear. Why the
Outro
[1:43]Server hands back an encrypted context you're only going to echo. Liam in for Bear.
More from Claude
1:53Why partial JSON can be a valid object before the closing brace arrives
1:42Why wrapping the same text in XML changes the answer Claude gives
4:12Claude, Closing — Do You Have to Be a Salesperson to Use the Sales Plugin?
1:37Claude, Listener Creator.
3:39Claude, On Call — The Support Plugin
1:27