imsg

imsg is a skill for Claude Code, Codex from openclaw/nix-openclaw-tools. It costs 37 tokens per session (2,576 once invoked), scanned A, original, MIT.

A command-line interface for using the macOS Messages account to inspect and manage iMessage and SMS conversations. It supports direct messages, groups, files, replies, reactions, polls, and message monitoring.

In plain words
What is it for?
Reading message history, selecting chats, sending messages or files, replying, reacting, voting in polls, and watching conversations.
Why use it?
It lets an agent work with Messages.app conversations through stable chat and message identifiers while reducing the risk of sending to the wrong conversation.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

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/openclaw/nix-openclaw-tools/imsg
Any agent
npx skills add openclaw/nix-openclaw-tools --skill imsg
Clone the repo
git clone --depth 1 https://github.com/openclaw/nix-openclaw-tools

Made for: Claude Code, Codex.

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 imsg

README.md
[![agentmods](https://agentmods.dev/badge/skills/openclaw/nix-openclaw-tools/imsg.svg)](https://agentmods.dev/skills/openclaw/nix-openclaw-tools/imsg)
Your own site
<a href="https://agentmods.dev/skills/openclaw/nix-openclaw-tools/imsg"><img src="https://agentmods.dev/badge/skills/openclaw/nix-openclaw-tools/imsg.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,576 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.00037 $0.02576
Opus 5 $0.00018 $0.01288
Sonnet 5 $0.00007 $0.00515
Haiku 4.5 $0.00004 $0.00258

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

Security

Grade A, and why

imsg 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.

tools/imsg/skills/imsg/SKILL.md · 250 lines

How it starts

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

imsg

Use imsg when an OpenClaw agent must act through the user's local macOS Messages.app account: inspect iMessage/SMS history, choose the correct DM or group, send messages/files, reply, react, vote in polls, or use private-API iMessage features.

Do not use this skill for Telegram, Signal, WhatsApp, Discord, Slack, or for replying inside the current OpenClaw conversation when the configured channel already routes the reply.

Agent Flow

  1. Resolve the conversation first.
  2. Choose DM, existing group, or new group.
  3. Pick the lowest-capability command that can do the requested action.
  4. Confirm any send or visible state change unless the user already gave exact recipient, content, and action.
  5. Execute with stable identifiers: prefer --chat-id for normal sends/watch/history and --chat chat GUID for bridge actions.

Never infer a recipient from a casual name alone when several chats or handles could match. Show the matched display name, handle(s), group participants, and message text/action before sending.

Host Requirements

  • macOS 14+ with Messages.app signed in for send/react/bridge actions.
  • Full Disk Access for the process context that runs imsg or OpenClaw; reads fail without Messages DB access.
  • Automation permission for Messages.app when using public send.
  • Accessibility permission for the process context that runs public imsg react; it uses System Events UI automation. Bridge tapback uses private API instead.
  • Optional Contacts permission for contact-name resolution.
  • SMS sends require Text Message Forwarding from the user's iPhone to this Mac.
  • Linux reads a copied chat.db only; it cannot send, react, launch Messages.app, mark read, or type.

Resolve Targets

Use --json reads. Output is newline-delimited JSON; use jq -s when jq is available, or consume one object per line directly.

imsg chats --limit 25 --json | jq -s
imsg search --query "dinner" --match contains --json | jq -s
imsg history --chat-id 42 --limit 20 --attachments --json | jq -s
imsg group --chat-id 42 --json

Read the full file on GitHub · 250 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. 6d ago First seen · 250 lines · 37 tokens per session scan A ab9ec1885a75

Subscribe to this mod's changes

imsg is a skill published in the GitHub repository openclaw/nix-openclaw-tools (53 stars, last pushed yesterday), licensed MIT. It adds 37 tokens to every session and 2,576 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens