gmail-unsubscribe

Identify and batch-unsubscribe from newsletters and marketing emails across Gmail accounts. Scans List-Unsubscribe headers, generates candidates, executes with user approval.

5 stars

Best use case

gmail-unsubscribe is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Identify and batch-unsubscribe from newsletters and marketing emails across Gmail accounts. Scans List-Unsubscribe headers, generates candidates, executes with user approval.

Teams using gmail-unsubscribe should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gmail-unsubscribe/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/email/_archived/gmail-unsubscribe/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/gmail-unsubscribe/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gmail-unsubscribe Compares

Feature / Agentgmail-unsubscribeStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Identify and batch-unsubscribe from newsletters and marketing emails across Gmail accounts. Scans List-Unsubscribe headers, generates candidates, executes with user approval.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Gmail Unsubscribe

Systematically identify and remove newsletter/marketing email subscriptions.

## Prerequisites

- himalaya configured (see `gmail-multi-account`)
- Contact CSVs with category tags

## Workflow

### Step 1: Identify newsletter senders

```bash
# Get recent emails, look for bulk senders
himalaya --account personal envelope list --page-size 200 --output json | \
  python3 -c "
import json, sys, collections
msgs = json.load(sys.stdin)
senders = collections.Counter(m.get('from','unknown') for m in msgs)
for sender, count in senders.most_common(50):
    if count >= 3:
        print(f'{count:4d}  {sender}')
"
```

### Step 2: Check List-Unsubscribe headers

```bash
# Export raw MIME to check headers
himalaya --account personal message export MESSAGE_ID --full | \
  grep -i "list-unsubscribe"
```

### Step 3: Classify unsubscribe candidates

Criteria for unsubscribe:
- Sender appears 3+ times in last 200 emails
- Sender NOT in VIP/client/personal contacts
- Has List-Unsubscribe header
- Content is marketing/promotional/newsletter

DO NOT unsubscribe from:
- Transactional emails (receipts, shipping, account security)
- Industry newsletters user values (check with user)
- Government/financial institution communications

### Step 4: Execute unsubscribe

For mailto: unsubscribe links:
```bash
cat << 'EOF' | himalaya --account personal template send
From: achantav@gmail.com
To: unsubscribe-address@sender.com
Subject: Unsubscribe

Unsubscribe
EOF
```

For URL unsubscribe links:
- Present URL to user to click manually (security — don't auto-click links)

### Step 5: Clean up

After unsubscribe confirmation:
```bash
# Move old newsletters to trash
himalaya --account personal message delete MESSAGE_ID
```

## Account-Specific Aggressiveness

### ace — Conservative
- Keep: industry digests (SPE, OTC, offshore), technical newsletters
- Unsubscribe: vendor marketing, recruiter spam
- Ask user about: LinkedIn notifications, conference promos

### personal — Aggressive
- Unsubscribe: social media notifications, shopping promos, app notifications
- Keep: banking alerts, subscription receipts, family-related
- Ask user about: news digests, hobby newsletters

### skestates — Moderate
- Unsubscribe: real estate marketing, property listing emails
- Keep: insurance, tax, legal, property management
- Ask user about: CRE investment newsletters

## Safety Rules

1. NEVER auto-unsubscribe without user approval — show candidate list first
2. NEVER click unsubscribe URLs programmatically — present to user
3. Log all unsubscribe actions to `~/.hermes/email-logs/unsubscribe-log.csv`
4. Batch limit: max 20 unsubscribes per session
5. Wait 24h after unsubscribe before deleting old messages (in case user reconsiders)

## Automation

Monthly sweep cron:
```
# First Monday of each month at 8 AM CT
0 8 1-7 * 1 hermes "Load gmail-unsubscribe. Scan personal account for new unsubscribe candidates. Report only — do not act."
```

Related Skills

gmail-triage

5
from vamseeachanta/workspace-hub

Daily multi-account Gmail inbox triage — scan unread, classify by urgency, cross-reference contacts, generate actionable digest. Supports ace/personal/skestates accounts.

gmail-outreach

5
from vamseeachanta/workspace-hub

Outbound email actions — periodic relationship touchbase messages and batch unsubscribe from newsletters/marketing. Combines gmail-touchbase + gmail-unsubscribe into one skill.

gmail-operations

5
from vamseeachanta/workspace-hub

Class-level Gmail and email operations: multi-account setup, OAuth, triage, extraction, archiving, attachments, unsubscribe, and touchbase workflows.

gmail-multi-account

5
from vamseeachanta/workspace-hub

Multi-account Gmail management via himalaya CLI. Three accounts (aceengineer, achantav, skestates) with distinct triage rules, contact DBs, and tone profiles. Foundation skill for email automation.

gmail-headless-oauth

5
from vamseeachanta/workspace-hub

Manual OAuth2 token exchange for Gmail on headless servers. Bypass gmail-mcp-multiauth browser requirement. Generate auth URLs, exchange codes, manage multi-account credentials with auto-refresh.

gmail-extract-and-act

5
from vamseeachanta/workspace-hub

The email-as-queue workflow — extract structured data from emails, act on it, track thread state, and delete emails when topics complete. Email is transient; extracted data is persistent.

gmail-attachment-to-document

5
from vamseeachanta/workspace-hub

Download attachments from Gmail threads, parse their content (Excel, PDF), extract structured data, and save to target repos with proper legal scanning.

gmail-touchbase

5
from vamseeachanta/workspace-hub

Periodic relationship maintenance via email — identify contacts due for outreach, draft personalized check-ins, queue for user approval. Supports per-account tone and cadence.

gmail-extract-archive

5
from vamseeachanta/workspace-hub

DEPRECATED — superseded by gmail-extract-and-act. Extract Gmail data into archive repo, parse attachments, legal scan, then delete. Uses archive-everything model.

gmail-extract-and-clean

5
from vamseeachanta/workspace-hub

DEPRECATED — superseded by gmail-extract-and-act. Extract emails from Gmail to /mnt/ace/<repo>/, archive to repos, commit, then delete. Uses archive-everything model.

gmail-email-to-repo-extraction

5
from vamseeachanta/workspace-hub

Extract structured data from Gmail inbox emails, enrich with domain-specific classification, legal-scan against deny list, commit to appropriate repo, then optionally delete originals.

gmail-data-extraction

5
from vamseeachanta/workspace-hub

Extract structured data from Gmail emails using REST API (no pip dependencies). Covers inbox scanning, subject line regex extraction, email text parsing, thread-aware drafting, and legal-scan-before-commit workflow.