recipe-create-gmail-filter — Claude skill: Gmail filters
A skill that walks your agent through building Gmail filters with the gws CLI: labels, stars, and inbox rules.
npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a claude-codeWhat recipe-create-gmail-filter does
recipe-create-gmail-filter lives in the googleworkspace/cli repo and spells out a four-step recipe for Gmail filters. The agent lists existing labels first, creates the one it needs, then builds a filter with criteria and actions, and finally checks that the filter is there. Every step is a shell command, so you can run the same thing by hand.
The commands are gws gmail users labels list, gws gmail users labels create, gws gmail users settings filters create, and gws gmail users settings filters list. Criteria go in the criteria object, actions in action — for example add a label and drop the message out of the inbox.
Two things have to be in place: the gws binary and the gws-gmail skill, which the recipe marks as a prerequisite. For a single filter, the Gmail web UI is faster. This skill earns its place when you keep a stack of filters and want them as repeatable commands.
What it helps with
- create a label and apply it to mail from one sender
- keep certain messages out of the inbox with a filter
- list the filters already configured on an account
- check existing labels before creating a new one
- reproduce the same filter setup on another account
Example prompts for the agent
- create a Gmail filter that labels mail from [email protected] as Receipts and skips the inbox
- list all labels in my Gmail account
- show me which filters are currently active
How to install recipe-create-gmail-filter
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a claude-code2Manually: put the files in place
~/.claude/skills/recipe-create-gmail-filter/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/recipe-create-gmail-filter/
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a codex2Manually: put the files in place
.agents/skills/recipe-create-gmail-filter/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a cursor2Manually: put the files in place
.cursor/skills/recipe-create-gmail-filter/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install googleworkspace/cli recipe-create-gmail-filter2Manually: put the files in place
.github/skills/recipe-create-gmail-filter/SKILL.md1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a gemini-cli2Platform CLI
gemini skills install https://github.com/googleworkspace/cli --path skills/recipe-create-gmail-filterManually: put the files in place
.devin/skills/recipe-create-gmail-filter/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set95
The whole set →Similar
Questions about recipe-create-gmail-filter
How do I install recipe-create-gmail-filter in Claude?
Run npx skills add googleworkspace/cli --skill recipe-create-gmail-filter -a claude-code. The skill lands in ~/.claude/skills/recipe-create-gmail-filter/SKILL.md.
What does recipe-create-gmail-filter do?
It runs the agent through four steps: list labels, create a label, create a filter with criteria and actions, then verify it.
What do I need before using it?
The gws binary and the gws-gmail skill, which the recipe lists as a prerequisite.
Source text
SKILL.md · Apache-2.0
---
name: recipe-create-gmail-filter
description: "Create a Gmail filter to automatically label, star, or categorize incoming messages."
metadata:
version: 0.22.5
openclaw:
category: "recipe"
domain: "productivity"
requires:
bins:
- gws
skills:
- gws-gmail
---
# Create a Gmail Filter
> **PREREQUISITE:** Load the following skills to execute this recipe: `gws-gmail`
Create a Gmail filter to automatically label, star, or categorize incoming messages.
## Steps
1. List existing labels: `gws gmail users labels list --params '{"userId": "me"}' --format table`
2. Create a new label: `gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}'`
3. Create a filter: `gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "[email protected]"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}'`
4. Verify filter: `gws gmail users settings filters list --params '{"userId": "me"}' --format table`
© googleworkspace · Apache-2.0 · googleworkspace/cli