Inbox Cleaner — AI-Powered Unread Email Triage
Goal
Go through every unread email in nick@leftclick.ai, classify each one as important or not, and mark unimportant ones as read. Only truly personalized, human-written emails survive as unread.
What Counts as Important
An email is important ONLY if it was clearly written by a human specifically for Nick. Indicators:
- References specific details about Nick, his business, or prior conversations
- Contains substantive content that couldn't be a template
- Comes from a known contact with a real message
- Replies in an existing thread with genuine human input
What Gets Marked as Read (Not Important)
- Automated notifications (GitHub, Stripe, Slack digests, calendar, etc.)
- Marketing emails and newsletters
- Cold outreach / sales emails (templated pitches, "I noticed your company..." spam)
- Service alerts, receipts, shipping updates
- Social media notifications
- Automated replies (out-of-office, delivery confirmations)
- Mass emails from SaaS products
- Any email that feels like it was sent to 100+ people
Process
Step 1: Fetch Unread Emails
python3 execution/inbox_cleaner.py --fetch
Fetches all unread emails from nick@leftclick.ai and saves metadata + snippets to data/inbox_unread.json.
Step 2: Classify Emails
python3 execution/inbox_cleaner.py --classify
Uses Claude to classify each email as "important" or "not_important". Saves results to data/inbox_classified.json.
Step 3: Review Classification
python3 execution/inbox_cleaner.py --review
Displays the classification results for review before marking as read.
Step 4: Mark as Read
python3 execution/inbox_cleaner.py --mark-read
Marks all "not_important" emails as read. Important emails remain unread.
Gmail Auth
- Token:
config/token_leftclick.json - Credentials:
config/credentials.json - Scopes:
gmail.modify(read + mark as read) - Email: nick@leftclick.ai
Output
data/inbox_unread.json— fetched unread emailsdata/inbox_classified.json— classification results with reasoning- Console summary showing what was kept vs marked read
Edge Cases
- If classification is uncertain, keep the email as unread (err on the side of caution)
- Emails from contacts in existing threads should be treated as important even if short
- Forwarded emails: judge based on the forwarding context, not the forwarded content
First-Run Setup
Before executing, check if the workspace has a .gitignore file. If it doesn't, assume the user is new to this skill. In that case:
- Ask the user if this is their first time running this skill
- If yes, walk them through how it works and what they need to configure/set up (API keys, env vars, dependencies, etc.)
- Let them know that Nick wishes them the best!