coderClaw

CoderClaw macOS Companion (menu bar + gateway broker)

The macOS app is the menu‑bar companion for CoderClaw. It owns permissions, manages/attaches to the Gateway locally (launchd or manual), and exposes macOS capabilities to the agent as a node.

What it does

Local vs remote mode

Launchd control

The app manages a per‑user LaunchAgent labeled bot.molt.gateway (or bot.molt.<profile> when using --profile/CODERCLAW_PROFILE; legacy com.coderclaw.* still unloads).

launchctl kickstart -k gui/$UID/bot.molt.gateway
launchctl bootout gui/$UID/bot.molt.gateway

Replace the label with bot.molt.<profile> when running a named profile.

If the LaunchAgent isn’t installed, enable it from the app or run coderclaw gateway install.

Node capabilities (mac)

The macOS app presents itself as a node. Common commands:

The node reports a permissions map so agents can decide what’s allowed.

Node service + app IPC:

Diagram (SCI):

Gateway -> Node Service (WS)
                 |  IPC (UDS + token + HMAC + TTL)
                 v
             Mac App (UI + TCC + system.run)

Exec approvals (system.run)

system.run is controlled by Exec approvals in the macOS app (Settings → Exec approvals). Security + ask + allowlist are stored locally on the Mac in:

~/.coderclaw/exec-approvals.json

Example:

{
  "version": 1,
  "defaults": {
    "security": "deny",
    "ask": "on-miss"
  },
  "agents": {
    "main": {
      "security": "allowlist",
      "ask": "on-miss",
      "allowlist": [{ "pattern": "/opt/homebrew/bin/rg" }]
    }
  }
}

Notes:

The app registers the coderclaw:// URL scheme for local actions.

coderclaw://agent

Triggers a Gateway agent request.

open 'coderclaw://agent?message=Hello%20from%20deep%20link'

Query parameters:

Safety:

Onboarding flow (typical)

  1. Install and launch CoderClaw.app.
  2. Complete the permissions checklist (TCC prompts).
  3. Ensure Local mode is active and the Gateway is running.
  4. Install the CLI if you want terminal access.

Build & dev workflow (native)

Debug gateway connectivity (macOS CLI)

Use the debug CLI to exercise the same Gateway WebSocket handshake and discovery logic that the macOS app uses, without launching the app.

cd apps/macos
swift run coderclaw-mac connect --json
swift run coderclaw-mac discover --timeout 3000 --json

Connect options:

Discovery options:

Tip: compare against coderclaw gateway discover --json to see whether the macOS app’s discovery pipeline (NWBrowser + tailnet DNS‑SD fallback) differs from the Node CLI’s dns-sd based discovery.

Remote connection plumbing (SSH tunnels)

When the macOS app runs in Remote mode, it opens an SSH tunnel so local UI components can talk to a remote Gateway as if it were on localhost.

Control tunnel (Gateway WebSocket port)

For setup steps, see macOS remote access. For protocol details, see Gateway protocol.