imsg
Skill7 starsChanged 5 months agoMITView on GitHub
Read, search, send, poll, and wait on iMessages on macOS via the imsg CLI. Use when asked to check texts/iMessages, message someone, wait for a reply, send a file over iMessage, or monitor a conversation from a script or agent. Requires macOS with Full Disk Access granted to the terminal.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- liberya/openclaw-teamtheir own version, first seen Mar 22, 2026
- hkyutong/OneClawtheir own version, first seen Mar 19, 2026
- unisone/openclaw-configtheir own version, first seen Feb 19, 2026
- overkillkulture/nero-openclaw-skillstheir own version, first seen Feb 10, 2026
- seedprod/openclaw-prompts-and-skillstheir own version, first seen Jan 31, 2026
Used with
Projects with it also use healthcheck.
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.
overkillkultureSkillhealthcheck
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- seedprod/openclaw-prompts-and-skills★ 93same name
- unisone/openclaw-config★ 13same name
- liberya/openclaw-team★ 4same name
- hkyutong/OneClaw★ 1same name
- overkillkulture/nero-openclaw-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Always pass --json. It is the stable machine contract: no ANSI, ISO dates, fixed field names.
- Very specific: line 78
Run it as a background command and watch stdout for the "type":"message" line: in Claude Code, the Monitor tool watching the background …
- Distinctive: line 85
When the monitor is started shortly after a separate one-shot read, add a bounded replay window so the handoff cannot miss an intervening …
- Very specific: line 104
When confirmSend is enabled, sends require --yes.
- Very specific: line 105
Use --dry-run to validate a send with zero side effects (works with text and files).
- Very specific: line 127
Run imsg doctor --json first.
“Common” is measured: kept by at least 6 in 10 of the 5 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.
Files
imsg — iMessage CLI for agents
When to use
- Reading, searching, or summarizing iMessage conversations on this Mac.
- Sending a text or file attachment to a handle (phone/email) or chat GUID.
- Waiting for a reply (blocking
watch --timeoutor non-blockingpollloop).
When NOT to use
- Non-macOS systems (the CLI reads
~/Library/Messages/chat.dband drives Messages.app). - Group MMS edge cases (RCS/MMS group behavior is not guaranteed).
- Anything requiring message deletion or editing — the db is opened read-only.
Agent rules
- Always pass
--json. It is the stable machine contract: no ANSI, ISO dates, fixed field names. Never parse human output. - Branch on exit codes:
| Code | Meaning |
| 0 | success / new messages |
| 1 | error (bad target, missing file, unreadable db, invalid config) |
| 2 | usage error OR blocked by safety policy (JSON has error + blocked: true when policy-blocked) |
| 3 | poll: no new messages |
| 124 | watch: timed out with no new message |
- Disambiguate exit 2 via stdout: policy blocks emit
{"error": "...", "blocked": true}; usage errors print a usage line to stderr.
Wait-for-reply loop (poll + cursor)
Bootstrap once (returns the current cursor, exit 3, no messages):
imsg poll --json
# => { "chat": null, "messages": [], "cursor": { "rowid": 48291, "ts": "..." } }Then loop: sleep N seconds, poll from the saved cursor, scoped to the handle you are waiting on:
imsg poll +14085551234 --since-rowid 48291 --json- Exit 0: new messages — process
messages[], save the newcursor.rowid. - Exit 3: nothing yet — keep waiting with the same cursor.
- The cursor never re-emits a message and never skips one; when
--limittruncates, the cursor points at the last emitted message so the next call resumes exactly there.
Alternative single blocking wait:
imsg watch +14085551234 --timeout 300 --json- Exit 0: stdout is one
{ chat, messages, cursor }object with the new messages. - Exit 124: timed out;
messagesis empty,cursoris current.
Monitoring / waiting for messages
For agent harnesses that watch a background process's output rather than
polling a script, use imsg stream — a long-running NDJSON event stream
(one JSON object per stdout line, no ANSI, no human formatting):
imsg stream --from +14085551234 --max-events 1 --timeout 600Run it as a background command and watch stdout for the "type":"message"
line: in Claude Code, the Monitor tool watching the background shell's
stdout; in other harnesses, tail the background process's output until a
matching line appears or the process exits. Exits 0 once --max-events is
hit, 124 on --timeout with no match, 2 if policy-blocked. See
references/commands.md for the full event schema.
When the monitor is started shortly after a separate one-shot read, add a bounded replay window so the handoff cannot miss an intervening message:
imsg stream --chat-id 12 --from +17739974600 --lookback 2m--lookback applies the same chat, sender, and text filters to historical and
live rows. Historical message events add "replay": true; live event shape is
unchanged. Do not use it to bypass allowlist blocks or Full Disk Access.
Send safety
- Confirm the recipient handle with the user before any real send.
- Optional advanced config at
~/.config/imsg/config.jsoncan restrict imsg to an allowlist of handles/chats ({ "allowlist": [...], "confirmSend": true }); by default (no config file) everything is unrestricted. When a block does occur (exit 2,blocked: true), surface it to the user — do NOT retry or work around it. - When
confirmSendis enabled, sends require--yes. - Use
--dry-runto validate a send with zero side effects (works with text and files). - Messages over 500 chars require
--forcein interactive human mode.
Attachments
Send a file (with or without text):
imsg send +14085551234 --file /absolute/path/pic.jpg --json
imsg send +14085551234 "see attached" --file ~/Desktop/doc.pdf --jsonIncoming attachments appear in read/recent/poll/watch JSON as:
"attachments": [{ "filename": "~/Library/Messages/Attachments/...", "mimeType": "image/heic", "transferName": "IMG_0001.heic", "resolvedPath": "/Users/me/Library/Messages/Attachments/..." }]resolvedPath is the absolute on-disk path (may be null if not downloaded).
Troubleshooting
Run imsg doctor --json first. Five checks: chat.db access, osascript,
Messages.app, runtime, config.
chat.db accessfailing = the terminal lacks Full Disk Access (System Settings > Privacy & Security > Full Disk Access, then restart the terminal).osascriptfailing or send errors = Automation permission for Messages.app not granted (System Settings > Privacy & Security > Automation).- Env overrides:
IMESSAGE_DB_PATH(alternate chat.db),IMSG_CONFIG_PATH(alternate safety config).
Full command/flag/exit-code and JSON-shape reference: references/commands.md. Copy-paste patterns for common use cases: references/recipes.md.
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
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.

