agentleFS
naticorrea-03naticorrea-03/claude-code-skills/skills/imessage/SKILL.md

imessage

Skill4 starsChanged 5 months agoMITView on GitHub

Read and send iMessages via local macOS capabilities (no third-party API). Two modes. Send mode drafts a message and uses AppleScript (`osascript`) on explicit "send it" and requires only Automation, Messages permission (scoped, revocable). Read mode pulls from `~/Library/Messages/chat.db` via sqlite3 and requires Full Disk Access for Terminal, which is a broad permission, so it is opt-in only. Trigger on phrases like "text [person]", "iMessage [person]", "draft an imessage", "read my texts from [person]", "what did [person] text me", "/imessage". Defaults to drafts-only, never auto-sends.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use heartmula, findmy and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • math-incSkill

    heartmula

    Set up and run HeartMuLa, the open-source music generation model family (Suno-like). Generates full songs from lyrics + tags with multilingual support.

    Also in 9 projects that use this

  • math-incSkill

    findmy

    Track Apple devices and AirTags via FindMy.app on macOS using AppleScript and screen capture.

    Also in 16 projects that use this

  • john-data-chenSkill

    touchdesigner-mcp

    Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.

    Also in 7 projects that use this

  • john-data-chenSkill

    teams-meeting-pipeline

    Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.

    Also in 10 projects that use this

  • Tommy-ywSkill

    songwriting-and-ai-music

    Songwriting craft, AI music generation prompts (Suno focus), parody/adaptation techniques, phonetic tricks, and lessons learned. These are tools and ideas, not rules. Break any of them when the art calls for it.

    Also in 12 projects that use this

  • mae616Skill

    p5js

    p5.js(クリエイティブコーディング)のProcessing由来「コードでスケッチ」思想を軸に、setup/drawループ・座標系・インタラクション・パフォーマンス最適化を整理する。p5.js、Processing、クリエイティブコーディング、ジェネラティブアート、インタラクティブ表現、ビジュアルプログラミング、Canvas描画、パーティクル、フラクタル、ノイズ表現に関する相談で必ず使うこと。ユーザーが「コードでアート」「動くビジュアル」「インタラクティブな描画」と言った場合にも適用する。

    Also in 13 projects that use this

  • +4 more from math-inc

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 13 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read and send iMessages locally.

    line 8
  2. Distinctive:

    Do NOT use for:

    line 20
  3. Distinctive:

    Before invoking read mode for the first time in a session, warn the user once:

    line 55
  4. Distinctive:

    If the user confirms, proceed:

    line 59
  5. Distinctive:

    Always copy chat.db to /tmp first, query the copy, delete the copy.

    line 75
  6. Distinctive:

    When the user says "text Alex", resolve the contact:

    line 79
  7. Distinctive:

    If you already have the person's phone (E.164) or Apple ID, use it.

    line 81
  8. Distinctive:

    If the person is not found, ask once: "What's [name]'s phone or Apple ID?"

    line 83
  9. Distinctive:

    Do NOT scrape Contacts.app via AppleScript without confirming.

    line 85
  10. Distinctive:

    Never auto-reply to incoming messages.

    line 91
  11. Distinctive:

    If AppleScript send fails (no Automation permission, Messages.app not running, recipient not on iMessage), surface the error and the draft …

    line 92
  12. Distinctive:

    Do not store message bodies in any log or cache.

    line 93
  13. Very specific:

    When the user first invokes this skill, check whether permissions are configured.

    line 97
  14. Distinctive:

    After granting, the terminal app must be fully quit and relaunched.

    line 105

“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

imessage

Read and send iMessages locally. No MCP server, no cloud API. Two modes with very different permission costs.

Requires a Mac with iMessage set up: Messages must be signed into your Apple ID and able to send from this Mac. macOS only, this does not work on Windows, Linux, or from a phone alone.

When to use

  • "Text Alex that I'm running 10 min late"
  • "Draft an iMessage to [person] saying..."
  • "Send Sam a quick text about..."
  • "What did [person] text me yesterday?"
  • "Pull up my last thread with [person]"

Do NOT use for:

  • Slack or other chat apps (use their own tools)
  • Email (use an email tool)
  • SMS to non-Apple recipients without confirming the contact has iMessage (AppleScript can still route as SMS via the iPhone bridge, but only if Continuity is on)

Modes

Send mode (default, low-permission)

  1. Confirm recipient and message. Match the tone to the recipient (casual with friends, more measured with colleagues).
  2. Show the draft. Wait for "send it" or equivalent.
  3. On approval, send via AppleScript:
osascript <<'APPLESCRIPT'
tell application "Messages"
  set targetService to 1st service whose service type = iMessage
  set targetBuddy to buddy "PHONE_OR_APPLE_ID" of targetService
  send "MESSAGE_TEXT" to targetBuddy
end tell
APPLESCRIPT

Replace PHONE_OR_APPLE_ID with the recipient's phone (E.164, e.g. +19175551234) or Apple ID email. Replace MESSAGE_TEXT with the drafted body, escaping quotes and backslashes for AppleScript.

Permission required: System Settings, Privacy & Security, Automation, enable Messages under Terminal (or iTerm, or whatever shell host Claude Code runs in).

Permission NOT required: Full Disk Access. Send mode does not read chat.db.

Read mode (opt-in, high-permission)

Required for: pulling thread history, searching past messages, triaging recent texts.

Cost: Reading ~/Library/Messages/chat.db requires Full Disk Access for Terminal. FDA is a broad, system-level permission. Once granted, the terminal binary can read all protected user data (Photos, Health, banking caches, and more), not just iMessages. This is the OS design, not a skill choice.

Before invoking read mode for the first time in a session, warn the user once:

Heads up: reading iMessages needs Full Disk Access on Terminal, which is a broad permission. Send-only mode doesn't need it. Want me to proceed with read access, or stick to drafts and sends?

If the user confirms, proceed:

# Copy first to avoid locking conflicts with Messages.app
cp ~/Library/Messages/chat.db /tmp/chat.db.snap
sqlite3 /tmp/chat.db.snap "SELECT datetime(message.date/1000000000 + 978307200, 'unixepoch', 'localtime') as ts, handle.id as sender, message.is_from_me, message.text FROM message LEFT JOIN handle ON message.handle_id = handle.ROWID WHERE message.text IS NOT NULL ORDER BY message.date DESC LIMIT 20;"
rm /tmp/chat.db.snap

Schema notes:

  • message.date is nanoseconds since 2001-01-01 UTC. Convert: date/1000000000 + 978307200 gives Unix epoch.
  • handle.id is the other party's phone or Apple ID.
  • message.is_from_me is 1 if you sent it, 0 if received.
  • message.text is null for attachment-only messages and reactions; check the attributedBody blob for newer iOS versions.
  • Threads/conversations live in the chat table joined via chat_message_join.

Always copy chat.db to /tmp first, query the copy, delete the copy. Direct queries against the live file can lock when Messages.app is open.

Recipient lookup

When the user says "text Alex", resolve the contact:

  1. If you already have the person's phone (E.164) or Apple ID, use it.
  2. You can keep a simple lookup file at ~/.claude/data/contacts.json mapping names to handles, and read it if it exists. Do not create it if it is missing.
  3. If the person is not found, ask once: "What's [name]'s phone or Apple ID?"

Do NOT scrape Contacts.app via AppleScript without confirming; that adds another permission surface.

Hard rules

  • Drafts only by default. Never send without an explicit "send it" from the user in the same turn.
  • One recipient at a time unless the user says "group" or names multiple people. A group send needs the existing chat's identifier (AppleScript can't address a group by member list alone), so confirm the exact target before sending.
  • Never auto-reply to incoming messages. Read mode is read-only; deciding what to answer is the user's call.
  • If AppleScript send fails (no Automation permission, Messages.app not running, recipient not on iMessage), surface the error and the draft so the user can paste manually.
  • Do not store message bodies in any log or cache.

First-run setup

When the user first invokes this skill, check whether permissions are configured. If osascript -e 'tell application "System Events" to return name of every process' fails with a permission error, the Automation permission isn't granted yet. Direct the user to:

System Settings, Privacy & Security, Automation, Terminal (or iTerm), enable Messages

For read mode, additionally:

System Settings, Privacy & Security, Full Disk Access, enable Terminal (or iTerm)

After granting, the terminal app must be fully quit and relaunched. The Claude Code session needs to restart inside the newly-permissioned terminal.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.