Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot official · Google

recipe-label-and-archive-emails — Claude skill: label and archive

A skill that tidies Gmail: finds messages matching a query, applies a label, then archives them out of the inbox. Useful when notifications pile up.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a claude-code
Open on GitHub

What recipe-label-and-archive-emails does

The skill runs on the gws CLI and needs the gws-gmail skill loaded first. It walks three steps: search for messages with a query like from:[email protected], add a label to the matches, then strip the INBOX label so they leave the inbox.

Under the hood it is three gws gmail users messages calls. One list with your search params, then two modify calls — one with addLabelIds, one with removeLabelIds. Everything goes through the Gmail API, so you need account access and the label ID you want to apply.

Worth installing if you clear your inbox by hand and would rather hand that to an agent. With a single quiet mailbox, a plain Gmail filter does the same job.

What it helps with

  • find messages from one sender
  • apply a label to a batch of messages
  • move read mail out of the inbox
  • clear service notifications from the inbox
  • sort incoming mail by sender

Example prompts for the agent

  • Find messages from [email protected] and show them as a table
  • Label these messages and remove them from the inbox
  • Archive every message with this label

How to install recipe-label-and-archive-emails

1Skills CLI (Vercel)

npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a claude-code

2Manually: put the files in place

~/.claude/skills/recipe-label-and-archive-emails/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/recipe-label-and-archive-emails/

From the same set95

The whole set →
gws-gmail official googleworkspace This skill hands your agent Gmail: send mail, read the inbox, reply in a thread. Useful when email work already runs through the gws CLI. Claude Code CX Codex Cursor +1 81,900installs gws-gmail-send official googleworkspace A skill that teaches your agent to send Gmail from the terminal: recipients, subject, body, attachments and drafts. Claude Code CX Codex Cursor +1 74,700installs gws-drive official googleworkspace This skill hands your agent Google Drive through the gws CLI: files, folders, shared drives, comments and access requests. Useful when docs move through code. Claude Code CX Codex Cursor +1 74,500installs gws-shared official googleworkspace This skill gives agents shared rules for gws CLI authentication, flags, and output formats. Use it when working with gws commands. Claude Code CX Codex Cursor +1 66,000installs gws-calendar official googleworkspace Manage Google Calendar events, access rules, and schedules through the gws CLI tool. Claude Code CX Codex Cursor +1 61,100installs gws-sheets official googleworkspace This skill lets an agent read and edit Google Sheets through the CLI. Use it when a coding workflow needs spreadsheet data or table updates. Claude Code CX Codex Cursor +1 58,800installs gws-docs official googleworkspace This skill lets an agent read and update Google Docs through gws. Use it when document changes should happen from an agent chat. Claude Code CX Codex Cursor +1 58,300installs gws-sheets-read official googleworkspace Reads cell values and sheets from Google Spreadsheets via CLI. Useful when an agent needs spreadsheet data without risk of altering it. Claude Code CX Codex Cursor +1 50,600installs

Similar

Questions about recipe-label-and-archive-emails

How do I install recipe-label-and-archive-emails in Claude?

Run npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a claude-code. The skill lands in ~/.claude/skills/recipe-label-and-archive-emails/SKILL.md.

What does recipe-label-and-archive-emails do?

It searches for messages by query, adds a label to them, and removes the INBOX label so they leave your inbox.

What does the skill need to run?

The gws binary and the gws-gmail skill loaded. The commands hit the Gmail API, so account access is required.

Source text

SKILL.md · Apache-2.0
---
name: recipe-label-and-archive-emails
description: "Apply Gmail labels to matching messages and archive them to keep your inbox clean."
metadata:
  version: 0.22.5
  openclaw:
    category: "recipe"
    domain: "productivity"
    requires:
      bins:
        - gws
      skills:
        - gws-gmail
---

# Label and Archive Gmail Threads

> **PREREQUISITE:** Load the following skills to execute this recipe: `gws-gmail`

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

## Steps

1. Search for matching emails: `gws gmail users messages list --params '{"userId": "me", "q": "from:[email protected]"}' --format table`
2. Apply a label: `gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"addLabelIds": ["LABEL_ID"]}'`
3. Archive (remove from inbox): `gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"removeLabelIds": ["INBOX"]}'`

© googleworkspace · Apache-2.0 · googleworkspace/cli

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor