[BUG] Claude code CLI binary installer silently deletes itself after installation
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?
🐞 BUG: Claude Code CLI binary silently deletes itself after installation
Summary
After installing Claude Code using the official script (https://install.anthropic.com/code), the binary located at ~/.local/bin/claude is silently deleted by a background node process within minutes, making the CLI unusable. This occurs without user interaction.
Steps to Reproduce
# 1. Install Claude
curl -sS https://install.anthropic.com/code | sh
# 2. Verify it's installed
which claude # -> ~/.local/bin/claude
claude --version # -> 1.0.112
# 3. Wait a few minutes, then try again
which claude # -> not found
---
Root Cause Evidence
Using fs_usage, I captured this exact unlink event:
02:56:20.477495 unlink /Users/apathi/.local/bin/claude node.7897450
So node unlinked the binary silently, with no user input.
The process ran silently in the background and removed the claude binary after it had been successfully installed and verified. The process is node, likely from the package: @anthropic-ai/claude-code@1.0.44. No confirmation or fallback install happens. Leaves CLI completely unusable until reinstalled.
📦 Related Context
npm list -g --depth=1 | grep claude
├─┬ @anthropic-ai/claude-code@1.0.44
- The binary is installed to: ~/.local/bin/claude
- There’s no ~/.local/lib/node_modules/claude/ directory (suggesting cleanup or postinstall deletion or a faulty updater )
- .npm/_logs shows high activity around the deletion time
---
📅 Timeline Summary
| Time (PDT) | Event |
|-----------:|:------|
| 02:43 AM | Ran install script |
| 02:44 AM | Verified CLI works |
| 02:56 AM | claude binary deleted by node |
| 02:58 AM | Confirmed missing CLI in shell |
---
What Should Happen?
💥 Expected Behavior
- The CLI should not delete its own binary silently.
- Any updates or postinstall actions should verify success before unlinking anything.
- Binaries should not be unlinked unless rollback/replace is guaranteed.
- Silent self-deletion without user interaction breaks CLI workflows and trust.
---
🧠 System Info
- macOS: 14.x (Apple Silicon, MacBook Air M3)
- Claude Code Version:
1.0.112 - Node Version:
node -v=v v24.3.0 - npm Version:
npm -v=11.4.2 - Install Script Used:
https://install.anthropic.com/code
---
Error Messages/Logs
## 📎 Supporting Logs
**Attached:**
- `fs_usage.log` ← confirms deletion timestamp
- `dtruss_claude.log` ← shows launch-to-deletion flow
- `opensnoop_launcher.log` / `opensnoop_share.log` ← traces I/O ops
- `.npm/_logs/*.log` ← shows background npm/node activity at exact time
---
Steps to Reproduce
Steps to Reproduce
# 1. Install Claude
curl -sS https://install.anthropic.com/code | sh
# 2. Verify it's installed
which claude # -> ~/.local/bin/claude
claude --version # -> 1.0.112
# 3. Wait a few minutes, then try again
which claude # -> not found
---
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.98
Claude Code Version
1.0.112
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
📎 Supporting Logs
Attached:
fs_usage.log← confirms deletion timestampdtruss_claude.log← shows launch-to-deletion flowopensnoop_launcher.log/opensnoop_share.log← traces I/O ops.npm/_logs/*.log← shows background npm/node activity at exact timewatch-claude.sh- The Script to reproduce and live-monitor the deletion we created . This script
• Installs Claude
• Locks the binary
• Starts monitoring with:
• fs_usage
• dtruss
• opensnoop
• and date-based command -v claude watcher
🙏 Let me know
- Is it an auto-update issue?
- Can I disable the background self-deletion?
Happy to test fixes, betas, or submit more data. Thanks for this excellent tool — hope this helps make it more robust!
[dtruss_claude.log](https://github.com/user-attachments/files/22309440/dtruss_claude.log)
[opensnoop_launcher.log](https://github.com/user-attachments/files/22309438/opensnoop_launcher.log)
[opensnoop_share.log](https://github.com/user-attachments/files/22309439/opensnoop_share.log)
[watch-claude.sh](https://github.com/user-attachments/files/22309443/watch-claude.sh)
19 Comments
Just wanted to +1 this issue – it has happened to me at least two times (OS X, claude installed using
npm -g).Update for anyone following this issue — the problem no longer occurs when installing Claude using the new binary installer released today Sept 15 2025:
✅ New install (working):
curl -fsSL https://claude.ai/install.sh | bash
❌ Old install :
curl -sS https://install.anthropic.com/code | sh
After testing on the same system for several hours, the issue thus far appears to be resolved when using the new install script. Happy to share logs or more details if helpful.
Without any user action or interference on my part, the installed path and version of claude changed unexpectedly. Additionally, I’m now receiving a warning about multiple installations when running /doctor.
Earlier – September 09, 2025 at 03:32 PM
which claude/Users/[username]/.local/bin/claude
claude --version1.0.115 (Claude Code)
Now – September 09, 2025 at 11:49 PM
which claude/opt/homebrew/bin/claude
claude --version1.0.117 (Claude Code)
Current Behavior : When I run /doctor, I get the following warning:
Warning: Multiple installations found└ npm-global at /opt/homebrew/bin/claude
└ native at /Users/[username]/.local/share/claude
Notes
Experiencing similar issues with npm global installation on macOS (Apple Silicon). This has now happened 3 times in the past week.
System Info
npm install -g @anthropic-ai/claude-codeSymptoms
After successful installation, the
claudecommand breaks between sessions. Runningwhich claudereturnsclaude not found.Root Cause
Investigation shows:
/Users/[username]/.nvm/versions/node/v22.18.0/bin/:``
bash
``lrwxr-xr-x .claude-SU8Nu63Y -> ../lib/node_modules/@anthropic-ai/claude-code/cli.js
cli.jsdoesn't exist)/Users/[username]/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/exists but is incomplete/corruptedErrors During Reinstall Attempts
Workaround That Works
This fixes it temporarily, but the issue recurs after laptop goes to sleep overnight with the CLI open and also with opening up a terminal session the next day and attempting to run
claudeQuestion
Similar to @apathi's question: Is this related to an auto-updater that's silently failing and leaving the installation in a corrupted state? The
ENOTEMPTYerrors suggest npm's atomic operations are failing mid-update.I'm using the native version of Claude on Windows, and I’ve encountered a strange behavior. When I run claude.exe, it creates a copy of itself in the same folder—but this copy is a zero-byte file also named claude.exe.
I’ve tried reinstalling the app using both npm and the Windows-native installer, but the result is the same: during installation, a zero-byte claude.exe gets downloaded or created. To troubleshoot, I restored a backup of the working claude.exe into the same folder. When I ran it, I noticed through File Explorer that the app tries to rename itself and again creates a zero-byte file.
Here’s where it gets more interesting: I renamed my backup to claude2.exe and ran that instead. This time, it still created a zero-byte claude.exe in the same folder, but it didn’t try to rename or overwrite claude2.exe.
Questions:
Is this self-copying and creation of a zero-byte claude.exe file an intentional behavior from Anthropic?
Or is this a bug in the native app?
Temporary Workaround:
If you're using the native version and run into this issue, you can retrieve a working .exe from a previous version by navigating to:
C:\Users\<your-username>\.local\share\claude\versions
Look for a version folder that contains a valid (non-zero-byte) .exe file. Copy it, rename it (e.g., claude2.exe), and run that instead.
Update: Issue Reproduced
The silent deletion issue occurred again - Claude Code disappeared from my system through what appears to be a background process, prompting me to reinstall.
This time I reinstalled using the new Homebrew installation method (Claude Code ~2.0.x).
When reinstalling Claude Code via Homebrew, there is a conflict between two update mechanisms :
~/.local/bin/claude/opt/homebrew/Caskroom/(or/usr/local/)Not sure iff this is was causing the silent deletion issue.
Issue : Disabling the Auto-Updater
When re-installing claude code the official method provided by claude code installer is broken:
⚠️ This command just opens Claude instead of setting the configuration.
The alternative solution provided works:
i.e add this environment variable to your shell config:
~/.zshrc(default shell)~/.bashrc(default shell)````bash
For macOS (zsh)
echo -e "\n# Disable Claude Code auto-updater (managed by Homebrew)\nexport DISABLE_AUTOUPDATER=1" >> ~/.zshrc
source ~/.zshrc
This is still happening to me on MacOS as well. Switching to homebrew install to see if that is more stable.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I am experiencing this issue today after using the up to date recommended installation instructions. Do not automatically close this issue.
This has just happened to me - I had the npm version in a Github Codespace... Gemini still there, Claude gone...
@wormholecowboy did that solve it? It is so random - days and days with this repo instance and months and I have never seen something so unexpected... So when you reinstall you lose all your conversations???
Yeah, seems to have solved it. I have not had the problem since. Not sure
on conversations, but I would just backup that folder and migrate
afterwards.
On Sat, Jan 10, 2026 at 3:14 PM David Kovach @.***>
wrote:
This just happened to me; Claude was working fine for months and then one day up and deleted itself. (Since it wasn't immediately after install my issue may be better described by #2357 or #9327, but those have been locked for some reason.)
Woke up today... "zsh: command not found: claude"
I had to run to fix: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
Happened again to me. It's the third time in a month
https://code.claude.com/docs/en/setup#native-binary-installation-beta
This just happened to me after I ran out of tokens. FYI.
Just wanted to +1 this happens to me too. Not sure why
and yet
Update
Was able to get back into a happy state by
This then informed me there is a new way to install claude natively via
claude installAfter that I got instructions to update my path to include the location of native install
And now I get
Also removed the npm package once more
FYI, I use Cursor agent fixed my similar problem, here is it's conclusion: