[Bug] Auto-update reports success with non-functional stub binary after postinstall link failure
Bug Description
Auto-update reports success while leaving a non-functional stub at bin/claude.exe
Environment
- Claude Code 2.1.222 → 2.1.228 (auto-update, path: npm-global)
- macOS Darwin 25.5.0, arm64
- node v22.23.1, npm 12.0.2
- Global root: ~/.local/lib/node_modules
- npm config get ignore-scripts → false; no omit in ~/.npmrc
What happened
Auto-update ran unattended and recorded success:
// ~/.claude/.last-update-result.json
{"timestamp":"2026-08-12T01:39:53.609Z","path":"npm-global","outcome":"success",
"status":"success","version_from":"2.1.222","version_to":"2.1.228","error_code":null}
The next claude invocation failed with:
Error: claude native binary not installed.
Either postinstall did not run (--ignore-scripts, some pnpm configs)
or the platform-native optional dependency was not downloaded (--omit=optional).
Both causes named in that message were false on this machine. ignore-scripts was false, and the platform dependency was downloaded correctly:
node_modules/@anthropic-ai/claude-code-darwin-arm64/claude 289298144 bytes ✅ Mach-O arm64
bin/claude.exe 500 bytes ❌ ASCII text
bin/claude.exe was a shell script that only prints the error above. ~/.local/bin/claude symlinks to it, so the CLI was unusable. The real binary sat one directory away, fully downloaded, correct version.
Root cause: postinstall's final link step (native package → bin/) did not run or silently failed, and the stub was left in place. The updater recorded outcome: success, error_code: null regardless.
Fix that worked
node ~/.local/lib/node_modules/@anthropic-ai/claude-code/install.cjs
bin/claude.exe became a hardlink to the real binary (link count 2, Mach-O arm64) and claude --version → 2.1.228 (Claude Code).
Two separate issues
- Postinstall leaves a stub instead of linking a binary that is already present locally.
- The updater cannot detect this. It reports success without verifying the resulting bin/ entry is executable — so the failure surfaces later, with a diagnostic pointing at two conditions that do not apply. A post-update check (file size, file type, or --version) would have caught it at 10:39 instead of at next use.
Environment Info
- Platform: darwin
- Terminal: Orca
- Version: 2.1.227
- Feedback ID: dcfb9221-aa47-46eb-ad17-69abd91db32d
Errors
[]This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗