Use imsg when an OpenClaw agent must act through the user's local macOS Messages.app account: inspect iMessage/SMS history, choose the correct DM or group, send messages/files, reply, react, vote in polls, or use private-API iMessage features.
Do not use this skill for Telegram, Signal, WhatsApp, Discord, Slack, or for replying inside the current OpenClaw conversation when the configured channel already routes the reply.
Agent Flow
Resolve the conversation first.
Choose DM, existing group, or new group.
Pick the lowest-capability command that can do the requested action.
Confirm any send or visible state change unless the user already gave exact recipient, content, and action.
Execute with stable identifiers: prefer --chat-id for normal sends/watch/history and --chat chat GUID for bridge actions.
Never infer a recipient from a casual name alone when several chats or handles could match. Show the matched display name, handle(s), group participants, and message text/action before sending.
Host Requirements
macOS 14+ with Messages.app signed in for send/react/bridge actions.
Private API mode is strongly encouraged for OpenClaw iMessage. It unlocks replies, precise tapbacks, effects, polls, attachment replies, read/typing actions, and group management. Basic mode is a fallback for reads plus plain text/file send.
Full Disk Access for the process context that runs imsg or OpenClaw; reads fail without Messages DB access.
Automation permission for Messages.app when using public send.
Accessibility permission for the process context that runs public imsg react; it uses System Events UI automation. Bridge tapback uses private API instead.
Optional Contacts permission for contact-name resolution.
SMS sends require Text Message Forwarding from the user's iPhone to this Mac.
Linux reads a copied chat.db only; it cannot send, react, launch Messages.app, mark read, or type.
Resolve Targets
Use --json reads. Output is newline-delimited JSON; use jq -s when jq is available, or consume one object per line directly.
Group create/name/photo/member/leave/delete/mark actions
Account, whois, nickname checks
For OpenClaw channel setup, check bridge availability early:
imsg status --json
If the host supports bridge actions but Messages is not injected yet, ask before running imsg launch. It kills and relaunches Messages.app to inject the bridge, so treat it as a visible state change:
imsg launch
imsg status --json
If SIP, library validation, private entitlement checks, or missing selectors still block the capability, explain that the requested private-API action is unavailable on this host and offer the closest non-bridge action, if one exists. Do not silently downgrade a threaded reply, effect, subject, poll, or GUID-targeted tapback into a plain send/react.
DM Scenarios
Exact handle, basic send:
imsg send --to "+14155551212" --text "On my way" --service auto
Group mutations are highly visible. Confirm the exact group and participant list before changing membership, name, photo, read state, leaving, or deleting.
Reactions and Replies
Public react is limited: it reacts to the most recent incoming message in the chat.
For a specific message GUID or removal, use bridge tapback:
imsg tapback --chat 'iMessage;-;+15551234567' --message <message-guid> --kind love
imsg tapback --chat 'iMessage;-;+15551234567' --message <message-guid> --kind love --remove
Use send-rich --reply-to <message-guid> for threaded replies. Confirm the referenced message if the user says "that" or "the previous one".
Polls
Native Apple Messages polls require the bridge. Creation needs at least two --option values. Voting requires one of --option-id, --option-index, or --option.
Messages renders only the options on a poll balloon, so current imsg poll send echoes --question as a best-effort plain caption after the poll. Use --comment to override that caption. Do not retry automatically when only the caption fails: the poll may already be delivered.
history and watch backfill a title-less inbound native poll's poll.question from its clean caption row. Poll vote rows are poll events, not tapbacks; watch --reactions is not required to see them.
--since-rowid is exclusive. Without it, watch starts at the newest row. watch uses filesystem events plus a low-frequency polling fallback, so it can catch up after missed SQLite sidecar events. Poll objects appear without --reactions.
For a daemon or multi-chat integration, use imsg rpc. It speaks JSON-RPC 2.0 over stdin/stdout. Inspect imsg status --json for rpc_methods before using newer bridge or poll methods.
Safety Rules
Confirm recipient, chat, and content before every send unless the user's request already contains exact values.
Confirm visible state changes: read receipts, typing indicators, edits, unsends, deletes, poll votes, tapbacks, group membership, group name/photo, leaving/deleting chats.
Never send to unknown numbers or ambiguous contact-name matches without approval.
Confirm attachments exist and are the intended files.
Prefer E.164 phone numbers; use --region US or another region only when needed for local formats.
Use bridge actions for bridge-only semantics, but confirm visible state changes and destructive actions first.