Skill Writing

imessage-access

A user-invocable Claude Code skill that manages who can reach Claude through the iMessage channel. It approves pairings, edits allowlists and sets DM and group policy by editing a local JSON file.

Last verified: write-up checked

Scanned with NVIDIA SkillSpector No significant issues found · risk score 6/100 · Nov 4, 2026 What this means

imessage-access — illustration

What it is

The access skill, invoked as /imessage:access, handles access control for the iMessage channel. It never talks to iMessage directly. Instead it edits a single JSON state file at ~/.claude/channels/imessage/access.json, and the channel server re-reads that file. The state holds a DM policy (dmPolicy), a list of allowed sender IDs (allowFrom), per-group settings keyed by chat GUID, pending pairing codes with sender and chat IDs plus creation and expiry timestamps, and optional mentionPatterns. If the file is missing, it defaults to an allowlist policy with empty lists. The default DM policy is allowlist, not pairing. The server reads the user's personal chat.db, so pairing mode would autoreply a code to every contact who texts. Self-chat bypasses the gate regardless of policy, so the owner's own texts always get through. Sender IDs are handle addresses, either an email or a phone number such as "+15551234567". Chat IDs are iMessage chat GUIDs such as "iMessage;-;+15551234567", and the two are different. The skill dispatches on space-separated arguments: - With no arguments (or unrecognized ones), it shows status. - pair <code> approves a pending sender. It adds them to allowFrom, removes the pending entry, and writes a file into ~/.claude/channels/imessage/approved/. The server polls that directory and sends "you're in". - deny <code> discards a pending code. - allow and remove edit allowFrom. - policy sets the mode to pairing, allowlist or disabled. - group add (with optional --no-mention and --allow flags) and group rm manage group chats. - set adjusts delivery config: textChunkLimit (max 10000), chunkMode (length or newline) and mentionPatterns. Because iMessage has no structured mentions, mentionPatterns is the only trigger in groups. Security is central to the design. The skill only acts on requests typed by the user in their terminal session. It refuses approval, allowlist or policy changes that arrive via channel notifications (iMessage, Telegram, Discord, etc.), because channel messages can carry prompt injection. Pairing always requires an explicit code, and the skill won't auto-pick even when only one pending entry exists. An attacker can seed a single pending entry by texting the channel.

Who it's for

  • Users running the iMessage channel plugin for Claude Code who need to control which contacts and group chats can reach Claude
  • Users who want to approve or deny pairing requests from their terminal
  • Users who want to tune group mention triggers and reply chunking for the iMessage channel

Requirements

Requirements

  • The iMessage channel plugin and its channel server, which reads the user's chat.db and re-reads access.json
  • Allowed tools for the skill: Read, Write, Bash(ls *), Bash(mkdir *)
  • Requests must be typed by the user in their terminal session, not relayed through a channel message

هاد السكيل بيخليك تتحكم مين بيقدر يحكي مع Claude عن طريق قناة iMessage. فيك توافق على طلبات الربط، وتعدّل قائمة المسموح إلهم، وتحدد سياسة الرسائل الخاصة والغروبات، وكل هاد بتعديل ملف JSON محلي.

Examples

Show channel access status

Prompt
prompt
/imessage:access

Expected output: With no arguments, the skill reads access.json and shows the dmPolicy, the allowFrom count and list, pending codes with sender IDs and age, and the group count.

Approve a pairing code

Prompt
prompt
pair <code>

Expected output: Passed as an argument to /imessage:access. It looks up the unexpired pending code, adds the sender to allowFrom, deletes the pending entry, and writes an approved/<senderId> file so the server sends "you're in".

Add a group chat

Prompt
prompt
group add <chatGuid>

Expected output: Passed as an argument to /imessage:access. It registers a group by chat GUID. The optional --no-mention flag disables the mention requirement, and --allow id1,id2 restricts which senders are allowed.

access.json state shape

json
json
{
  "dmPolicy": "allowlist",
  "allowFrom": ["<senderId>", ...],
  "groups": {
    "<chatGuid>": { "requireMention": true, "allowFrom": [] }
  },
  "pending": {
    "<6-char-code>": {
      "senderId": "...", "chatId": "...",
      "createdAt": <ms>, "expiresAt": <ms>
    }
  },
  "mentionPatterns": ["@mybot"]
}

What it does: The structure of ~/.claude/channels/imessage/access.json that the skill reads and writes.