claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] claude outputs a bun warning

Open sarimarton-ofsz opened this issue 3 months ago • 9 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.103
  • Operating System: macOS 15.6.1
  • Terminal: Terminal App

Bug Description

I get a bun warning when executing claude.

Steps to Reproduce

  1. Execute claude -v

Expected Behavior

It shows its version

Actual Behavior

It shows

$ claude -v
warn: CPU lacks AVX support, strange crashes may occur. Reinstall Bun or use *-baseline build:
  https://github.com/oven-sh/bun/releases/download/bun-v1.2.19/bun-darwin-x64-baseline.zip
1.0.103 (Claude Code)

Additional Context

Image

Also: This is an M4 Macbook Pro.

sarimarton-ofsz avatar Sep 04 '25 03:09 sarimarton-ofsz

this warning only occurs on x86_64 builds of Bun (of which claude is a single-file-executable of) and so if you are on an M4 mac (which is arm64) you may have somehow installed the wrong claude binary and are running it through Rosetta emulation instead of natively.

nektro avatar Sep 04 '25 21:09 nektro

I managed to fix it by re-installing it with the recommended steps, but the problem keeps creeping back on auto-update.

sarimarton-ofsz avatar Sep 06 '25 19:09 sarimarton-ofsz

I have the same experience, I've directly installed bun (https://github.com/oven-sh/bun/releases/download/bun-v1.2.19/bun-darwin-x64-baseline.zip) and I've used homebrew to install bun, and I still get this warning when starting, and also get frequent crashes with Abort() printing repeatedly from bun. M4 Max MacBook Pro with latest macOS.

Note I install the 'native' version of Claude Code because my team switches node versions with NVM frequently, I feel this is a factor?

rbonestell avatar Sep 15 '25 23:09 rbonestell

Still seeing this on M2 Max with Claude Code 2.0.14 after auto-update.

I fixed my system Bun installation to use the native ARM64 version and that works fine now, but Claude Code still shows the warning because it's bundling its own x86_64 version of Bun:

$ file ~/.local/bin/claude /Users/finbar.day/.local/bin/claude: Mach-O 64-bit executable x86_64

$ claude --version 2.0.14 (Claude Code) warn: CPU lacks AVX support, strange crashes may occur. Reinstall Bun or use *-baseline build: https://github.com/oven-sh/bun/releases/download/bun-v1.2.23/bun-darwin-x64-baseline.zip

Tried uninstalling and reinstalling with curl -fsSL https://claude.ai/install.sh | bash but it still pulls down the x86_64 version. The installer doesn't seem to be detecting Apple Silicon correctly.

daydone avatar Oct 14 '25 17:10 daydone

Same problem here, with the native version of Claude

georgehossa avatar Oct 20 '25 17:10 georgehossa

Tried uninstalling and reinstalling with curl -fsSL https://claude.ai/install.sh | bash but it still pulls down the x86_64 version. The installer doesn't seem to be detecting Apple Silicon correctly.

I am having the same issue on M2 ☝️

StevenMasini avatar Oct 21 '25 07:10 StevenMasini

FYI on my MacBookPro M3 I have removed the warning by :

  • removing claude bin from my path rm ~/.local/bin/claude
  • installing it via Brew (arm build) : brew install --cask claude-code

bertrandjamin avatar Oct 23 '25 06:10 bertrandjamin

GitHub Issue Comment for anthropics/claude-code#7107

Root Cause & Permanent Fix for Bun AVX Warning

I experienced this same issue and discovered the root cause: the Bun AVX warning occurs when you have Intel Homebrew (/usr/local) instead of ARM64 Homebrew (/opt/homebrew) on Apple Silicon.

The Problem

When Intel Homebrew is installed on M1/M2/M3/M4 Macs, ALL CLI tools (including Claude Code) run through Rosetta 2 emulation, triggering Bun's AVX detection warning.

Quick Check (15 seconds)

# 1. Verify you have Apple Silicon
sysctl -n machdep.cpu.brand_string
# Should show: Apple M1/M2/M3/M4

# 2. Check Homebrew location
which brew
# ❌ /usr/local/bin/brew = Intel (causes AVX warning)
# ✅ /opt/homebrew/bin/brew = ARM64 (correct)

# 3. Verify binary architecture
file $(which brew)
# ❌ x86_64 = Running via Rosetta → AVX warning
# ✅ arm64 = Native ARM64 → No warning

Permanent Solution

After migrating my entire development environment (146 packages), I created a comprehensive migration tool:

Repository: https://github.com/joaquimscosta/homebrew-arm64-migration

What it does:

  • Complete Intel → ARM64 Homebrew migration
  • Fixes Claude Code Bun AVX warnings permanently
  • 11-phase installation with safety checks
  • Cleanup scripts for remnants
  • Full migration documentation

Quick Start:

curl -fsSL https://raw.githubusercontent.com/joaquimscosta/homebrew-arm64-migration/main/install-homebrew-arm64.sh -o install-homebrew-arm64.sh
chmod +x install-homebrew-arm64.sh
./install-homebrew-arm64.sh --dry-run  # Preview first

Results

After migration:

  • ✅ Claude Code: No more Bun AVX warnings
  • ✅ All tools: Native ARM64
  • ✅ Performance: 20-30% improvement across all CLI operations

Impact

This issue affects anyone who:

  • Migrated from Intel Mac using Time Machine/Migration Assistant
  • Installed Homebrew early in the Apple Silicon transition
  • Followed older installation guides

The migration tool ensures you get native ARM64 binaries for all your development tools, eliminating the AVX warning and significantly improving performance.

joaquimscosta avatar Nov 07 '25 03:11 joaquimscosta

What about if you want to go backwards? Our whole team decided to emulate Intel because our production boxes are Intel boxes and we want to develop in the same environment. So I discovered my brew is Intel (which is correct per my team). What else would I have to check to make sure they are Intel as well?

✗ sysctl -n machdep.cpu.brand_string
Apple M2 Max
✗ which brew
/usr/local/bin/brew
✗ file $(which brew)
/usr/local/bin/brew: Bourne-Again shell script text executable, ASCII text
✗ which claude
/usr/local/bin/claude
✗ which bun
/Users/tim.kindberg/.bun/bin/bun

timkindberg avatar Dec 11 '25 18:12 timkindberg

@joaquimscosta thank you very much for the insights and scripts!

ariloudev avatar Dec 15 '25 23:12 ariloudev