Agent skill

Gmail Sync

by Alex8791-cyber in Alex8791-cyber/cognithor

API integration skill that fetches Gmail messages, syncs inbox labels, and processes attachments via the Gmail REST API.

Apache-2.0Auto-check passedProductivity & Automation

Install Gmail Sync

skills CLI
$ npx skills add Alex8791-cyber/cognithor --skill gmail-sync -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Alex8791-cyber/cognithor gmail-sync --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Alex8791-cyber/cognithor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/gmail_sync .claude/skills/gmail-sync && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gmail-sync
GitHub stars
158
Token cost
~435 tokens
SKILL.md length
119 words
Files
5
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

API integration skill that fetches Gmail messages, syncs inbox labels, and processes attachments via the Gmail REST API.

  • Works in 5 steps: Authenticate — obtain or refresh the… → Fetch new messages since the last sync… → Parse each message — extract sender,… → …
  • Fetching new emails
  • SKILL.md covers Steps, Example and Error Handling
  • Runs Python scripts from its folder

What it does

Gmail Sync is an agent skill from Alex8791-cyber/cognithor. API integration skill that fetches Gmail messages, syncs inbox labels, and processes attachments via the Gmail REST API. Use when fetching new emails, syncing inbox state, triaging unread messages, exporting mail data, or integrating Gmail into automated workflows.

Its SKILL.md is about 440 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files (for example `__init__.py`, `manifest.json` and `skill.py`).

It sits in Productivity & Automation, covering Email management. It works with Gmail. The repository describes itself as: Cognithor · Agent OS: Local-first autonomous agent operating system. 19 LLM providers, 18 channels, 145 MCP tools, 6-tier memory, Agent Packs marketplace, zero telemetry. Python… The licence is Apache-2.0.

When your agent uses it

  • Fetching new emails
  • Syncing inbox state
  • Triaging unread messages
  • Exporting mail data

Example prompts

  • “/gmail-sync”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Authenticate — obtain or refresh the OAuth2 token
  2. Fetch new messages since the last sync timestamp
  3. Parse each message — extract sender, subject, body, labels, and attachment metadata
  4. Store locally — persist parsed data under $COGNITHOR_HOME/data/gmail/ as JSON
  5. Return summary — the skill returns {"data": } with message counts

What it can do on your machine

Read from SKILL.md and the folder at commit 78212af. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gmail Sync loads about 435 tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 119 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~435

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Alex8791-cyber/cognithor at commit 78212af, republished under its Apache-2.0 licence (© Alex8791-cyber). 119 words, ~435 tokens.

Download SKILL.mdSave it as .claude/skills/gmail-sync/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
gmail-sync
description
API integration skill that fetches Gmail messages, syncs inbox labels, and processes attachments via the Gmail REST API. Use when fetching new emails, syncing inbox state, triaging unread messages, exporting mail data, or integrating Gmail into automated workflows.

Gmail Sync

Fetches Gmail messages, syncs labels, and processes attachments via the Gmail REST API using httpx. Requires network access.

Steps

  1. Authenticate — obtain or refresh the OAuth2 token:
    python
    headers = {"Authorization": f"Bearer {access_token}"}
  2. Fetch new messages since the last sync timestamp:
    python
    async with httpx.AsyncClient() as client:
        resp = await client.get(
            f"{API_BASE}/messages",
            headers=headers,
            params={"q": "after:{last_sync_epoch}"}
        )
        messages = resp.json().get("messages", [])
  3. Parse each message — extract sender, subject, body, labels, and attachment metadata
  4. Store locally — persist parsed data under $COGNITHOR_HOME/data/gmail/ as JSON
  5. Return summary — the skill returns {"data": <parsed_response>} with message counts

Example

User > Synchronisiere meine Gmail-Inbox
Cognithor > 14 neue Nachrichten synchronisiert (3 ungelesen, 2 mit Anhängen)
         Letzte Synchronisation: 2026-04-20 14:00 UTC

Error Handling

  • 401 Unauthorized: Token expired — trigger OAuth refresh flow before retrying
  • 429 Rate Limited: Back off exponentially (1s, 2s, 4s) up to 3 retries
  • Network timeout: Log the failure, preserve last-known state, report to user
  • Empty response: Confirm query parameters are correct; check last_sync_epoch is valid

© Alex8791-cyber, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in skills/gmail_sync of Alex8791-cyber/cognithor.

  • SKILL.md
  • __init__.py
  • manifest.json
  • skill.py
  • test_skill.py

Open the folder on GitHubat commit 78212af

Compare with similar skills

Gmail Sync next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gmail Sync compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gmail Sync this skillAlex8791-cyber/cognithor158—~435Automated safety check: PassApache-2.0
Gmail Emailopen-gitagent/gitagent713—~235Automated safety check: NotesMIT
Google Workspaceyc-software/qm15k—~1.8kAutomated safety check: PassMIT
Email Draftingmgonto/executive-assistant-skills118—~2.8kAutomated safety check: PassNone
Ak Dev New Messaging Integrationyaalalabs/agent-kernel192—~4.6kAutomated safety check: PassApache-2.0
Ak Add Integrationyaalalabs/agent-kernel192—~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • Gmail Email

    open-gitagent/gitagent

    Send emails via Gmail SMTP using App Password authentication.

    713 GitHub stars~235 tokensUpdated today
    Productivity & AutomationAuto-check: notes
  • Google Workspace

    yc-software/qm

    Read and act on the user's Gmail, Google Calendar, and Google Tasks through per-user OAuth.

    15k GitHub stars~1.8k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Email Drafting

    mgonto/executive-assistant-skills

    Draft email replies for Gonto's Gmail accounts (m@gon.to, gonto@hypergrowthpartners.com).

    118 GitHub stars~2.8k tokensUpdated 7 mo ago
    Productivity & AutomationAuto-check passed
  • Ak Dev New Messaging Integration

    yaalalabs/agent-kernel

    Step-by-step guide for adding a new messaging platform integration to Agent Kernel.

    192 GitHub stars~4.6k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Ak Add Integration

    yaalalabs/agent-kernel

    Add a messaging platform integration to an existing Agent Kernel project.

    192 GitHub stars~3.1k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Career-Ops Gmail Lead Plugin

    career-ops-hq/career-ops

    Pulls job leads from a Gmail label into the career-ops pipeline, extracting job URLs from DMARC-passing emails and de-duplicating against existing leads.

    74k GitHub stars~233 tokensUpdated today
    Productivity & AutomationAuto-check: notes

More from Alex8791-cyber/cognithor

  • Test Skill

    Alex8791-cyber/cognithor

    Extended diagnostic skill that validates the full Cognithor skill lifecycle — SkillRegistry scanning, keyword matching (exact + fuzzy at 70% threshold), and async execution.

    158 GitHub stars~500 tokensUpdated 4 days ago
    Auto-check passed
  • Wetter Abfrage

    Alex8791-cyber/cognithor

    Weather query skill that retrieves current temperature, humidity, wind speed, and multi-day forecasts for a given city or coordinate.

    158 GitHub stars~477 tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Gmail Sync

What does Gmail Sync do?

API integration skill that fetches Gmail messages, syncs inbox labels, and processes attachments via the Gmail REST API. Gmail Sync is an agent skill from Alex8791-cyber/cognithor. API integration skill that fetches Gmail messages, syncs inbox labels, and processes attachments via the Gmail REST API.

When should I use Gmail Sync?

Gmail Sync fits situations like: fetching new emails; syncing inbox state; triaging unread messages; exporting mail data.

How do I install Gmail Sync in Claude Code?

Run `npx skills add Alex8791-cyber/cognithor --skill gmail-sync -a claude-code`. Or copy the skill folder (skills/gmail_sync in Alex8791-cyber/cognithor) into .claude/skills/gmail-sync in your project. Claude Code loads it when a task matches its description.

How do I install Gmail Sync in Codex?

Run `npx skills add Alex8791-cyber/cognithor --skill gmail-sync -a codex`. Or copy the skill folder (skills/gmail_sync in Alex8791-cyber/cognithor) into .agents/skills/gmail-sync in your project. Codex loads it when a task matches its description.

Can I use Gmail Sync in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Alex8791-cyber/cognithor --skill gmail-sync -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gmail-sync, .gemini/skills/gmail-sync, .github/skills/gmail-sync and .opencode/skills/gmail-sync in your project.

What does Gmail Sync need to run?

Going by SKILL.md and its folder, Gmail Sync needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Gmail Sync access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Gmail Sync safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gmail Sync use?

Gmail Sync is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gmail Sync use?

About 435 tokens (SKILL.md is roughly 1.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gmail Sync?

Skills that share tags, products or a category with Gmail Sync: Gmail Email (open-gitagent/gitagent, 713 stars), Google Workspace (yc-software/qm, 15k stars), Email Drafting (mgonto/executive-assistant-skills, 118 stars) and Ak Dev New Messaging Integration (yaalalabs/agent-kernel, 192 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gmail Sync?

Alex8791-cyber (a GitHub user) maintains it in Alex8791-cyber/cognithor, which has 158 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 5, 2026.

Source: Alex8791-cyber/cognithor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.