Skills gws-gmail-watch
📦

gws-gmail-watch

Safe

Monitor Gmail for New Emails

Stop missing important emails. This skill helps you monitor Gmail in real-time and stream new messages as structured data for automated processing.

Supports: Claude Codex Code(CC)
🥉 73 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "gws-gmail-watch". Watch my Gmail inbox for new emails

Expected outcome:

  • Setting up Gmail watch for INBOX...
  • Pub/Sub topic created: projects/my-project/topics/gmail-watch
  • Subscription created: projects/my-project/subscriptions/gmail-watch-sub
  • Watching for new emails (press Ctrl-C to stop)...
  • Received message: {"historyId":"12345","email":{"id":"msg123","threadId":"thread456","snippet":"Hello..."}}

Using "gws-gmail-watch". Watch unread emails once and exit

Expected outcome:

  • Pulling messages from label INBOX,UNREAD...
  • Pulled 3 messages
  • Processing complete
  • Run again to renew watch (expires in 7 days)

Security Audit

Safe
v1 • 4/21/2026

Static analysis detected 20 potential security issues, all of which are false positives after manual review. The external_commands detections are documentation code blocks (bash examples), filesystem detections are markdown hyperlink references (../ paths), and weak crypto detections are false positives on version numbers. This is documentation-only content with no executable code.

1
Files scanned
60
Lines analyzed
2
findings
1
Total audits
Low Risk Issues (2)
Documentation Code Blocks Trigger Static Scanner
Static scanner flagged 15 external_commands patterns in SKILL.md lines 16, 22-39, 43. These are markdown code blocks containing bash command examples (gws gmail +watch), not executable code. No actual command execution occurs.
Markdown Hyperlinks Trigger Path Traversal Scanner
Static scanner flagged 3 filesystem patterns at SKILL.md lines 16, 58, 59. These are relative path references in markdown links (e.g., ../gws-shared/SKILL.md) for navigation, not actual filesystem operations.
Audited by: claude

Quality Score

38
Architecture
100
Maintainability
87
Content
50
Community
100
Security
83
Spec Compliance

What You Can Build

Automated Email Processing Pipeline

Set up real-time monitoring to catch important emails and trigger automated workflows like extracting data from receipts, invoices, or notifications.

Customer Support Response Monitor

Watch for high-priority support emails and alert the team instantly when critical messages arrive in the support inbox.

Personal Inbox Watchdog

Monitor personal Gmail for specific senders or labels and receive NDJSON output for logging or analysis in productivity tools.

Try These Prompts

Basic Inbox Watch
Watch my Gmail inbox for new emails and show them as they arrive. I want to see the output in the terminal.
Filter by Label
Watch only unread emails in my Gmail INBOX label. Pull messages every 10 seconds and stop after finding 5 messages.
Save to Files
Watch my Gmail for new emails and save each message to a separate JSON file in the ./emails directory. Clean up resources when done.
Use Existing Pub/Sub Subscription
Connect to my existing Pub/Sub subscription at projects/my-project/subscriptions/email-sub and pull messages once.

Best Practices

  • Use the --cleanup flag when testing to avoid leaving orphaned Pub/Sub resources in your GCP project
  • Renew your Gmail watch every 7 days to maintain uninterrupted monitoring
  • Start with --once flag to test your configuration before running the continuous watcher
  • Specify --label-ids to filter messages and reduce noise from irrelevant labels

Avoid

  • Do not run without --cleanup in production tests unless you want Pub/Sub resources to persist
  • Do not set --max-messages too high as it may cause memory issues with large email batches
  • Do not forget to set up proper GCP project permissions before running the watch command
  • Do not use --poll-interval below 1 second to avoid Gmail API rate limiting

Frequently Asked Questions

What does this skill actually do?
This skill monitors your Gmail inbox and streams new emails as NDJSON data. It uses Google Workspace CLI to set up push notifications via Pub/Sub and pulls messages as they arrive.
Do I need to install anything?
Yes, you need the gws CLI tool installed. This skill requires an external binary that is not included with Claude Code.
How long does the watch last?
Gmail watch subscriptions expire after 7 days. You must re-run the command to renew monitoring and continue receiving new emails.
What is NDJSON output format?
NDJSON means Newline-Delimited JSON. Each email appears as a separate JSON object on its own line, making it easy to parse with scripts or data tools.
Can I filter specific email labels?
Yes, use the --label-ids flag with comma-separated label names like INBOX,UNREAD, or custom label IDs to filter which emails trigger notifications.
What happens to Pub/Sub resources when I stop?
By default, Pub/Sub topics and subscriptions persist for reconnection. Use --cleanup to delete them automatically when you exit the watcher.

Developer Details

File structure

📄 SKILL.md