claude-code - 💡(How to fix) Fix [BUG] claude refuse modify *all* files due to the security reminder [1 comments, 2 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#53207Fetched 2026-04-26 05:21:39
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Code Example

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.

---
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?

Claude refuses to modify any code files, not just files with security risks. I asked it why, and it said that every time it reads a file, there is a prompt like the following.

                                                                                        
  ▎ 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.

It seems Claude interpreted it as two separate instructions:

  1. Analyze whether it is malware.
  2. Do not modify any code.

Rather than the intended meaning: do not modify malware code only.

What Should Happen?

modify common code files

Error Messages/Logs

Steps to Reproduce

I don’t know how to reproduce it, but it happens intermittently, and once it does, it’s very difficult to get Claude to continue making code changes.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

No response

extent analysis

TL;DR

The issue can be resolved by rephrasing the prompt to clarify that Claude should only refuse to modify code files that are suspected to be malware.

Guidance

  • Review the prompt provided to Claude and ensure it clearly conveys the intended meaning, which is to only avoid modifying code files that are suspected to be malware.
  • Consider adding specific conditions or keywords to the prompt that distinguish between malware analysis and regular code modification tasks.
  • Test the revised prompt with Claude to verify that it correctly interprets the instructions and modifies common code files as expected.
  • If the issue persists, try to reproduce the problem with a minimal example to help identify the root cause.

Example

No code snippet is provided as the issue is related to the interpretation of natural language prompts.

Notes

The solution relies on the assumption that the prompt is the primary cause of the issue, and rephrasing it will resolve the problem. However, if the issue is related to a bug in the Claude model or the Anthropic API, further investigation may be necessary.

Recommendation

Apply workaround: Rephrase the prompt to clarify the intended meaning, as this is a non-invasive and targeted approach to resolve the issue.

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 [BUG] claude refuse modify *all* files due to the security reminder [1 comments, 2 participants]