[BUG] claude -p crashes at startup under launchd when cwd is in ~/Library/CloudStorage (OneDrive) — every version after 2.1.128 (fd-limit catch-all / EPERM)

Open 💬 0 comments Opened Jul 10, 2026 by David-Tarkhanyan

Summary

claude -p crashes at startup when launched by a launchd user agent with cwd inside ~/Library/CloudStorage/ (OneDrive). Every version I tested after 2.1.128 is affected. The same binary, same folder, run interactively: works. The same binary under launchd from a non-CloudStorage cwd: works.

Environment

  • macOS 26.4.1 (Darwin 25.4.0), MacBook Pro M5 Pro (arm64)
  • Native install (~/.local/share/claude/versions/...)
  • cwd: a OneDrive-synced project folder under ~/Library/CloudStorage/OneDrive-Personal/...
  • Launched via a launchd user agent (launchctl bootstrap gui/501 ...), RunAtLoad, env: PATH, HOME, USER, LOGNAME set

Reproduction matrix (isolated one-shot launchd job running claude -p "Reply with exactly: OK")

| Version | launchd + CloudStorage cwd | launchd + $HOME cwd | interactive + CloudStorage cwd |
|---|---|---|---|
| 2.1.128 | works | - | works |
| 2.1.170 | crashes: An unknown error occurred, possibly due to low max file descriptors (Unexpected) (soft limit already raised to 10240) | works (per earlier bisect from /tmp) | works |
| 2.1.197 | crashes: An internal error occurred (EPERM) | works | works |
| 2.1.199 | crashes: An internal error occurred (EPERM) | - | works |

Additional data points:

  • Reproduces from a completely empty folder inside CloudStorage (no .claude/, no settings, no hooks), so it is not project configuration.
  • Crash is within ~5 seconds of spawn, before --debug prints anything.
  • No tccd / sandboxd denials appear in the unified log at crash time, so it does not look like a grantable TCC permission.
  • The 2.1.170 fd-limit message appears to be a catch-all; the raised ulimit -Sn 10240 makes no difference.
  • 2.1.128 not only starts but completes full agentic runs (file writes into the CloudStorage project, MCP tools) under the same launchd context, daily since 2026-06-11.

Impact

Any scheduled/automated (launchd, cron-style) Claude Code run on a project living in OneDrive/iCloud/Google Drive folders is impossible on current versions; users are forced to pin 2.1.128.

Possibly related

#26981 (EPERM on CloudStorage despite FDA), #34554 (desktop app cannot start sessions in CloudStorage paths), #70072 (launchd + CloudStorage regression).

View original on GitHub ↗