[BUG] Startup freeze: installed-app discovery materializes evicted iCloud .app bundles on the main thread
Environment
| Component | Value |
|---|---|
| Claude Desktop | 1.30096.5 |
| Embedded Claude Code | 2.1.229 |
| Electron | 42.7.0 |
| macOS | 26.6.1 (25G76), arm64 |
| Hardware | MacBook Pro (MacBookPro18,1), 16 GB |
What happens
Claude Desktop freezes a few seconds into startup and stays frozen for as long as iCloud takes to answer. The window never paints, no input is processed, and the app looks crashed while the process is alive at near 0% CPU. Force-quitting appears to be the only way out. Reopening can freeze again on the next indexed bundle.
macOS filed two hang reports for consecutive launches:
| Launch | Hang duration |
|---|---:|
| First | 62.04s |
| Second | 396.47s |
Cause, from the hang report's main-thread stack
All 41 of 41 samples in the first report sit in this chain:
Claude main thread
-> computer_use.node
-> InstalledAppsCache.performSpotlightQuery()
-> NSBundle objectForInfoDictionaryKey
-> NSBundle localizedInfoDictionary
-> CFBundle directory and localization discovery
-> readdir / __getdirentries64
-> apfs_materialize_dataless_file_ext
The second report contains the same performSpotlightQuery frames and apfs_materialize_dataless_file_ext 5 times.
Spotlight returns every indexed com.apple.application-bundle, including old installer bundles stored in iCloud Drive. With Optimize Mac Storage on, those are dataless placeholders. Opening one as NSBundle to read its localized name forces APFS to materialize it, so the main thread waits on an iCloud download of arbitrary size at arbitrary speed. On this machine one candidate was a 402 MB placeholder, and the File Provider logs showed transfer estimates around 0.03–0.09 Mbps.
The app's own logs show the main thread going quiet right after Computer Use components initialize, with no further lines until the next launch.
Steps to reproduce
- Turn on iCloud Drive with
Optimize Mac Storage. - Put an
.appbundle in iCloud Drive — an old installer is typical — and let it be evicted so it becomes a dataless placeholder. - Confirm Spotlight indexes it:
mdfind "kMDItemContentType == 'com.apple.application-bundle'" -onlyin ~/Library/Mobile\ Documents
- Launch Claude Desktop. It freezes during startup while the bundle materializes.
Expected
Startup should never block on filesystem work of unbounded duration. Application discovery is an enhancement for Computer Use, so it should fail open.
Suggested fix
- Move installed-app discovery off the main thread, and never gate window readiness on it.
- Restrict default discovery to real installation roots —
/Applications,/System/Applications,~/Applications— and treat wider Spotlight results as optional, asynchronous enrichment. - Check URL resource values before opening a result as
NSBundle, and skip items that are ubiquitous-and-not-downloaded, dataless, evicted, or unresolved by the File Provider. - Prefer Spotlight metadata such as display name and bundle identifier over
localizedInfoDictionary, which can materialize bundle contents. - Add per-item timeouts, cancellation, and a total scan budget, then cache results and refresh after startup.
Workaround for anyone hitting this
Keep the bundles but take them out of Spotlight's application results — move them into a folder whose name ends in .noindex and add a suffix to the .app name, or add the parent folder to System Settings → Spotlight → Search Privacy. After that, step 3's query returns nothing and startup completes normally, with the longest remaining pause around 1.1 seconds.