chat-adapter-imessage 0.1.1, pinned — a community adapter) and runs in one of two modes:
- Local — NanoClaw runs on a Mac and sends and receives as that Mac’s signed-in iMessage account, reading the Messages database (
chat.db) directly. No extra service, but macOS only, and the Node binary needs Full Disk Access. - Remote (Photon API) — NanoClaw talks over HTTP to a Photon server that owns an iMessage account on another Mac. Use this when your NanoClaw host is Linux, or when you’d rather keep your daily-driver Mac’s chat history out of the loop.
Prerequisites
- A working NanoClaw install (quickstart)
- Local mode: a Mac signed in to iMessage, and the ability to grant Full Disk Access in System Settings (the wizard walks you through it)
- Remote mode: a Photon server URL and API key, copied from your Photon dashboard
Install
iMessage is offered in the first-run setup wizard, or add it later by running/add-imessage in Claude Code. The wizard flow:
Pick a mode
Local (this Mac) or remote (Photon API). On macOS the wizard pre-selects local; off macOS, remote is the only option offered.
Grant Full Disk Access (local) or enter Photon credentials (remote)
Local: the wizard opens the folder containing your
node binary in Finder, then walks you through System Settings → Privacy & Security → Full Disk Access → click + → drag the node file in → toggle it on. Confirm in the wizard once granted. Without this, the adapter can’t read chat.db and inbound messages never arrive.Remote: paste your Photon server URL (must start with http:// or https://) and API key. If credentials already exist in .env, the wizard offers to reuse them.Enter your iMessage handle
The phone number or email you iMessage from — phone in
+E.164 format (e.g. +14155551234), or any email iMessage recognises. This becomes the platform ID wired to your first agent, and where the welcome message goes.Adapter install
setup/add-imessage.sh copies the adapter from the channels branch, installs the pinned package, builds, writes the mode keys to .env (synced to data/env/env), and restarts the service. Idempotent: safe to re-run./manage-channels. Contacts are identified by phone number or email; group chat IDs are assigned internally by iMessage. Group chats are supported.
Platform notes
- Mode is resolved from
.env—IMESSAGE_LOCALset to anything butfalsemeans local. Local mode additionally requiresIMESSAGE_ENABLED=true; remote requiresIMESSAGE_SERVER_URL(plusIMESSAGE_API_KEY). If the required keys for the active mode are missing, the adapter factory returns nothing and the channel silently doesn’t start. - Switching modes is clean — re-running setup (or
setup/add-imessage.sh) writes the new mode’s keys and strips the opposite mode’s, so stale values can’t confuse the adapter. - Full Disk Access binds to one specific binary — the grant applies to the
nodefile you dragged in, resolved viawhich nodeat setup time. If you switch Node versions (e.g. withnvm), the path changes and the grant no longer covers the binary NanoClaw runs under — re-grant for the new one. - No threads — the adapter sets
supportsThreads: false; thread IDs map 1:1 to conversations. Wirings withper-threadsession mode behave likesharedhere — see the entity model.
Troubleshooting
- iMessage channel never starts — the factory bails without its required keys. Local mode (
IMESSAGE_LOCALunset or anything butfalse) needsIMESSAGE_ENABLED=truein.env; remote (IMESSAGE_LOCAL=false) needsIMESSAGE_SERVER_URL. A missingIMESSAGE_API_KEYdoesn’t block startup — it surfaces later as an authentication failure against Photon. Check.envand confirm it’s synced todata/env/env, then restart. - Inbound messages never arrive (local mode) — Full Disk Access is missing, or granted to a different
nodebinary than the one the service runs under. Runopen "$(dirname "$(which node)")", re-drag thatnodefile into Full Disk Access, and restart the service. - “local mode requires macOS” — the installer hard-fails on Linux/WSL (the wizard’s version of the same error reads “Local iMessage mode only works on macOS”). Choose remote mode (Photon API), or run setup from a Mac.
- “Couldn’t finish connecting” at the end of setup — the welcome message didn’t go out. Double-check Full Disk Access (local) or your Photon server URL and API key (remote), then re-run setup.