Post

Replies

Boosts

Views

Activity

Reply to Xcode 26.3 Claude Agent — 401 Invalid Bearer Token on Intel Mac (FB22141224)
Update: Root cause identified — Xcode 26.5 downloads darwin-arm64 binary on Intel Macs (verified workaround) Following up on this thread and FB22141224 / FB22317519 (both closed citing a Neural Engine requirement). After further investigation on Xcode 26.5 on the same Intel hardware, I've identified the actual root cause and verified a working local fix. The previously reported 401 and "code signing identity" errors are downstream symptoms of an architecture-mismatch exec failure. The Neural Engine premise does not fit the evidence: Claude Agent calls a remote API and performs no on-device inference; Claude Code in Terminal works on this Intel Mac with the same credentials; the basic Claude Sonnet 4.5 assistant in Xcode also works on this Intel Mac. Only the agent fails — because Xcode downloads the wrong-arch binary for it. SUMMARY On Intel Macs, Xcode 26.5 (build 17F42) downloads the darwin-arm64 build of the Claude Agent rather than the darwin-x64 build the vendor publishes at the same version. The arm64 binary fails to exec on Intel with NSPOSIXErrorDomain Code=86 ("Bad CPU type in executable"). Xcode then misreports this in the UI as "the code signing identity for the agent did not match expectations". EVIDENCE Xcode's own Info.plist on Intel contains a darwin-arm64 URL. File: ~/Library/Developer/Xcode/CodingAssistant/Agents/XcodeVersions/17F42/claude/Info.plist url = .../claude-code-releases/2.1.118/darwin-arm64/claude Xcode wrote this file. No user input affects URL construction. The downloaded binary is arm64-only: $ file .../17F42/claude/claude Mach-O 64-bit executable arm64 Unified log during a cold-start agent launch: ProcessRunWithTimeout: Process failed to launch: error: NSPOSIXErrorDomain Code=86 "Bad CPU type in executable" ProcessSecurity: Signing identity matches = false. Comparing to: com.anthropic.claude-code. The signing-identity check fails because exec failed milliseconds earlier — there is no running process to verify. The user-facing error message misattributes the cause. The previous Xcode 26.3 install on the same Intel Mac downloaded an x86_64 binary, which still works and verifies cleanly: codesign: valid; satisfies Designated Requirement authority: Developer ID Application: Anthropic PBC (Q6L2SF6YDW) spctl: accepted; Notarized Developer ID Manually swapping the parallel darwin-x64 binary into place (same version, with Info.plist checksum and URL updated) makes the Claude Agent work correctly in Xcode 26.5 on Intel. Verified end to end. WORKAROUND (VERIFIED ON INTEL) Quit Xcode, then: curl -fL -o /tmp/claude-x64 https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.118/darwin-x64/claude AGENT_DIR=~/Library/Developer/Xcode/CodingAssistant/Agents/XcodeVersions/17F42/claude chmod u+w "$AGENT_DIR/claude" cp -p /tmp/claude-x64 "$AGENT_DIR/claude" chmod a-w "$AGENT_DIR/claude" NEW=$(shasum -a 512 "$AGENT_DIR/claude" | awk '{print $1}') plutil -replace checksum -string "$NEW" "$AGENT_DIR/Info.plist" plutil -replace url -string "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.118/darwin-x64/claude" "$AGENT_DIR/Info.plist" Adjust 17F42 and 2.1.118 to your Xcode build and agent version. May need re-applying after future Xcode updates. SUGGESTED FIXES Primary: Xcode's agent downloader should select the URL matching the host CPU architecture rather than defaulting to darwin-arm64 on Intel. Anthropic publishes both architectures at parallel URLs differing only in suffix. Secondary: The user-facing error message should be revised when the underlying cause is an exec failure. Misattributing EBADARCH as a code-signing failure has produced significant misdirected debugging. ENVIRONMENT Hardware: MacBook Pro 2019, Intel Core i9 (x86_64) macOS: 26.5 Xcode: 26.5 (17F42) Agent: Claude Code 2.1.118 Account: Claude Pro (claude.ai OAuth) A fresh Feedback Assistant report has been submitted with the forensic evidence above (sysdiagnose not included; can be provided on request). Cross-posted on GitHub as anthropics/claude-code #31231. Requesting that FB22141224 / FB22317519 be revisited in light of the new evidence — the architectural premise of the previous closures does not match what the agent does at runtime.
May ’26
Reply to Xcode 26.3 Claude Agent — 401 Invalid Bearer Token on Intel Mac (FB22141224)
Update: After extensive investigation I have identified what appears to be the root cause of the 401 Invalid Bearer Token error on my Intel Mac, and I want to share the findings in case they help others reporting similar issues on M1 and M4 machines. WHAT I FOUND (Intel Mac - x86_64): The Claude Agent binary that Xcode downloads is the darwin-arm64 build regardless of host architecture. On my Intel Mac this binary physically cannot execute, which fails silently and surfaces as a 401 error. Confirmed via terminal: file ~/Library/Developer/Xcode/CodingAssistant/Agents/claude/2.1.14/claude Returns: Mach-O 64-bit executable arm64 — wrong for Intel Mac The IDEChatClaudeCodeVersion preference is hardcoded to the ARM64 download URL: defaults read com.apple.dt.Xcode IDEChatClaudeCodeVersion Returns: darwin-arm64 URL regardless of CPU architecture We also confirmed the darwin-x64 binary exists in Anthropic's distribution bucket and runs correctly on Intel — both in the terminal and as a standalone binary: curl -fsSL -o /tmp/claude-x64 "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.14/darwin-x64/claude" /tmp/claude-x64 --version Returns: 2.1.14 (Claude Code) — works fine on Intel Claude Code also works perfectly in Terminal on this Intel Mac. The problem is exclusively with the Claude Agent inside Xcode, which downloads and attempts to run the wrong ARM64 binary. However, manually placing the x64 binary in the agent directory fails with: "Failed to initialize Claude Agent: The code signing identity for the agent did not match expectations, or the agent violated sandboxing rules." This means Xcode's code signing verification also rejects the x64 binary, so there is currently no workaround for Intel Mac users wanting to use the Claude Agent inside Xcode. Note: Claude chat in Xcode works perfectly on this Intel Mac — only the Agent and coding intelligence features are broken. This confirms the issue is the binary architecture, not account credentials, plan level, or network connectivity. Clearing all keychain entries, Xcode preferences, and cached credentials had no effect on the 401 error. A bug report has been filed with Anthropic here: https://github.com/anthropics/claude-code/issues/40642 IMPORTANT QUESTION FOR M1/M4 USERS: Since others on this thread are reporting the same 401 error on Apple Silicon machines where the ARM64 binary should work correctly, the architecture mismatch may not be the only cause of this error. Could affected M1/M4 users please run the following in Terminal and post the results: Check the binary architecture: file ~/Library/Developer/Xcode/CodingAssistant/Agents/claude/2.1.14/claude Check whether Claude chat works but agent features do not: Try the coding assistant chat vs inline code fixes and agentic coding features and report which work and which fail. Check your Claude plan: Pro, Max, Team, or Free This will help determine whether there are multiple separate bugs causing the same 401 error on different hardware, or one common root cause affecting everyone. If you are affected please also add a comment to the GitHub issue above with your Mac model and architecture so Anthropic can see the full scope of the problem.
Mar ’26
Reply to Xcode 26.3 Claude Agent — 401 Invalid Bearer Token on Intel Mac (FB22141224)
Update: Root cause identified — Xcode 26.5 downloads darwin-arm64 binary on Intel Macs (verified workaround) Following up on this thread and FB22141224 / FB22317519 (both closed citing a Neural Engine requirement). After further investigation on Xcode 26.5 on the same Intel hardware, I've identified the actual root cause and verified a working local fix. The previously reported 401 and "code signing identity" errors are downstream symptoms of an architecture-mismatch exec failure. The Neural Engine premise does not fit the evidence: Claude Agent calls a remote API and performs no on-device inference; Claude Code in Terminal works on this Intel Mac with the same credentials; the basic Claude Sonnet 4.5 assistant in Xcode also works on this Intel Mac. Only the agent fails — because Xcode downloads the wrong-arch binary for it. SUMMARY On Intel Macs, Xcode 26.5 (build 17F42) downloads the darwin-arm64 build of the Claude Agent rather than the darwin-x64 build the vendor publishes at the same version. The arm64 binary fails to exec on Intel with NSPOSIXErrorDomain Code=86 ("Bad CPU type in executable"). Xcode then misreports this in the UI as "the code signing identity for the agent did not match expectations". EVIDENCE Xcode's own Info.plist on Intel contains a darwin-arm64 URL. File: ~/Library/Developer/Xcode/CodingAssistant/Agents/XcodeVersions/17F42/claude/Info.plist url = .../claude-code-releases/2.1.118/darwin-arm64/claude Xcode wrote this file. No user input affects URL construction. The downloaded binary is arm64-only: $ file .../17F42/claude/claude Mach-O 64-bit executable arm64 Unified log during a cold-start agent launch: ProcessRunWithTimeout: Process failed to launch: error: NSPOSIXErrorDomain Code=86 "Bad CPU type in executable" ProcessSecurity: Signing identity matches = false. Comparing to: com.anthropic.claude-code. The signing-identity check fails because exec failed milliseconds earlier — there is no running process to verify. The user-facing error message misattributes the cause. The previous Xcode 26.3 install on the same Intel Mac downloaded an x86_64 binary, which still works and verifies cleanly: codesign: valid; satisfies Designated Requirement authority: Developer ID Application: Anthropic PBC (Q6L2SF6YDW) spctl: accepted; Notarized Developer ID Manually swapping the parallel darwin-x64 binary into place (same version, with Info.plist checksum and URL updated) makes the Claude Agent work correctly in Xcode 26.5 on Intel. Verified end to end. WORKAROUND (VERIFIED ON INTEL) Quit Xcode, then: curl -fL -o /tmp/claude-x64 https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.118/darwin-x64/claude AGENT_DIR=~/Library/Developer/Xcode/CodingAssistant/Agents/XcodeVersions/17F42/claude chmod u+w "$AGENT_DIR/claude" cp -p /tmp/claude-x64 "$AGENT_DIR/claude" chmod a-w "$AGENT_DIR/claude" NEW=$(shasum -a 512 "$AGENT_DIR/claude" | awk '{print $1}') plutil -replace checksum -string "$NEW" "$AGENT_DIR/Info.plist" plutil -replace url -string "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.118/darwin-x64/claude" "$AGENT_DIR/Info.plist" Adjust 17F42 and 2.1.118 to your Xcode build and agent version. May need re-applying after future Xcode updates. SUGGESTED FIXES Primary: Xcode's agent downloader should select the URL matching the host CPU architecture rather than defaulting to darwin-arm64 on Intel. Anthropic publishes both architectures at parallel URLs differing only in suffix. Secondary: The user-facing error message should be revised when the underlying cause is an exec failure. Misattributing EBADARCH as a code-signing failure has produced significant misdirected debugging. ENVIRONMENT Hardware: MacBook Pro 2019, Intel Core i9 (x86_64) macOS: 26.5 Xcode: 26.5 (17F42) Agent: Claude Code 2.1.118 Account: Claude Pro (claude.ai OAuth) A fresh Feedback Assistant report has been submitted with the forensic evidence above (sysdiagnose not included; can be provided on request). Cross-posted on GitHub as anthropics/claude-code #31231. Requesting that FB22141224 / FB22317519 be revisited in light of the new evidence — the architectural premise of the previous closures does not match what the agent does at runtime.
Replies
Boosts
Views
Activity
May ’26
Reply to Xcode 26.3 Claude Agent — 401 Invalid Bearer Token on Intel Mac (FB22141224)
Update: After extensive investigation I have identified what appears to be the root cause of the 401 Invalid Bearer Token error on my Intel Mac, and I want to share the findings in case they help others reporting similar issues on M1 and M4 machines. WHAT I FOUND (Intel Mac - x86_64): The Claude Agent binary that Xcode downloads is the darwin-arm64 build regardless of host architecture. On my Intel Mac this binary physically cannot execute, which fails silently and surfaces as a 401 error. Confirmed via terminal: file ~/Library/Developer/Xcode/CodingAssistant/Agents/claude/2.1.14/claude Returns: Mach-O 64-bit executable arm64 — wrong for Intel Mac The IDEChatClaudeCodeVersion preference is hardcoded to the ARM64 download URL: defaults read com.apple.dt.Xcode IDEChatClaudeCodeVersion Returns: darwin-arm64 URL regardless of CPU architecture We also confirmed the darwin-x64 binary exists in Anthropic's distribution bucket and runs correctly on Intel — both in the terminal and as a standalone binary: curl -fsSL -o /tmp/claude-x64 "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.14/darwin-x64/claude" /tmp/claude-x64 --version Returns: 2.1.14 (Claude Code) — works fine on Intel Claude Code also works perfectly in Terminal on this Intel Mac. The problem is exclusively with the Claude Agent inside Xcode, which downloads and attempts to run the wrong ARM64 binary. However, manually placing the x64 binary in the agent directory fails with: "Failed to initialize Claude Agent: The code signing identity for the agent did not match expectations, or the agent violated sandboxing rules." This means Xcode's code signing verification also rejects the x64 binary, so there is currently no workaround for Intel Mac users wanting to use the Claude Agent inside Xcode. Note: Claude chat in Xcode works perfectly on this Intel Mac — only the Agent and coding intelligence features are broken. This confirms the issue is the binary architecture, not account credentials, plan level, or network connectivity. Clearing all keychain entries, Xcode preferences, and cached credentials had no effect on the 401 error. A bug report has been filed with Anthropic here: https://github.com/anthropics/claude-code/issues/40642 IMPORTANT QUESTION FOR M1/M4 USERS: Since others on this thread are reporting the same 401 error on Apple Silicon machines where the ARM64 binary should work correctly, the architecture mismatch may not be the only cause of this error. Could affected M1/M4 users please run the following in Terminal and post the results: Check the binary architecture: file ~/Library/Developer/Xcode/CodingAssistant/Agents/claude/2.1.14/claude Check whether Claude chat works but agent features do not: Try the coding assistant chat vs inline code fixes and agentic coding features and report which work and which fail. Check your Claude plan: Pro, Max, Team, or Free This will help determine whether there are multiple separate bugs causing the same 401 error on different hardware, or one common root cause affecting everyone. If you are affected please also add a comment to the GitHub issue above with your Mac model and architecture so Anthropic can see the full scope of the problem.
Replies
Boosts
Views
Activity
Mar ’26