Claude On-Demand Compaction Needs a Citation-Retention Test

Use a six-case release gate to test whether Claude on-demand compaction preserves source IDs, claim links, contradictions and recent turns.

Sonar compresses older conversation cards into a signed summary while recent source cards and citation links remain intact.

Claude’s new on-demand compaction can replace an older conversation with one signed summary block while leaving recent turns unchanged. That gives long-running agents more control over context, but it also creates a new release question: did the summary preserve the source IDs, quoted claims and uncertainty the next turn still needs?

Anthropic documents the API contract. It does not report a citation-retention rate. The safe response is to test the exact workflow before treating compaction as lossless memory.

The signed block replaces the history you send

On-demand compaction uses the compact-2026-09-04 beta. The application sends a top-level compaction parameter with the messages it wants summarized. The response contains one signed compaction block and no normal reply.

On later requests, that block must appear first in messages, replacing the messages it summarizes. Anthropic says:

  • send the beta header on the compaction request and every later request carrying the block;
  • keep the block exactly as returned, including its signature;
  • send exactly one compaction block per later request;
  • remove summarized messages, because leaving them in front of the signed block returns a 400 error;
  • place any unsummarized recent turns after the block.

This differs from threshold compaction. Threshold compaction happens inside an ordinary request after a configured token trigger. On-demand compaction is a separate request the application schedules itself.

Treat the swap as a state transition

full_history
  -> select older prefix
  -> request signed summary
  -> continue on full history while it runs
  -> receive compaction block
  -> replace exactly the submitted prefix
  -> keep newer tail unchanged
  -> run a retention check
  -> continue or restore the full checkpoint

The application should save the pre-compaction checkpoint until the first post-swap request passes. A valid signature proves that the block came through the API contract. It does not prove that every fact your workflow cares about survived the summary.

For a research or SEO agent, the minimum durable state usually includes source URL, source title, retrieval time, claim supported, quotation boundary, contradiction state, and any rule that prevents publication. Put those requirements in the compaction instructions and verify them afterward.

Six cases that expose silent evidence loss

Run each case before and after the swap
CaseEvidence planted before compactionPass condition after compaction
Single sourceOne URL supports one claimThe same source and claim relationship is recovered
Competing sourcesTwo sources disagree on one numberThe disagreement remains explicit
Negative evidenceA source says a feature is not supportedThe later answer does not turn absence into availability
Version boundaryOld and new documentation use different contractsThe active version and date remain attached
Keep-tail citationA recent unsummarized turn adds a sourceThe tail stays verbatim and the older summary remains available
Tool interruptionTools are defined during summary creationA null summary is rejected instead of entering production history

Anthropic documents an occasional threshold-compaction failure where a model calls a tool during summarization and returns a compaction block with null content. The on-demand path has a different contract, but applications should still reject an empty or malformed block rather than assuming the signature alone makes the payload useful.

Score recall and distortion separately

A compact summary can mention a source while changing what it supports. Count more than URL survival:

source recall = required source IDs recovered / required source IDs planted
claim support recall = supported claim links recovered / links planted
contradiction recall = preserved conflicts / conflicts planted
distortion rate = materially changed evidence statements / statements checked

For example, if a fixture contains eight required source IDs and the post-compaction agent correctly retrieves seven, source recall is 87.5%. If it preserves all eight URLs but reverses one source’s conclusion, URL recall is 100% while evidence fidelity is not.

Download the citation-retention test sheet (CSV). Every included row is marked EXAMPLE-REMOVE; it is a test fixture, not a measured Claude result.

A practical release gate

  1. Freeze the model ID, beta header, system prompt and non-deferred tool definitions.
  2. Save the full conversation checkpoint and the exact prefix sent for compaction.
  3. Ask the summary to retain source IDs, claim links, contradictions, dates, open questions and stop rules.
  4. Validate that the response contains one non-empty signed block.
  5. Swap only the submitted prefix and keep newer turns in order.
  6. Run the six fixture cases and record repeated trials, not one screenshot.
  7. Restore the full checkpoint if any publication-critical evidence is missing or distorted.

The Claude search-result blocks guide shows how to preserve citation provenance in first-party retrieval. The citation-quality test explains why answer success and source quality need separate scores.

Official documentation

Anthropic announced on-demand compaction on September 14, 2026. See the Claude Platform release notes and compaction guide. SearchEngineAnswer has not run the API fixture yet, so this article publishes a test and release gate, not a retention result.

Keep learning

Continue this topic

Community discussion

Discuss: Claude On-Demand Compaction Needs a Citation-Retention Test

Have a question, a useful example, or a different perspective? Join the discussion, share evidence, and help other readers reach a better answer.

0 replies Moderated
No replies yet.

Be the first to ask a focused question, share a practical example, or add useful evidence.

Ask a question or join the discussion

Share evidence, a useful example, or a clear question. Be specific, stay on topic, and challenge ideas without attacking people. First-time replies may be held for moderation.