An iMessage assistant that monitors for messages and responds using the full power of Claude Code.
This plugin adds iMessage capabilities to Claude Code, allowing you to:
- Read and send iMessages via command-line tools
- Run a daemon that monitors incoming messages from a specific contact
- Trigger autonomous agent sessions where Claude can work on tasks, check for follow-up messages, and send multiple replies
- Use the full Claude Code ecosystem - the agent has access to all your skills, tools, and resources
The daemon creates a continuous conversation thread with Claude Code over iMessage, making it accessible from iPhone, iPad, Mac, or Apple Watch.
- macOS with Messages app signed in to iMessage
- Claude Code installed (get Claude Code)
- Full Disk Access permission for Terminal (System Preferences > Security & Privacy > Privacy > Full Disk Access)
# In any Claude Code session
/plugin marketplace add dvdsgl/claude-imessage
/plugin install imessage@dvdsglCreate a configuration file with the contact details of the person who will message the agent (the agent will respond to messages from this contact):
# Create config file
cat > ~/.claude-imessage.env << 'EOF'
export IMESSAGE_CONTACT_PHONE="4155551234" # Their phone number (digits only)
export IMESSAGE_CONTACT_NAME="John Doe" # Their name
export IMESSAGE_CONTACT_EMAIL="john@example.com" # Optional: their iMessage email
EOF
# Load the configuration
source ~/.claude-imessage.envIn any Claude Code session:
/imessage-daemon startThe daemon is now running and monitoring for messages from your configured contact!
Send an iMessage from your configured contact's phone, and watch Claude respond autonomously.
/imessage-daemon status # Check if running and view logs
/imessage-daemon stop # Stop the daemon
/imessage-daemon start # Start the daemonThe plugin includes a comprehensive iMessage skill with tools for:
- Reading messages: Access message history and conversation context via SQLite database
- Sending messages: Send to contacts, phone numbers, or group chats
- Checking new messages: Monitor for incoming messages
- File attachments: Send and receive files, images, documents
- Conversation management: List conversations, get chat identifiers
See skills/imessage/SKILL.md for complete documentation.
The daemon monitors iMessages and automatically:
- Detects new messages from a configured contact
- Starts an autonomous Claude Code agent session
- Sends multiple messages as it works on tasks
- Checks for new messages every 30-60 seconds
- Maintains conversation continuity across sessions
The agent has access to all Claude Code capabilities including other skills, tools, and can perform complex multi-step tasks autonomously.
Once installed, you can use iMessage tools in any Claude Code conversation:
# Read recent messages from a contact
claude -p "Use the imessage skill to read my recent messages from 4155551234"
# Send a message
claude -p "Use the imessage skill to send a message to 4155551234 saying 'Hello!'"
# Check for new messages
claude -p "Use the imessage skill to check if I have any new messages"When the daemon receives a message, it:
- Starts a Claude Code agent with your message as the prompt
- Provides full context: Recent conversation history, available skills/tools
- Runs autonomously: The agent can:
- Send multiple messages as it works
- Check for new messages from you
- Use any Claude Code skills (calendar, files, APIs, etc.)
- Break down complex tasks into steps
- Ask for clarification when needed
- Maintains continuity: Uses conversation resume to maintain context across sessions
The daemon uses Claude Code's conversation resume feature:
- First message starts a new conversation
- Subsequent messages resume the same conversation ID
- Full history is available across all agent sessions
- Conversation ID saved in
~/tmp/imessage/imessage_claude_conversation_id.txt
You: "What's on my calendar today?"
Claude: "Let me check your calendar..."
Claude: "You have 3 events today:
- 9am: Team standup
- 2pm: Product review
- 4pm: 1:1 with Sarah"
You: "Remind me to prepare slides before the product review"
Claude: "I'll create a reminder..."
Claude: "Done! Added a reminder for 1:30pm to prepare slides."
Configure the daemon via environment variables in ~/.claude-imessage.env:
| Variable | Required | Description |
|---|---|---|
IMESSAGE_CONTACT_PHONE |
Yes | Phone number of the person who will message the agent (digits only) |
IMESSAGE_CONTACT_NAME |
Yes | Name of the person who will message the agent |
IMESSAGE_CONTACT_EMAIL |
No | iMessage email of the person (if they use email for iMessage) |
IMESSAGE_CHECK_INTERVAL |
No | Check interval in seconds (default: 1) |
IMESSAGE_TMP_DIR |
No | Directory for logs (default: ~/tmp/imessage) |
# ~/.claude-imessage.env
export IMESSAGE_CONTACT_PHONE="4155551234"
export IMESSAGE_CONTACT_NAME="Alice Smith"
export IMESSAGE_CHECK_INTERVAL="1"
export IMESSAGE_TMP_DIR="$HOME/tmp/imessage"Load before starting the daemon:
source ~/.claude-imessage.env
/imessage-daemon start- The daemon has full access to your iMessage database
- Claude Code can send messages on your behalf
- Environment variables may contain sensitive phone numbers
- Logs may contain message content
- Only run the daemon in trusted environments
- Be mindful of which contact you monitor
