claude-code - 💡(How to fix) Fix Malware-analysis reminder injected on every Read tool call, including trivial config files [1 participants]

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…
GitHub stats
anthropics/claude-code#52448Fetched 2026-04-24 06:06:59
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×5cross-referenced ×1

Every Read tool invocation in my Claude Code session returns a <system-reminder> appended to the tool result instructing Claude to "refuse to improve or augment the code" on the basis that it might be malware. This fires unconditionally — including on empty/trivial JSON config files — and blocks Claude from performing normal edits on the user's own codebase without the user explicitly overriding it in chat each session.

Root Cause

Repeating the reminder verbatim on every Read result, regardless of file content or origin, turns it into noise — which is worse than no guardrail, because it conditions users to tell Claude to ignore it.

RAW_BUFFERClick to expand / collapse

Summary

Every Read tool invocation in my Claude Code session returns a <system-reminder> appended to the tool result instructing Claude to "refuse to improve or augment the code" on the basis that it might be malware. This fires unconditionally — including on empty/trivial JSON config files — and blocks Claude from performing normal edits on the user's own codebase without the user explicitly overriding it in chat each session.

Reminder text (appended to every Read result)

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.

Repro

  1. Start a Claude Code session in any local repo you own.
  2. Ask Claude to read any file — e.g. ~/.claude/settings.json.
  3. Observe the reminder appended after the file contents.
  4. Ask Claude to edit the file — Claude will (correctly, per the reminder) refuse.

Why it matters

  • False-positive rate is effectively 100%. It fires on the user's own codebase, including files with no executable code (e.g., a 10-line settings.json containing only a marketplace config).
  • Breaks the normal "read → edit" workflow. Users doing legitimate refactors, bug fixes, or feature work on their own repositories have to override the reminder in chat each session.
  • No user-level opt-out is visible. No hooks configured in ~/.claude/settings.json or project .claude/settings.json — the reminder is injected by the platform, not by any user or project config I can inspect.

Environment

  • Claude Code (latest as of 2026-04-23)
  • Platform: macOS 15 (Darwin 25.4.0)
  • Model: claude-opus-4-7[1m]
  • No user/project hooks configured (verified by reading both settings files and finding no hooks section)

Suggested fix

Gate the reminder on at least one of:

  1. Content heuristics (obvious malware signals: obfuscation, suspicious syscalls, known-bad imports).
  2. Origin heuristics (files outside the user's own working directory, downloaded artifacts, clipboard-sourced content).
  3. A per-session or per-repo opt-out (e.g., --trusted-repo or a CLAUDE.md toggle).

Repeating the reminder verbatim on every Read result, regardless of file content or origin, turns it into noise — which is worse than no guardrail, because it conditions users to tell Claude to ignore it.

extent analysis

TL;DR

Implement a more nuanced reminder system that gates the malware warning based on content or origin heuristics to reduce false positives and allow for a smoother user experience.

Guidance

  • Investigate implementing content heuristics to detect obvious malware signals such as obfuscation, suspicious syscalls, or known-bad imports before appending the reminder.
  • Consider adding origin heuristics to differentiate between files within the user's own working directory and those from external sources.
  • Introduce a per-session or per-repo opt-out mechanism, such as a --trusted-repo flag or a CLAUDE.md toggle, to allow users to bypass the reminder when working on their own codebase.
  • Review the current reminder implementation to ensure it's not overly broad and adjust the conditions under which it's triggered to minimize false positives.

Example

No specific code example can be provided without more details on the Claude Code platform's internal workings, but the suggested fix implies modifying the logic that appends the reminder to Read tool results.

Notes

The exact implementation details of the reminder system and the heuristics to be used are not specified and would require further investigation into the Claude Code platform's architecture and security requirements.

Recommendation

Apply a workaround by introducing content or origin heuristics to gate the reminder, as this approach balances security concerns with user experience, allowing for more precise and less intrusive malware warnings.

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

claude-code - 💡(How to fix) Fix Malware-analysis reminder injected on every Read tool call, including trivial config files [1 participants]