Gmail Classifier Plugin
Intelligent Gmail email classification and organization plugin with learning. Automatically categorize emails (receipts, newsletters, promotions) and organize your inbox with AI assistance.
Features
- Smart Classification: Automatically categorizes emails into receipts, newsletters, and promotions
- Confidence Scoring: Know how certain the classifier is about each categorization
- Learned Preferences: The plugin learns which senders you trust and which you want to block
- Safety-First: All actions require user confirmation before archiving (initially)
- Quality Tiers: Assess newsletters as high, medium, or low quality
- User Feedback Loop: Improves over time based on your decisions
- Expandable: Easy to add new categories as your needs grow
Installation
-
Clone/Download this plugin into your Claude Code plugins directory:
~/.claude/plugins/gmail-classifier/
-
Set up Gmail authentication:
-
Verify MCP Setup:
cd ~/.claude/plugins/gmail-classifier
cat .mcp.json # Verify gmail-mcp configuration
-
Load the plugin in Claude Code:
/help plugins
# or reload Claude Code session
Quick Start
1. Classify Your Inbox
/classify 15
This analyzes 15 recent unread emails and categorizes them:
- 📦 Receipts: High confidence, suggested action: archive
- 📰 Newsletters: Medium confidence, quality assessed
- 🎉 Promotions: Medium confidence, suggested action: archive
2. Review Suggestions
/review-suggestions
For each classified email, decide:
- ✅ Approve - Apply the suggested action
- ❌ Reject - Keep in inbox, ignore suggestion
- 📌 Learn - Remember this decision for future emails from this sender
3. Configure Your Preferences
/organize-config view
View your current configuration, or:
/organize-config edit
Edit to add:
- Trusted newsletter senders (keep in inbox)
- Senders to always archive
- Blocked domains (spam sources)
- Custom category patterns
Commands
/classify [count]
Analyze and classify recent unread emails.
/classify # Process 10 emails (default)
/classify 20 # Process 20 emails
/classify 50 # Process 50 emails
Output: Summary of found categories with confidence levels and suggested actions.
/review-suggestions
Review classified emails and make decisions.
Options:
- ✅ Approve - Apply suggested action
- ❌ Reject - Don't apply action
- 📌 Learn - Remember decision for this sender
- Skip - Review later
/organize-config [action]
Manage classification rules and preferences.
/organize-config view # Show current settings
/organize-config edit # Edit configuration
/organize-config reset # Reset preferences
Configuration
Settings are stored in .local.md with these sections:
Email Categories
Define how to classify each email type:
categories:
receipts:
confidence: high
action: archive
patterns: [order, receipt, invoice, confirmation]
common_domains: [amazon.com, ebay.com, stripe.com, paypal.com]
newsletters:
confidence: medium
action: review
quality_tiers: [high, medium, low]
patterns: [newsletter, digest, subscription]
promotions:
confidence: medium
action: archive
patterns: [sale, discount, offer, promo]
Learned Preferences
Track your decisions over time:
learned_preferences:
keep_newsletters:
- newsletter@techcrunch.com
- digest@morning.news
archive_newsletters:
- spam@promotional.com
keep_senders:
- boss@company.com
- friend@personal.com
blocked_domains:
- unwanted-spam.com
How It Works
Classification Process
- Pattern Matching: Check sender domain and keywords
- Confidence Scoring: Calculate likelihood (0-100%)
- Learned Preferences: Apply your learned rules
- Suggest Action: Recommend archive, review, or keep
- User Review: Show suggestions for your approval
Learning Loop
Classify Email
↓
Show Confidence + Suggestion
↓
User Feedback (Approve/Reject/Learn)
↓
Update Preferences
↓
Apply to Similar Emails (Next Time)
Quality Tiers for Newsletters
- 🌟 High: Keep in inbox (professional, well-researched, personalized)
- ⭐ Medium: Review periodically (decent content, standard templates)
- Low: Archive (generic, frequent, low engagement)
Examples
Organizing Receipts