[BUG] MacOS kills Claude and says "Malicious Script Blocked"
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?
This happened twice last week (also on Wednesday) and again just now.
I was using Claude for something innocuous, and suddenly, the process was killed and I received this alert in a separate dialog box:
<img width="372" height="346" alt="Image" src="https://github.com/user-attachments/assets/5edf38cd-16f3-4db7-bd76-105cfc3eef52" />
The dialog says
Malicious Script Blocked A script was blocked because it contains malware. The script did not harm your Mac. [Done]
All the occurrences so far seemed to happen in completely bland circumstances.
- I was preparing to write some code, but Claude was firmly in the stage of examining the documentation and other files it was going to be working on in order to formulate a plan.
- I was working on a pull request and had Claude read feedback from a reviewer and responding to it with code changes and comments.
- I was collecting some statistics on domain names and running whois queries etc
When this happened last week, I was roughly on Claude 2.1.246, probably slightly earlier. The occurrence today happened on 2.1.252 and I have since updated to 2.1.258.
There is no repeatable repro that I can find; it seems to happen basically at random. In the last week, I have run dozens of sessions that were unaffected, often several in parallel.
What Should Happen?
MacOS should not kill Claude. It doesn't seem to kill random processes in general, so there is something specific that Claude is doing which triggers this. The best diagnostic I could get out of Claude itself was "maybe it reacted to something in a Python script in a here document?"
Error Messages/Logs
Process killed
Steps to Reproduce
- Use Claude as usual
- Randomly and rarely have Claude get killed from underneath
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.240 or thereabouts
Claude Code Version
2.1.252
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
Adding a noise comment to prevent this from being closed.
adding one more comment, i have the same issue with same version.
@ismailcelik-tr Please upvote the ticket instead, that is apparently the better way to draw attention to it.
Happening to me