What
The server can clear parts of the conversation itself, for example old tool results, through a feature called context_management. Claude Code now keeps and uses that information:
- When a streamed reply is put together,
context_managementfrom the finalmessage_deltais now copied onto the stored message. Before, onlystop_reason,stop_sequence,stop_detailsandresearchwere copied. - A new helper also copies
message.context_managementwhen assistant messages are merged. - The auto-compact check (which decides when to summarize a long conversation to save space) now adds the tokens the server reported as cleared (the
applied_editson the last assistant message) to its token estimate before choosing a compact level. - The debug log line gains a
serverCleared=part.
Why
For sessions where the server has been clearing context, auto-compact can now start earlier than before. The debug log shows how much the server cleared.
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is not clear why the cleared tokens are added to the estimate rather than taken away from it.