Skip to content

[Bug]: macOS — Orca's agent-session sandbox blocks Orca's own claude-hook.sh (EPERM on every tool call in Orca-hosted Claude Code sessions) #8749

Description

@nathancooper-vm

Symptom

Every Claude Code session hosted inside Orca on macOS emits repeated hook errors on every tool call:

PreToolUse:Bash hook error
Failed with non-blocking status code: /bin/sh: /Users/<user>/.orca/agent-hooks/claude-hook.sh: Operation not permitted
PostToolUse:Bash hook error
Failed with non-blocking status code: /bin/sh: /Users/<user>/.orca/agent-hooks/claude-hook.sh: Operation not permitted

The hook is the one Orca itself installs into ~/.claude/settings.json (PreToolUse/PostToolUse/Stop/UserPromptSubmit/etc.), pointing at ~/.orca/agent-hooks/claude-hook.sh.

Diagnosis (verified, not speculated)

  • Inside an Orca-hosted session, everything under ~/.orca returns EPERMls, stat, xattr, and executing the hook (exit 126). This persists even with Claude Code's own command sandbox explicitly disabled (dangerouslyDisableSandbox).
  • From a plain Terminal.app, the same directory reads fine with ordinary POSIX permissions (rwxr-xr-x, user-owned), no special TCC grants needed — so it's not file corruption, not Full Disk Access, not MDM (machine isn't enrolled).
  • Other fingerprints inside the session point to a seatbelt sandbox profile rather than TCC: ps won't exec, nice() calls fail with EPERM, and /usr/local/bin/orca itself is exec-denied from within the session.
  • tccd logs nothing when the denial is triggered.

Conclusion

Orca appears to wrap agent sessions in its own macOS sandbox that denies access to ~/.orca — reasonable protection for your control plane — but the Claude Code hook you install lives inside that denied path. So in exactly the sessions Orca hosts, Orca's sandbox blocks Orca's own hook, and every tool call errors. No permission the user can grant (FDA, TCC toggles, reboot) changes this, since sandbox denials aren't pierced by TCC grants.

Suggested fixes (either works)

  1. Whitelist read+exec of ~/.orca/agent-hooks/ in the agent-session sandbox profile — the hooks are the one part of the control plane agents are supposed to execute; or
  2. Install the hooks fail-silent by default, e.g.
    if [ -x '<hook>' ]; then /bin/sh '<hook>' 2>/dev/null || exit 0; fi
    so denied contexts no-op instead of erroring on every tool call.

I've applied pattern (2) locally as a workaround, so not urgent for me — but presumably every macOS user running Claude Code inside Orca sees this noise.

Environment

  • macOS (Darwin 25.5.0)
  • Claude Code, current release
  • Orca desktop, current release (version string unavailable from inside the session — the sandbox denies orca --version too, which is part of the same picture)

Possibly related to the hook-runtime drift noted in #1308, but this one is macOS-sandbox-specific and hits the Claude hook rather than Codex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Highest priority: critical production/blocking issue

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions