Corrupted synthetic message injected during context compaction contains unrelated web spam
Description
During a long Claude Code session (rater configuration work), context compaction produced a <synthetic> assistant message containing entirely unrelated content — an AI-generated blog post about nonprofit fundraising from an Ezoic-monetized WordPress site. This corrupted content was then carried into the continuation session via the conversation summary mechanism, appearing as if Claude had generated it.
Impact
- Data integrity: Arbitrary, unrelated content was injected into the conversation history with no clear origin
- User confusion: The spam content appeared mid-conversation as if Claude had authored it
- Context pollution: The corrupted synthetic message consumed context window tokens in the continuation session, displacing actual conversation history
Evidence
The corrupted message is in the conversation transcript at line 1443:
{
"type": "assistant",
"uuid": "33adf2e6-3638-49dc-bc23-ccad056bdd10",
"timestamp": "2026-03-24T16:46:18.887Z",
"message": {
"model": "<synthetic>",
"role": "assistant",
"stop_reason": "stop_sequence",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"content": [
{
"type": "text",
"text": "Lol, my bad. The correct acronym is:\n\n3G - Giving, Guiding, Generating\n\nHere's the corrected version:\n\nFundraising-Framing-Framing: The Three Pillars of Sustainable Giving\n..."
}
]
}
}
Key characteristics of the injected content:
model: "<synthetic>"with zero token usage (not generated by Claude)- Contains an AI-generated blog post about "The Giving-Guiding-Generating Framework" for nonprofit fundraising
- Author attribution to "Lilly, a content writer"
- Hundreds of repeated "Let me know if you have any other questions.\nEzoic" lines (Ezoic is an ad network)
- WordPress blog artifacts: "Leave a Reply", "Previous Post/Next Post", "Save my name, email, and website"
- Completely unrelated to the actual session content (insurance rater configuration)
Reproduction
- Session ID:
2a88f1e4-f85b-4a75-ab4f-283b23192b11 - Transcript location:
~/.claude/projects/-Users-gabemartinez-sure-PM-Workflow/2a88f1e4-f85b-4a75-ab4f-283b23192b11.jsonl - Line: 1443
- Context: Long session with many CLI tool calls (surecraft rc commands), eventually ran out of context and was continued in a new session
- Model: claude-sonnet-4-6, later switched to claude-opus-4-6
Expected behavior
Context compaction should only produce synthetic messages that summarize the actual conversation content. No external or unrelated content should be injected.
Environment
- Claude Code CLI
- macOS Darwin 24.6.0
- Model: claude-sonnet-4-6 / claude-opus-4-6
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗