I wanted to play around with Claude Code and see what I could build in just a few hours, the result was GmailDraft, an email assistant that connects to your Gmail inbox and acts like an auto-reply, generating draft responses using GPT-4 based on the context you provide.
What GmailDraft is about
GmailDraft works silently in the background, analyzing incoming emails, understanding their intent, and creating contextual draft replies that appear directly in your Gmail drafts folder. No new interface to learn everything happens within Gmail itself.

Key features
- 🤖 AI-Powered → Uses GPT-4 to understand email context and generate relevant responses
- ⚡ Automatic → Works in the background with no manual intervention needed
- 🔒 Privacy-First → Email content is never stored, only processed
- 🎨 Customizable → Configure tone, add FAQs, and personalize responses
- 📱 Native Gmail → Drafts appear directly in Gmail
Technical overview
The architecture is intentionally simple but effective:
- Next.js → Full-stack framework with API routes
- Gmail API → OAuth 2.0, Watch API, and Drafts integration
- OpenAI GPT-4 → Email analysis and response generation
- Google Pub/Sub → Real-time email notifications
- SQLite + Prisma → User preferences and activity logs
The flow is straightforward: Gmail Watch API → Pub/Sub webhook → GPT-4 analysis → Draft creation.

Quick setup
With the proper Google Cloud and OpenAI configuration, setting up GmailDraft is straightforward. Just set the required environment variables:
# Core Setup
DATABASE_URL="file:./dev.db"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-nextauth-secret"
# Google Integration
GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="your-client-secret"
# AI & Cloud Services
OPENAI_API_KEY="sk-proj-your-api-key"
GOOGLE_CLOUD_PROJECT_ID="your-project-id"
PUBSUB_TOPIC="projects/your-project-id/topics/gmail-notifications"
WEBHOOK_URL="https://yourdomain.com/api/gmail/webhook"
Once configured, everything should work seamlessly.
Understanding agent-based tools by building it
GmailDraft helped me explore how agent-based tools can automate tasks while keeping humans in control. The AI monitors emails, drafts responses, and lets the user review, showing how agents can act autonomously without taking over.
The most impressive part? The MVP was built incredibly fast using Claude Code.
Try it yourself
Website → gmaildraft.com GitHub Repository → github.com/paabloLC/gmail-ai-draft