sms

Extract SMS verification codes and recent messages from macOS Messages database.

1|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/zhiyuan-zhang0206/Ava --skill sms-zhiyuan-zhang0206
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sms
Source: https://github.com/zhiyuan-zhang0206/Ava/tree/main/ava_builtins/skills/sms
Command: npx skills add https://github.com/zhiyuan-zhang0206/Ava --skill sms-zhiyuan-zhang0206

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When a login flow demands a 2FA or OTP code sent by text message, agents and users normally have to stop and manually read the code from their phone. This Skill reads recent SMS and iMessage verification codes directly from the macOS Messages database so automated workflows can proceed without interrupting the user. ## Core Features & Use Cases - Verification Code Extraction: Detects 2FA codes in English, Chinese, Korean, and Japanese, plus Google-style (G-XXXXXX) and standalone 4-8 digit sequences. - Flexible Filtering: Filter by sender phone number suffix, adjust the lookback window in hours, and limit result counts. - Recent Message Inspection: List recent SMS messages with sender, timestamp, and direction for general message review. - Use Case: An agent hits a bank login that texts a one-time passcode; it runs the script with --recent-codes and immediately retrieves the code to complete authentication. ## Quick Start Ask the agent to fetch the most recent SMS verification code from your Mac's Messages app, optionally filtered by the sender's last four phone digits.

Frequently Asked Questions about sms

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read SMS verification codes on macOS from the command line?▼

Run the query script with the --recent-codes flag using the project venv Python. It reads ~/Library/Messages/chat.db directly and prints one code-bearing message per line, newest first, with optional phone-suffix and lookback filters.

How to filter SMS messages by sender phone number?▼

Pass the --phone-suffix argument with the last digits of the sender's number, for example --phone-suffix 1118. The script matches handles ending with those digits and returns only messages from that sender.

Does reading macOS Messages database require special permissions?▼

Yes, the calling process needs Full Disk Access granted in System Settings under Privacy & Security. Without it, macOS TCC blocks the read and the script fails fast with a sqlite3 OperationalError rather than falling back.

Can this read iMessages or only SMS texts?▼

The script queries only rows where the service is SMS in the Messages database, so it returns SMS texts rather than iMessage-to-iMessage traffic. Verification codes sent as SMS are fully covered.

Why does the SMS query fail with a sqlite3 OperationalError?▼

The error occurs when macOS TCC denies access to chat.db because the calling process lacks Full Disk Access. Grant the permission in System Settings and rerun; there is no fallback path by design.

What languages of verification codes are detected?▼

The regex patterns detect codes in English (verification code, OTP), Chinese (验证码, 校验码), Korean (인증번호), and Japanese (認証コード), plus Google-style G-XXXXXX codes and standalone 4-8 digit sequences.