claude-code - 💡(How to fix) Fix [BUG] Queued message delivered inside WebSearch tool result wrapped in `<system-reminder>`

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example

If the message is any form of instruction, Claude warns that the response is likely a prompt injection and flags it as such.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Send a prompt that triggers any WebSearch (any query that the assistant will resolve via web search).
  2. While the WebSearch is in progress, queue a follow-up message in the prompt input and submit it.
  3. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING