[BUG] Queued message delivered inside WebSearch tool result wrapped in `<system-reminder>`
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When a user message is queued while a WebSearch tool call is in progress, the queued message is delivered to the assistant inside the WebSearch tool result, wrapped in a <system-reminder> block, rather than as a normal user turn between tool calls.
From the assistant's perspective in an affected session, this looks like a prompt injection.
Same thing happens with system reminders like the one on TaskCreate. These can also land in the WebSearch result.
Observed consequences:
- The assistant reads the queued message as part of the fetched web content.
- The assistant flags the queued user content as a possible prompt-injection attempt (since
<system-reminder>-shaped instructions arriving from web content are exactly what prompt-injection guidance tells it to ignore).
What Should Happen?
A queued user message should be delivered as a distinct user turn after the in-flight tool call completes, not concatenated into the tool result, and not wrapped in <system-reminder> tags.
Error Messages/Logs
If the message is any form of instruction, Claude warns that the response is likely a prompt injection and flags it as such.
Steps to Reproduce
- Send a prompt that triggers any WebSearch (any query that the assistant will resolve via web search).
- While the WebSearch is in progress, queue a follow-up message in the prompt input and submit it.
- When the tool result returns, the queued message appears inside the tool result, wrapped in a
<system-reminder>block, instead of as a separate user turn.
For system reminders, the reminder has to fire during step 2. for the same effect.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.139
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
GNOME Terminal
Additional Information
- First observed ~2 weeks ago.
- Related: #58227. Looks like the same underlying bug, but that issue reports only the case with system reminders. The bug seems to be broader, however.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗