claude-code - 💡(How to fix) Fix Claude Desktop: binaryName platform-switch causes macOS TCC prompt for 'Claude.exe' [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52788Fetched 2026-04-25 06:20:55
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Claude Desktop on macOS intermittently triggers a TCC (permission) prompt labelled "Claude.exe" would like to access data from other apps. The Windows executable name appears on macOS because a helper/subprocess path inside the packaged app falls through into the win32 branch of a platform-switch when resolving the embedded CLI binary.

Error Message

  • The error is confusing even for technical users (reproduced in our environment 3 releases in a row, filed Sprint 217).

Root Cause

  • On macOS the string Claude.exe is a strong anti-signal for users — it looks like Windows malware masquerading as Claude.
  • A fraction of users will deny the prompt, breaking Claude Desktop functionality for them.
  • The error is confusing even for technical users (reproduced in our environment 3 releases in a row, filed Sprint 217).

Code Example

binaryName: process.platform === "win32" ? "claude.exe" : "claude"

---

binaryName: process.platform === "win32" ? "claude.exe" : "claude"
    // becomes (safer default):
    const isWin = process.platform === "win32";
    binaryName: isWin && process.arch.startsWith("x") ? "claude.exe" : "claude";
RAW_BUFFERClick to expand / collapse

Summary

Claude Desktop on macOS intermittently triggers a TCC (permission) prompt labelled "Claude.exe" would like to access data from other apps. The Windows executable name appears on macOS because a helper/subprocess path inside the packaged app falls through into the win32 branch of a platform-switch when resolving the embedded CLI binary.

Repro

  • macOS 15.x (Darwin 25.5.0), Claude Desktop installed via /Applications/Claude.app
  • Reproduced across three consecutive releases (observed over multiple versions during Sprint 200-217, 2026-03 → 2026-04)
  • Trigger: happens during helper-process startup for certain session types (long-running Claude Code sessions with background tools / hooks)
  • User-visible effect: macOS surfaces a permission dialog with the Windows binary name Claude.exe, which is confusing and looks like malware to non-technical users

Suspected source

Inside /Applications/Claude.app/Contents/Resources/app.asar at approximately offset 8471026 there is a platform switch that resolves the embedded CLI binary name:

binaryName: process.platform === "win32" ? "claude.exe" : "claude"

A subsequent code path references binaryName before process.platform has been reliably set (or from a worker/forked context where process.platform returns something unexpected, so the ternary defaults to the Windows branch). The name is then surfaced by the OS when the macOS TCC subsystem labels the unsigned/unknown-to-TCC binary requesting access.

Why this matters

  • On macOS the string Claude.exe is a strong anti-signal for users — it looks like Windows malware masquerading as Claude.
  • A fraction of users will deny the prompt, breaking Claude Desktop functionality for them.
  • The error is confusing even for technical users (reproduced in our environment 3 releases in a row, filed Sprint 217).

Recommended fix

Prefer a bundle-/OS-based resolution that cannot fall through to win32:

  1. Info.plist / bundle-based lookup on macOS: resolve the CLI binary name via the app bundle (NSBundle.mainBundle.executablePath / process.resourcesPath) rather than via process.platform.

  2. Defensive default to the POSIX name: switch the ternary so Windows is the explicit case and every non-win32 platform (including when process.platform is temporarily empty/undefined in a forked worker) lands on claude:

    binaryName: process.platform === "win32" ? "claude.exe" : "claude"
    // becomes (safer default):
    const isWin = process.platform === "win32";
    binaryName: isWin && process.arch.startsWith("x") ? "claude.exe" : "claude";
  3. Platform + arch combined check: macOS reports darwin + arm64/x64, never win32. Combining process.platform with process.arch and asserting both catches any corner case where one dimension is unset.

Option 1 (bundle-based) is the cleanest because it removes the platform-switch entirely on macOS.

Additional context

  • No sensitive info is leaked by the prompt, but it severely damages perceived trust.
  • Filed as part of Sprint 217 Claude-Desktop stability review.

extent analysis

TL;DR

The issue can be fixed by changing the platform-switch logic to prefer a bundle-/OS-based resolution that cannot fall through to win32, such as using Info.plist or defensive defaults.

Guidance

  • Consider using NSBundle.mainBundle.executablePath or process.resourcesPath to resolve the CLI binary name via the app bundle on macOS, removing the need for a platform switch.
  • Update the ternary logic to use a safer default, such as const isWin = process.platform === "win32"; binaryName: isWin && process.arch.startsWith("x") ? "claude.exe" : "claude";, to prevent falling through to the win32 branch.
  • Combine process.platform with process.arch to assert both and catch any corner cases where one dimension is unset.

Example

const isWin = process.platform === "win32";
binaryName: isWin && process.arch.startsWith("x") ? "claude.exe" : "claude";

Notes

The provided solutions aim to address the issue by removing the platform switch or using safer defaults. However, the best approach may depend on the specific requirements and constraints of the Claude Desktop application.

Recommendation

Apply the workaround by updating the ternary logic to use a safer default, as this is a straightforward and effective solution to prevent the win32 branch from being used on macOS.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING