Claude Code Architecture Mismatch on Apple Silicon Macs

Resolved 💬 21 comments Opened Jul 30, 2025 by chatgpt-copypasta Closed Apr 26, 2026

ISSUE

Claude Code's execution environment runs under Rosetta 2 (x86_64 emulation) on Apple Silicon Macs, causing architecture detection mismatches between the user's native ARM64 environment and Claude's x86_64 environment. This leads to incorrect build configurations, wrong library paths, and compilation failures when Claude executes commands on behalf of users.

EXPECTED BEHAVIOR

Claude Code should run natively as ARM64 on Apple Silicon Macs, matching the user's architecture and ensuring consistent behavior across all executed commands.

STEPS TO REPRODUCE

Environment:

  • macOS 15.5 (Sequoia)
  • Apple M4 MacBook Pro (14 CPU cores, 24GB RAM)
  • Claude Code CLI (latest version)
  • Native ARM64 terminal environment

Demonstration of Architecture Mismatch:

User's Terminal (Native ARM64):

$ uname -m
arm64

$ arch
arm64

$ sysctl -n hw.optional.arm64
1

$ sysctl -n sysctl.proc_translated
0

Claude Code's Execution Environment (Rosetta x86_64):

# When Claude executes the same commands
$ uname -m
x86_64

$ arch
i386

$ sysctl -n hw.optional.arm64
1

$ sysctl -n sysctl.proc_translated
1

IMPACT AND CONSEQUENCES

  1. Build System Detection Issues

When building LLVM with CMake, the architecture mismatch causes incorrect host triple detection:

What Claude sees:

-DLLVM_HOST_TRIPLE=x86_64-apple-darwin24.5.0

What should be detected:

-DLLVM_HOST_TRIPLE=arm64-apple-darwin24.5.0
  1. Library Path Contamination

The x86_64 environment causes build tools to find Intel libraries instead of ARM64 ones:

# Claude's environment finds x86_64 libraries
-I/usr/local/opt/gmp/include -I/usr/local/Cellar/isl/0.27/include

# Should find ARM64 libraries
-I/opt/homebrew/include

Resulting build errors:

ld: warning: ignoring file '/usr/local/lib/libzstd.dylib': found architecture 'x86_64', required architecture 'arm64'
  1. Compiler Runtime Build Failures

The architecture mismatch causes compiler-rt configuration to fail:

CMake Error at /path/to/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:399 (string):
  string sub-command REPLACE requires at least four arguments.

VERIFICATION

The issue can be verified by checking process translation status:

# Check if running under Rosetta
if [[ $(sysctl -n sysctl.proc_translated 2>/dev/null) == "1" ]]; then
    echo "Running under Rosetta 2 (x86_64 emulation)"
else
    echo "Running natively"
fi

WORKAROUNDS

  1. Force ARM64 Execution in Scripts

Add architecture detection to build scripts:

#!/usr/bin/env bash
# Force ARM64 execution if we're running under Rosetta
if [[ $(arch) == "i386" ]] && [[ $(uname -m) == "arm64" ]]; then
    echo "🔄 Re-launching under native ARM64 (currently in Rosetta mode)..."
    exec arch -arm64 "$0" "$@"
fi
  1. Explicit Architecture Commands

Prefix commands with arch -arm64:

arch -arm64 cmake ...
arch -arm64 ninja ...
  1. Environment Variable Overrides

Force correct paths and architectures:

export CMAKE_OSX_ARCHITECTURES=arm64
export LIBRARY_PATH="/opt/homebrew/lib:${LIBRARY_PATH:-}"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export CMAKE_IGNORE_PATH="/usr/local;/usr/local/lib;/usr/local/include"

SYSTEM INFORMATION

macOS: 15.6 (24A335)
Xcode: 16.4
Command Line Tools: 16.0.0.0.1.1725547130
Homebrew: 4.4.10 (ARM64 at /opt/homebrew)

EXPECTED RESOLUTION

Claude Code's backend infrastructure should:

  1. Detect Apple Silicon hardware and run natively as ARM64
  2. Not require Rosetta 2 emulation on ARM64 Macs
  3. Match the user's architecture when executing commands
  4. Properly detect and use ARM64 Homebrew paths (/opt/homebrew)

ADDITIONAL CONTEXT

This issue affects any build process that relies on architecture detection, including:

  • LLVM/Clang builds
  • Firefox compilation
  • Any CMake-based project
  • Projects using pkg-config
  • Homebrew package installations

The architecture mismatch is particularly problematic for users building performance-critical software that needs to take advantage of Apple Silicon optimizations (M1, M2, M3, M4 specific features).

View original on GitHub ↗

21 Comments

Helmi · 11 months ago

Can't confirm this as a Claude Code issue. macOS 15.5, MacBook Pro M1 Max. You sure it's not your node build or something that forces Claude Code into x86 architecture?

> can you run uname -m for me please?

✻ Thinking…

  The user is asking me to run the uname -m command, which displays the machine hardware architecture. This is a
  simple system information command.

⏺ Bash(uname -m)
  ⎿  arm64

✻ Thinking…

  The user's machine is running on ARM64 architecture, which is common for Apple Silicon Macs.
moofone · 11 months ago

No issue here.

M4 MBP
15.5 (24F74)

⏺ Bash(uname -m)
⎿  arm64

github-actions[bot] · 7 months ago

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.

patrickswirl · 7 months ago

I'm having this issue too.

I have a feeling it's because I used Time Machine to data from my old Intel Mac onto my new M4 Pro.

Does anybody have any solution to this?

ratpH1nk · 7 months ago

This happened to me recently as well.
uname -m
arm64

andrew-blake · 6 months ago

My ticket https://github.com/anthropics/claude-code/issues/15571 has a workaround @patrickswirl

andrew-blake · 6 months ago

Not sure if it's relevant, but I have an old migrated homebrew setup that uses Rosetta.
I've replaced the homebrew version of node with one installed from nvm and now the installer seems to work correctly.

guybedo · 6 months ago

i have the same issue.
Using ITerm2, shell is running in arm64 mode but installer installs claude x86_64.
I had claude "fix" itself. it explicitly downloaded the arm64 version and installed if

makash · 5 months ago

Faced this issue overnight.

Claude code updated and won't start.

leodioshi · 5 months ago

Same. I have manually downloaded arm64 again and blocked the auto updated in settings.json since this is not fixed yet

"alwaysThinkingEnabled": false,
"env": {
"DISABLE_AUTOUPDATER": "1"
}

ratpH1nk · 5 months ago

Hey all! I fixed this issue on my production laptop that was migrated from an i7 to Apple silicon. What I did was just nuke my old x86 brew installation and make sure all the aliases were correct to the new directory. Thankfully I did not have any reason to keep the old installation.

MizukiSonoko · 5 months ago

Hello
sorry not fixed on my laptop.
I faced same issue yet...

case 1) try with arch -arm64

% curl -fsSL https://claude.ai/install.sh |  arch -arm64 /bin/bash
Setting up Claude Code...

✔ Claude Code successfully installed!

  Version: 2.1.15

  Location: ~/.local/bin/claude


  Next: Run claude --help to get started

✅ Installation complete!

 % file "$(which claude)"
<HOME>/.local/bin/claude: Mach-O 64-bit executable x86_64

case 2) add code to install.sh as follows and run

echo "proc arch: $(arch)"
echo "uname -m: $(uname -m)"
sysctl -n sysctl.proc_translated 2>/dev/null || true

result is

% arch -arm64 /bin/bash install.sh
proc arch: arm64
uname -m: arm64
0
<HOME>/.claude/downloads/claude-2.1.15-darwin-arm64

Setting up Claude Code...

#!/bin/bash
✔ Claude Code successfully installed!

  Version: 2.1.15

  Location: ~/.local/bin/claude


  Next: Run claude --help to get started

✅ Installation complete!

% claude
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.3.6/bun-darwin-x64-baseline.zip
error: Invalid DNS result order.
% file $(which claude)
<HOME>/.local/bin/claude: Mach-O 64-bit executable x86_64

Note

terminal: Ghostty v1.2.3
CPU: Apple M3 Max
macOS: 15.6

leodioshi · 5 months ago
Hey all! I fixed this issue on my production laptop that was migrated from an i7 to Apple silicon. What I did was just nuke my old x86 brew installation and make sure all the aliases were correct to the new directory. Thankfully I did not have any reason to keep the old installation.

This i can confirm. I did that also after i blocked the autoupdate. It seems to be stable. When i transfered from my I5 it must have carried over brew in x86. When that is removed and arch64 brew is installed then claude also stays correctly on arch.

mwender · 5 months ago

Following up on what @ratpH1nk and @leodioshi report with detailed steps on the issue all three of us experienced and how to fix:

This may be an environment issue, not a Claude Code bug

I experienced the exact same symptoms (ARM64 binary's install command creating x86_64 launcher), but after thorough debugging, it turned out to be my system configuration, not Claude Code.

Root Cause: Migrated Intel Homebrew Installation

If you migrated from an Intel Mac to Apple Silicon, you may have remnants of your old Intel Homebrew installation running under Rosetta 2, which causes everything downstream to default to x86_64.

How to Diagnose

1. Check if you're actually running ARM natively:

uname -m  # Should return: arm64

2. Check your Homebrew installation:

brew config | grep -E "(PREFIX|CPU|Rosetta)"

Bad output (Intel Homebrew under Rosetta):

HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit westmere    # ← Intel architecture!
Rosetta 2: true                   # ← Running under emulation!

Good output (ARM Homebrew):

HOMEBREW_PREFIX: /opt/homebrew
CPU: octa-core 64-bit arm_ibiza   # ← Native ARM!
Rosetta 2: false                  # ← Not emulated!

3. Check your bash (and other tools):

which bash
file $(which bash)  # Should show: arm64, not x86_64

The Fix

If you have Intel Homebrew running under Rosetta:

1. Install ARM64 Homebrew (installs to /opt/homebrew):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Update your shell profile (~/.bash_profile or ~/.zshrc) to prioritize ARM Homebrew:

Add this at the very top, before any other PATH modifications:

# ARM64 Homebrew - MUST BE FIRST
eval "$(/opt/homebrew/bin/brew shellenv)"

3. Fix any hardcoded /usr/local references in your shell profile:

Change:

export PATH="/usr/local/sbin:$PATH"

To:

export PATH="$(brew --prefix)/sbin:$PATH"

4. Check for x86_64 symlinks in ~/bin/:

ls -la ~/bin/
file ~/bin/*

Remove any x86_64 binaries or symlinks pointing to /usr/local:

rm ~/bin/bash  # If it's a symlink to /usr/local/opt/bash

5. Reload your shell:

source ~/.bash_profile  # or source ~/.zshrc

6. Verify everything is ARM:

uname -m                          # arm64
which brew                        # /opt/homebrew/bin/brew
brew config | grep Rosetta        # Rosetta 2: false
which bash && file $(which bash)  # arm64

7. Reinstall Claude Code:

rm ~/.local/bin/claude
curl -fsSL https://claude.ai/install.sh | bash
file ~/.local/bin/claude  # Should now be: arm64
claude --help             # No AVX warnings!

My Environment (After Fix)

  • Device: MacBook Pro M3 (migrated from Intel Mac ~10 years ago)
  • Issue: Had Intel Homebrew from 2017 still installed and running under Rosetta
  • Fix: Installed ARM Homebrew, updated PATH, removed x86_64 bash symlink
  • Result: Claude Code installer now works correctly, installs ARM64 binary with no AVX warnings

For Issue Reporters

Before reporting this as a Claude Code bug, please verify:

  1. uname -m returns arm64
  2. brew config shows ARM Homebrew at /opt/homebrew with Rosetta 2: false
  3. ✅ Your shell and common tools (bash, node, etc.) are ARM64, not x86_64
  4. ✅ Your PATH prioritizes /opt/homebrew/bin over /usr/local/bin

If any of these checks fail, it's likely an environment issue rather than a Claude Code bug.

Additional Resources

Hope this helps others who migrated from Intel Macs! 🍺

ratpH1nk · 5 months ago

Yes, for sure this is an environment problem.

On Fri, Jan 23, 2026 at 15:54 Michael Wender @.***>
wrote:

mwender left a comment (anthropics/claude-code#4749) <https://github.com/anthropics/claude-code/issues/4749#issuecomment-3792386761> This may be an environment issue, not a Claude Code bug I experienced the exact same symptoms (ARM64 binary's install command creating x86_64 launcher), but after thorough debugging, it turned out to be my system configuration, not Claude Code. Root Cause: Migrated Intel Homebrew Installation If you migrated from an Intel Mac to Apple Silicon, you may have remnants of your old Intel Homebrew installation running under Rosetta 2, which causes everything downstream to default to x86_64. How to Diagnose 1. Check if you're actually running ARM natively: uname -m # Should return: arm64 2. Check your Homebrew installation: brew config | grep -E "(PREFIX|CPU|Rosetta)" Bad output (Intel Homebrew under Rosetta): HOMEBREW_PREFIX: /usr/local CPU: octa-core 64-bit westmere # ← Intel architecture! Rosetta 2: true # ← Running under emulation! Good output (ARM Homebrew): HOMEBREW_PREFIX: /opt/homebrew CPU: octa-core 64-bit arm_ibiza # ← Native ARM! Rosetta 2: false # ← Not emulated! 3. Check your bash (and other tools): which bash file $(which bash) # Should show: arm64, not x86_64 The Fix If you have Intel Homebrew running under Rosetta: 1. Install ARM64 Homebrew (installs to /opt/homebrew): /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. Update your shell profile (~/.bash_profile or ~/.zshrc) to prioritize ARM Homebrew: Add this at the very top, before any other PATH modifications: # ARM64 Homebrew - MUST BE FIRSTeval "$(/opt/homebrew/bin/brew shellenv)" 3. Fix any hardcoded /usr/local references in your shell profile: Change: export PATH="/usr/local/sbin:$PATH" To: export PATH="$(brew --prefix)/sbin:$PATH" 4. Check for x86_64 symlinks in ~/bin/: ls -la ~/bin/ file ~/bin/ Remove any x86_64 binaries or symlinks pointing to /usr/local: rm ~/bin/bash # If it's a symlink to /usr/local/opt/bash 5. Reload your shell: source ~/.bash_profile # or source ~/.zshrc 6. Verify everything is ARM: uname -m # arm64 which brew # /opt/homebrew/bin/brew brew config | grep Rosetta # Rosetta 2: false which bash && file $(which bash) # arm64 7. Reinstall Claude Code: rm ~/.local/bin/claude curl -fsSL https://claude.ai/install.sh | bash file ~/.local/bin/claude # Should now be: arm64 claude --help # No AVX warnings! My Environment (After Fix) - Device: MacBook Pro M3 (migrated from Intel Mac ~10 years ago) - Issue: Had Intel Homebrew from 2017 still installed and running under Rosetta - Fix: Installed ARM Homebrew, updated PATH, removed x86_64 bash symlink - Result: Claude Code installer now works correctly, installs ARM64 binary with no AVX warnings For Issue Reporters Before reporting this as a Claude Code bug, please verify: 1. ✅ uname -m returns arm64 2. ✅ brew config shows ARM Homebrew at /opt/homebrew with Rosetta 2: false 3. ✅ Your shell and common tools (bash, node, etc.) are ARM64, not x86_64 4. ✅ Your PATH prioritizes /opt/homebrew/bin over /usr/local/bin If any of these checks fail, it's likely an environment issue rather than a Claude Code bug. Additional Resources - Homebrew on Apple Silicon <https://docs.brew.sh/Installation#macos-requirements> - Check for migrated Intel setups: ls -la /usr/local/bin/brew Hope this helps others who migrated from Intel Macs! 🍺 — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/4749#issuecomment-3792386761>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJIHKDGS7X5P4SEQWILHI34IKDAXAVCNFSM6AAAAACCVVGDEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOJSGM4DMNZWGE> . You are receiving this because you commented.Message ID: @.**>
davidalee · 5 months ago
file ~/.local/bin/claude

This is my terminal output when running the verification commands:

arm64
/opt/homebrew/bin/brew
Rosetta 2: false
/opt/homebrew/bin/bash
/opt/homebrew/bin/bash: Mach-O 64-bit executable arm64

I did all these things but still end up with x86_64 claude.

davidalee · 5 months ago
Following up on what @ratpH1nk and @leodioshi report with detailed steps on the issue all three of us experienced and how to fix: ## This may be an environment issue, not a Claude Code bug I experienced the exact same symptoms (ARM64 binary's install command creating x86_64 launcher), but after thorough debugging, it turned out to be my system configuration, not Claude Code. ### Root Cause: Migrated Intel Homebrew Installation If you migrated from an Intel Mac to Apple Silicon, you may have remnants of your old Intel Homebrew installation running under Rosetta 2, which causes everything downstream to default to x86_64. ### How to Diagnose 1. Check if you're actually running ARM natively: uname -m # Should return: arm64 2. Check your Homebrew installation: brew config | grep -E "(PREFIX|CPU|Rosetta)" Bad output (Intel Homebrew under Rosetta): `` HOMEBREW_PREFIX: /usr/local CPU: octa-core 64-bit westmere # ← Intel architecture! Rosetta 2: true # ← Running under emulation! ` **Good output (ARM Homebrew):** ` HOMEBREW_PREFIX: /opt/homebrew CPU: octa-core 64-bit arm_ibiza # ← Native ARM! Rosetta 2: false # ← Not emulated! ` **3. Check your bash (and other tools):** which bash file $(which bash) # Should show: arm64, not x86_64 ### The Fix If you have Intel Homebrew running under Rosetta: **1. Install ARM64 Homebrew** (installs to /opt/homebrew): /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" **2. Update your shell profile** (~/.bash_profile or ~/.zshrc) to prioritize ARM Homebrew: Add this **at the very top**, before any other PATH modifications: # ARM64 Homebrew - MUST BE FIRST eval "$(/opt/homebrew/bin/brew shellenv)" **3. Fix any hardcoded /usr/local references** in your shell profile: Change: export PATH="/usr/local/sbin:$PATH" To: export PATH="$(brew --prefix)/sbin:$PATH" **4. Check for x86_64 symlinks in ~/bin/:** ls -la ~/bin/ file ~/bin/* Remove any x86_64 binaries or symlinks pointing to /usr/local: rm ~/bin/bash # If it's a symlink to /usr/local/opt/bash **5. Reload your shell:** source ~/.bash_profile # or source ~/.zshrc **6. Verify everything is ARM:** uname -m # arm64 which brew # /opt/homebrew/bin/brew brew config | grep Rosetta # Rosetta 2: false which bash && file $(which bash) # arm64 **7. Reinstall Claude Code:** rm ~/.local/bin/claude curl -fsSL https://claude.ai/install.sh | bash file ~/.local/bin/claude # Should now be: arm64 claude --help # No AVX warnings! ### My Environment (After Fix) * **Device**: MacBook Pro M3 (migrated from Intel Mac ~10 years ago) * **Issue**: Had Intel Homebrew from 2017 still installed and running under Rosetta * **Fix**: Installed ARM Homebrew, updated PATH, removed x86_64 bash symlink * **Result**: Claude Code installer now works correctly, installs ARM64 binary with no AVX warnings ### For Issue Reporters Before reporting this as a Claude Code bug, please verify: 1. ✅ uname -m returns arm64 2. ✅ brew config shows ARM Homebrew at /opt/homebrew with Rosetta 2: false 3. ✅ Your shell and common tools (bash, node, etc.) are ARM64, not x86_64 4. ✅ Your PATH prioritizes /opt/homebrew/bin over /usr/local/bin If any of these checks fail, it's likely an environment issue rather than a Claude Code bug. ### Additional Resources * [Homebrew on Apple Silicon](https://docs.brew.sh/Installation#macos-requirements) * Check for migrated Intel setups: ls -la /usr/local/bin/brew` Hope this helps others who migrated from Intel Macs! 🍺

When I do this I still get x86_64 claude.

This is my terminal output when running the verification commands:

uname -m
which brew
brew config | grep Rosetta
which bash && file $(which bash)

And the terminal output:

arm64
/opt/homebrew/bin/brew
Rosetta 2: false
/opt/homebrew/bin/bash
/opt/homebrew/bin/bash: Mach-O 64-bit executable arm64

-edit-

Installing via homebrew works and gives me the correct arm64 version. But this is less than ideal as Claude will no longer be automatically updated.

piekstra · 4 months ago

Clean reinstall fix (when removing x86 Homebrew isn't enough)

@mwender's writeup above covers the root cause well — migrated Intel Homebrew at /usr/local causes Rosetta inheritance. But there's an important edge case: even after removing x86 Homebrew, the installer can still produce an x86_64 binary if any previous Claude installation state exists.

Why

When the installer detects an existing Claude installation, it runs Claude's built-in install subcommand to self-update rather than doing a fresh download. If the existing binary is x86_64, that subcommand runs under Rosetta and downloads x86_64 again — a self-perpetuating cycle. You can verify this: arch -arm64 curl ... install.sh | sh still produces x86_64 because the install script hands off to the old binary.

The fix

Delete all existing Claude state first, then run a fresh install from a native arm64 shell:

rm -rf ~/.local/share/claude ~/.local/bin/claude ~/.claude/downloads
curl -fsSL https://claude.ai/install.sh | sh

Then verify:

file "$(which claude)"
# Should show: Mach-O 64-bit executable arm64

For @MizukiSonoko's case

Your case 2 shows the installer correctly detecting arm64 and downloading claude-2.1.15-darwin-arm64, but the final binary is still x86_64. This is exactly the self-update subcommand bug — the downloaded arm64 binary hands off to an existing x86_64 install subcommand which re-downloads x86_64. The rm -rf step above breaks this cycle.

Summary

The full fix for migrated Intel Macs is:

  1. Remove x86 Homebrew (or at minimum ensure /opt/homebrew/bin is first in PATH)
  2. Delete existing Claude state: rm -rf ~/.local/share/claude ~/.local/bin/claude ~/.claude/downloads
  3. Fresh install: curl -fsSL https://claude.ai/install.sh | sh
  4. Verify: file "$(which claude)" → arm64
jacquelinehallaq · 3 months ago

I transitioned from a macbook intel to Macbook M5. Now my Cowork is not working. After running multiple commands - no luck. This is my most recent findings:
"Cowork is hardcoded to use /usr/bin/bash which does not exist on my M5 Mac. The real bash is at /bin/bash. macOS SIP prevents creating a symlink to fix it. This needs to be patched in the Cowork app."

github-actions[bot] · 2 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.