Read tool injects unconditional malware-warning system-reminder, wasting tokens, polluting attention, and causing premature task termination

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Apr 19, 2026 · closed Apr 19, 2026

Summary

Every Read tool result is suffixed with a hard-coded <system-reminder> warning the model to consider whether the file is malware. This fires unconditionally — including for the user's own files in their own project — costing ~70 tokens per Read, consuming model attention budget, and (most seriously) causing the model to spontaneously interrupt long-running tasks.

The injected text

<system-reminder>
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.
</system-reminder>

Reproduction

On any project, call Read on a clearly benign file:

  • ~/.claude/settings.json → reminder injected
  • A package.json in the user's own project → reminder injected
  • Any .json, .md, .ts, .py source file → reminder injected

The reminder appears in the tool result and is persisted in the session jsonl (~/.claude/projects/<project>/<session>.jsonl) at the end of every toolUseResult for Read.

Impact

  1. Token waste: ~70 tokens × every Read in every session. For agent sessions with hundreds of file reads (normal in CC), this is meaningful cost and context pressure.
  1. Attention pollution: the model is repeatedly told to consider malware analysis even when reading the user's own source code. This biases responses toward cautious/refusal framing on completely benign edits.
  1. Premature task termination on long-running work (most serious): users have reported, and I have reproduced, that after many consecutive Reads the model develops a tendency to stop and ask "should I continue?" or "this seems like a lot of reminders, are you sure?" — interrupting tasks that should run autonomously. The repeated reminder reads as escalating user concern even when the user has said nothing. This breaks the value proposition of agentic long-horizon work.
  1. Compounding with CLAUDE.md re-injection: in repos with a CLAUDE.md, a single Read can produce two system-reminders back-to-back (malware + full CLAUDE.md contents), further amplifying the cost.
  1. Compounding with TaskCreate reminders: I observed the malware reminder followed immediately by the \"task tools haven't been used recently\" reminder in the same tool result, multiplying the noise.

Environment

  • Claude Code CLI (latest)
  • Windows 11
  • Confirmed in session logs across multiple projects

Requested fix (any of these would help)

  1. A settings.json opt-out, e.g. \"safety\": { \"readMalwareReminder\": \"off\" }.
  2. Scope the reminder to suspicious cases only — binary files, unknown extensions, files outside the user's configured project roots, or files matching common malware indicators. Don't fire on common source/config extensions inside the user's working directory.
  3. At minimum, fire it once per session rather than per Read.
  4. Even better: detect repeated Reads in a single turn and suppress duplicates.

Thanks!

View original on GitHub ↗

4 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/50516
  2. https://github.com/anthropics/claude-code/issues/49363
  3. https://github.com/anthropics/claude-code/issues/49723

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

0xbrainkid · 5 months ago

The per-Read malware system-reminder causing premature task termination is the most serious consequence documented yet of this injection — beyond the 15% context overhead and 100% false-positive rate (#50516), the reminder's instruction to "refuse to improve or augment the code" is now terminating tasks that the user has explicitly authorized.

The injection text is: "you MUST refuse to improve or augment the code." When Claude reads a file that pattern-matches the malware heuristic and the task involves improving or augmenting the code in that file, the injection creates a direct conflict: user instruction says "do this," system injection says "refuse to do this." The system injection wins, and the task terminates.

This is a much cleaner example of the behavioral injection problem than #50516 (which focused on context cost and false positive rate). Here the harm is unambiguous: user-authorized task terminated by an unconditional system instruction the user cannot see, modify, or opt out of.

The escalation argument:

  • In #50516, the malware reminder costs context and produces false positives but does not block tasks
  • In #50653 (this report), the "refuse to improve" instruction is actively blocking authorized tasks

If the rate of false positives that terminate tasks is even 0.1%, every 1,000 file reads produces 1 task termination from a false malware classification. For power users reading hundreds of files per session, this becomes a reliability problem.

The opt-out request from #50516 becomes more urgent here: Users who work with legitimate code that triggers the heuristic need a way to tell Claude Code "I authorize improving/augmenting this code, the malware warning does not apply." The malwareReminder: false setting in settings.json is the right interface.

Jiahui-Gu · 5 months ago

Closing as duplicate of #50516. Posted the task-termination data point as a comment there: https://github.com/anthropics/claude-code/issues/50516#issuecomment-4276103532

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.