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.
npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/recipe-label-and-archive-emails/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/recipe-label-and-archive-emails/
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a codex2Manually: put the files in place
.agents/skills/recipe-label-and-archive-emails/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a cursor2Manually: put the files in place
.cursor/skills/recipe-label-and-archive-emails/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install googleworkspace/cli recipe-label-and-archive-emails2Manually: put the files in place
.github/skills/recipe-label-and-archive-emails/SKILL.md1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a gemini-cli2Platform CLI
gemini skills install https://github.com/googleworkspace/cli --path skills/recipe-label-and-archive-emailsManually: put the files in place
.devin/skills/recipe-label-and-archive-emails/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set95
The whole set →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