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

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.

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

What 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-code

2Manually: put the files in place

~/.claude/skills/recipe-create-gmail-filter/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/recipe-create-gmail-filter/

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-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

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