Skip to main content
Build an agent that categorizes incoming emails and generates summaries.

What you’ll build

An email assistant that:
  1. Reads emails from your inbox
  2. Categorizes them (urgent, FYI, action required, etc.)
  3. Generates daily summaries

Prerequisites

  • Airstore installed and authenticated
  • Gmail connected (airstore connect gmail)
  • Claude Code installed

Step 1: Create smart folders by category

# Urgent emails
airstore create sources/gmail/urgent \
  --query "unread emails marked important or from executives"

# Emails requiring action
airstore create sources/gmail/action-required \
  --query "unread emails with questions or requests"

# FYI emails
airstore create sources/gmail/fyi \
  --query "unread emails that are newsletters or updates"

# All recent emails for daily digest
airstore create sources/gmail/today \
  --query "emails from today"

Step 2: Mount and review

airstore mount ~/airstore
cd ~/airstore/sources/gmail

Step 3: Generate a daily summary

claude "Review today's emails and create a summary:
1. List urgent items that need immediate attention
2. List items requiring action with deadlines
3. Summarize FYI items in 1-2 sentences each
4. Flag any emails that might be miscategorized"

Example output

# Email Summary - January 15, 2024

## 🔴 Urgent (2 emails)
1. **CEO: Q4 Board Deck Review** - Needs feedback by EOD
2. **Security Alert** - Unusual login attempt detected

## 📋 Action Required (4 emails)
1. **HR: Benefits enrollment** - Deadline: Jan 20
2. **Client: Contract revision** - Waiting for your approval
3. **Team: Sprint planning** - Please add your items by tomorrow
4. **Finance: Expense report** - Missing receipts for Dec travel

## 📰 FYI (6 emails)
- Engineering newsletter: New CI/CD pipeline deployed
- Company all-hands recording available
- Industry news digest
- 3 promotional emails (filtered)

## ⚠️ Possibly Miscategorized
- "Re: Quick question" from [email protected] - Might be urgent, 
  mentions "deadline Friday"

Automating daily digests

Create a script for daily summaries:
#!/bin/bash
# daily-digest.sh

# Sync latest emails
airstore sync sources/gmail/today
airstore sync sources/gmail/urgent
airstore sync sources/gmail/action-required

# Generate summary
cd ~/airstore/sources/gmail

SUMMARY=$(claude "Create a daily email summary. Be concise." --print)

# Post to Slack
echo "$SUMMARY" | ~/airstore/tools/slack post \
  --channel="#daily-digest" \
  --stdin
Schedule with cron:
# Run at 8 AM every weekday
0 8 * * 1-5 /path/to/daily-digest.sh

Creating Linear tickets from emails

Turn action items into tickets:
cd ~/airstore/sources/gmail/action-required

claude "For each email that represents a task:
1. Extract the task description
2. Identify the deadline if mentioned
3. Create a Linear issue using the linear tool

Use ~/airstore/tools/linear create-issue for each task."

Filtering by sender

Create smart folders for specific senders:
# Investor emails
airstore create sources/gmail/investors \
  --query "emails from investors or VCs"

# Customer emails
airstore create sources/gmail/customers \
  --query "emails from @customer1.com or @customer2.com"

# Team emails
airstore create sources/gmail/team \
  --query "emails from @company.com"

Weekly report

Generate a weekly summary:
airstore create sources/gmail/this-week \
  --query "emails from the last 7 days"

cd ~/airstore/sources/gmail/this-week

claude "Create a weekly email report:
1. Key threads and their status
2. Outstanding action items
3. Important decisions made
4. Upcoming deadlines mentioned"

Next steps