multiAI EnrichedWorkflow & Productivity

gclaw

GClaw provides Gmail inbox intelligence for AI agents, reading, classifying, and digesting emails to surface important information without the noise. It uses a zero-LLM-token heuristic classifier for efficiency.

3,556 stars
Complexity: medium

About this skill

GClaw is an AI agent skill designed for OpenClaw and similar coding agent environments, offering comprehensive Gmail inbox intelligence. It automates the process of fetching, parsing, classifying, and storing emails, ensuring that only the most relevant messages come to an agent's attention. Key features include a BotContext for per-bot label isolation, an EmailFetcher to retrieve new and deduplicated emails, an EmailParser, and an EmailClassifier that categorizes messages into 15 predefined types like 'newsletter', 'finance', 'work', and 'action_required'. All classified emails can be stored in a deduplicated JSONL format by the EmailStore. This skill is highly useful for various applications such as building automated inbox digests, creating custom email classification systems, or powering downstream bots that require structured email data. Its primary advantage is the use of a heuristic classifier, which enables rapid and cost-effective email categorization without consuming LLM tokens for this core task. LLMs are only engaged when a more nuanced summary or digest narrative is specifically requested. By leveraging GClaw, AI agents can efficiently manage email workflows, prioritize critical communications, and transform a cluttered inbox into an organized data stream. It enhances agent productivity by reducing manual email processing and focusing on actionable information, making it an indispensable tool for automated email management.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gclaw/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/yhyatt/gclaw/SKILL.md"

Manual Installation

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

How gclaw Compares

Feature / AgentgclawStandard Approach
Platform SupportmultiLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

GClaw provides Gmail inbox intelligence for AI agents, reading, classifying, and digesting emails to surface important information without the noise. It uses a zero-LLM-token heuristic classifier for efficiency.

Which AI agents support this skill?

This skill is compatible with multi.

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

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

# GClaw — Gmail Intelligence for OpenClaw

<div align="center">
<img src="assets/banner.jpg" alt="GClaw — Gmail inbox intelligence" width="100%">
</div>

Reads, classifies, and digests your Gmail so the important stuff surfaces without the noise.

**Zero LLM tokens for classification** — heuristic classifier covers 15 categories. LLM only fires when you need a summary or digest narrative.

## Setup

```bash
# Requires the gog skill (Google OAuth CLI)
export GCLAW_GMAIL_ACCOUNT="your@gmail.com"
export GOG_KEYRING_PASSWORD="your-keyring-password"

pip install -e .
```

## Quick Usage

```python
from kaimail.bot_context import BotContext
from kaimail.fetcher import EmailFetcher
from kaimail.classifier import EmailClassifier
from kaimail.store import EmailStore

# Each bot declares its own label scope
ctx = BotContext(
    bot_id="digest",
    allowed_labels=["INBOX", "CATEGORY_UPDATES"],
    max_results=50
)

fetcher = EmailFetcher(context=ctx)
emails = fetcher.fetch_new()  # deduped — never processes the same email twice

classifier = EmailClassifier()
store = EmailStore(bot_id="digest")

for email in emails:
    email.category = classifier.classify(email)
    store.save(email)
    print(f"[{email.category}] {email.subject}")
```

## Classification Categories (15)

`newsletter` · `finance` · `travel` · `work` · `action_required` · `social` ·
`shopping` · `security` · `calendar` · `health` · `legal` · `ads` · `receipt` · `personal` · `other`

All heuristic — no LLM cost.

## Architecture

```
Gmail (via gog CLI)
    └─► EmailFetcher      — fetch, cache, deduplicate
        └─► EmailParser   — extract sender, clean body, detect forwards
            └─► EmailClassifier  — 15-category heuristic classification
                └─► EmailStore  — JSONL persistence (per bot_id)
```

## BotContext — Per-Bot Isolation

Multiple bots can share one Gmail account without interfering:

```python
# Digest bot — only newsletters + inbox
digest_ctx = BotContext(bot_id="digest", allowed_labels=["Thoughts", "INBOX"])

# Travel bot — only travel senders
travel_ctx = BotContext(
    bot_id="travel",
    allowed_labels=["Travel"],
    allowed_senders=["booking.com", "airbnb.com", "kayak.com"]
)
```

## Running Tests

```bash
pip install pytest
pytest tests/
```

## Requirements

- Python 3.10+
- [gog skill](https://clawhub.com/skills/gog) installed and authenticated
- `GOG_KEYRING_PASSWORD` env var set

## License

MIT