imessage

imessage is a command for Claude Code from wolfiesch/wolfies-imessage-gateway. It costs 12 tokens per session (466 once invoked), scanned A, original, MIT.

A macOS command tool for searching, reading, sending, and managing iMessages from Claude Code.

In plain words
What is it for?
Search contacts and conversations, check unread or recent messages, send texts, find messages needing follow-up, and inspect group chats, attachments, voice messages, links, and conversation statistics.
Why use it?
It lets you handle Messages conversations from the command line instead of switching to the Messages app.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the imessage-gateway plugin — 1 skill, 1 command shipped together

Good fit Search contacts and conversations, check unread or recent messages, send texts, find…

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add wolfiesch/wolfies-imessage-gateway
Claude Code
/plugin install imessage-gateway

Made for: Claude Code.

Or install imessage-gateway, the plugin that ships this one along with the rest of its 1 skill, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for imessage

README.md
[![agentmods](https://agentmods.dev/badge/commands/wolfiesch/wolfies-imessage-gateway/imessage.svg)](https://agentmods.dev/commands/wolfiesch/wolfies-imessage-gateway/imessage)
Your own site
<a href="https://agentmods.dev/commands/wolfiesch/wolfies-imessage-gateway/imessage"><img src="https://agentmods.dev/badge/commands/wolfiesch/wolfies-imessage-gateway/imessage.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.00466
Opus 5 $0.00006 $0.00233
Sonnet 5 $0.00002 $0.00093
Haiku 4.5 $0.00001 $0.00047

Measured 6d ago against content hash d00de1ba1d21, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

imessage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/imessage.md · 68 lines

What it actually says

iMessage Gateway

Access your Messages.db without MCP server overhead. macOS only.

Quick Commands

# Search messages with a contact
python3 ${CLAUDE_PLUGIN_ROOT}/gateway/imessage_client.py search "John" --limit 20

# Send a message
python3 ${CLAUDE_PLUGIN_ROOT}/gateway/imessage_client.py send "John" "Running late!"

# Check unread messages
python3 ${CLAUDE_PLUGIN_ROOT}/gateway/imessage_client.py unread

# Find messages needing follow-up
python3 ${CLAUDE_PLUGIN_ROOT}/gateway/imessage_client.py followup --days 7

Available Commands

Command Description
search <contact> Search messages with fuzzy contact matching
messages <contact> Get conversation with a contact
send <contact> <message> Send text via AppleScript
unread Check unread messages
recent Recent conversations
followup Find messages needing reply
contacts List all contacts
analytics Conversation statistics
groups List group chats
group-messages Read group messages
attachments Get photos/videos/files
voice Get voice messages
links Extract shared URLs
reactions Get tapbacks/emoji reactions

Requirements

  • macOS (Messages.app integration)
  • Python 3.9+
  • Full Disk Access for Terminal (System Settings -> Privacy -> Full Disk Access)
  • Contacts synced to ${CLAUDE_PLUGIN_ROOT}/config/contacts.json

Setup After Installation

# Sync contacts from macOS Contacts.app
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/sync_contacts.py

# Install dependencies
pip install -r ${CLAUDE_PLUGIN_ROOT}/requirements.txt

Why Gateway Pattern?

MCP servers load into every Claude Code session (~763ms startup + context tokens).

Gateway pattern: standalone Python CLI, invoked via Bash only when needed.

19x faster. Zero overhead until you actually use it.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 68 lines · 12 tokens per session scan A d00de1ba1d21

Subscribe to this mod's changes

imessage is a command published in the GitHub repository wolfiesch/wolfies-imessage-gateway (5 stars, last pushed 2mo ago), licensed MIT. It adds 12 tokens to every session and 466 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.