[Bug] Auto-updater in-place binary overwrite causes SIGKILL on subsequent launches (macOS)
_Drafted by Claude Code itself during a live debugging session. I (the OP) reviewed and approved the wording before filing. The main use case is VS Code terminal and/or Cursor._
---
Bug Description
Auto-update overwrites the binary in place; every new launch then dies with Killed: 9 (macOS)
Install: npm global (/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/), Apple Silicon, Darwin 23.5.0.
Seen twice: 2026-08-21, and 2026-09-28 on the 2.1.283 -> 2.1.284 update.
Symptom: after the auto-updater runs while a session is open, every new claude exits immediately with Killed: 9 (exit 137). There is no crash report. The session that ran the update keeps working.
Evidence (2026-09-28):
bin/claude.exemtimematches the timestamp in.last-update-result.jsonto the second.- A byte-identical cp of
claude.exein the same directory (same SHA-256) runs fine and prints 2.1.284. mv-ing that copy overclaude.exefixes it with no reboot.- First time (2026-08-21): quitting every claude process did not fix it; a reboot did. Second time (2026-09-28): replacing the binary as above fixed it without a reboot.
- Ruled out: memory pressure, code signing (
codesign --verify --deep --strictandspctlboth pass), and antivirus.
Likely cause: the updater rewrites claude.exe in place while a running process has it memory-mapped, so macOS's cached code-signing state for that inode goes stale and every new exec is killed.
Suggested fix: write the new binary to a temp file in the same directory and rename() it over the old one, so each update gets a fresh inode.
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.284
- Feedback ID: 2e79a919-3475-49ad-ad54-13d9333832e0
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗