imessage

imessage is a skill for Claude Code, Codex from dvdsgl/claude-imessage. It costs 26 tokens per session (1,561 once invoked), scanned A, original, MIT.

A macOS skill for reading conversations, sending messages, and checking for new messages in Apple’s Messages app.

In plain words
What is it for?
Use it to read message history from the Messages database, check for new messages, and send messages or replies.
Why use it?
It provides command-line access when reading through AppleScript is unreliable or limited by permissions.

Skill for Claude CodeCodex

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dvdsgl/claude-imessage/imessage
Any agent
npx skills add dvdsgl/claude-imessage --skill imessage
Clone the repo
git clone --depth 1 https://github.com/dvdsgl/claude-imessage

Made for: Claude Code, Codex.

Or install imessage, 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/skills/dvdsgl/claude-imessage/imessage.svg)](https://agentmods.dev/skills/dvdsgl/claude-imessage/imessage)
Your own site
<a href="https://agentmods.dev/skills/dvdsgl/claude-imessage/imessage"><img src="https://agentmods.dev/badge/skills/dvdsgl/claude-imessage/imessage.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,561 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00026 $0.01561
Opus 5 $0.00013 $0.00781
Sonnet 5 $0.00005 $0.00312
Haiku 4.5 $0.00003 $0.00156

Measured 5d ago against content hash ea96797b1107, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d ago.

The scan reads SKILL.md. This mod also ships 10 executable files (check-new-messages-db.sh, check-new-messages.sh, daemon/imessage-auto-reply-daemon.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/imessage/SKILL.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.

iMessage Management Skill

This skill provides comprehensive Messages app interaction capabilities through command-line tools.

Available Tools

All tools are located in .claude/skills/imessage/ and use either AppleScript or direct SQLite database access to interact with the Messages app.

Database vs AppleScript Approach

  • Database tools (*-db.sh): Read messages directly from the Messages SQLite database (~/Library/Messages/chat.db). More reliable and faster, supports full message history including sent messages with proper text extraction.
  • AppleScript tools (original): Use AppleScript automation. Sending works reliably, but reading messages may have permission issues on some macOS systems.

Recommended: Use database tools for reading (read-messages-db.sh, check-new-messages-db.sh) and AppleScript for sending (send-message.sh, send-to-chat.sh).

1. Read Messages from Database (read-messages-db.sh) ⭐ RECOMMENDED

Read messages directly from the Messages SQLite database. This is the most reliable method for reading message history.

Usage:

# Read recent messages by phone number
.claude/skills/imessage/read-messages-db.sh "1234567890" --limit 10

# Read recent messages (all conversations)
.claude/skills/imessage/read-messages-db.sh --limit 20

Features:

  • Reads both incoming and outgoing messages
  • Extracts text from outgoing messages (stored in attributedBody)
  • Fast and reliable
  • Shows formatted timestamps
  • No permission issues

2. Check New Messages from Database (check-new-messages-db.sh) ⭐ RECOMMENDED

Check for recent incoming messages from the database. Used by the iMessage auto-reply daemon.

Usage:

# Check recent messages from specific number
.claude/skills/imessage/check-new-messages-db.sh "1234567890"

# Check all recent incoming messages
.claude/skills/imessage/check-new-messages-db.sh

Output Format:

MSG_ID: <unique_hash>
ROWID: <message_id>
DATE: <readable_timestamp>
TEXT: <message_text>
FROM: <phone_number>
CHAT: <chat_identifier>
---

Read the full file on GitHub · 198 lines

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. 5d ago First seen · 198 lines · 26 tokens per session scan A ea96797b1107

Subscribe to this mod's changes

imessage is a skill published in the GitHub repository dvdsgl/claude-imessage (54 stars, last pushed 9mo ago), licensed MIT. It adds 26 tokens to every session and 1,561 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-30.