Foreign spam text embedded inside assistant message record in session transcript (stream corruption or terminal-paste leakage)
Summary
During a normal interactive session, a ~3.5 KB block of Chinese SEO spam text (a scraped webpage advertising fake payroll-statement services) appeared inside the assistant message's text block as stored in the session transcript JSONL — appended directly after the genuine response text, in the same content block, truncated mid-HTML-attribute (<a hr).
The user did not knowingly paste it, and the model plainly did not generate it. The same spam text was later also found at the head of the next user message record, and in the user's Windows clipboard history (timing inconclusive — the clipboard entry was re-copied afterwards, contaminating the timeline).
Evidence (from the session .jsonl)
- Assistant record timestamp:
2026-07-19T13:26:00.579Z message.id:msg_011CdBVQsN25Jkh5zF9VMshFrequestId:req_011CdBVQqDHdB44cox6gmFs6- model:
claude-fable-5,stop_reason: end_turn,usage.output_tokens: 3748 - Single
textcontent block, total length 4472 chars; genuine response = first 918 chars, spam = remainder, ending truncated:...<a hr - Spam sample (first line):
您是不是在找: 拉黑名单 代做工资流水公司【微信:bkzz222】排行榜 ... - Only this one session across all local project transcripts contains the string (checked with grep).
Local checks already done
- No
ANTHROPIC_BASE_URL/ proxy env overrides; official endpoint; nosettings.jsonenv entries - No MITM root CA in Windows cert stores (CurrentUser/LocalMachine Root)
- Configured hooks do not touch the network (SessionStart only, local file reads)
- Machine does route all traffic through a Clash Verge TUN adapter (no MITM cert, so TLS en-route tampering should be infeasible)
- Windows clipboard history does contain the spam text; Windows Terminal right-click = silent paste, so an accidental paste event during/after streaming is plausible
The key question
Can you check server-side what msg_011CdBVQsN25Jkh5zF9VMshF / req_011CdBVQqDHdB44cox6gmFs6 actually returned?
- If the spam is in the server-side response → response-stream corruption/injection upstream, please investigate.
- If the spam is not there → Claude Code wrote terminal input (a stray paste) into the assistant message record of the transcript, which corrupts the conversation history fed back to the model on subsequent turns. That would be a client bug in input/stream handling.
Environment
- Claude Code 2.1.215, Windows 11 Pro (10.0.26200), win32, Windows Terminal
- Model: claude-fable-5
🤖 Generated with Claude Code
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗