Skip to content

Guide · Agent skill

How to use the Save Gmail Attachments to Drive agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Save Gmail Attachments to Drive skill is a ready-made workflow for an AI agent. Once it is installed, the agent can search your Gmail for messages with attachments, download the files and upload them to a Google Drive folder you name. This guide explains what the skill does, how to install it, how to trigger it with plain requests, and what to check before letting it touch your real email and files.

Save Gmail Attachments to Drivegoogleworkspace/cli · Apache-2.0

Quick start

  1. 1Install gws and authenticate. Install the gws command-line tool and connect it to the Google account whose Gmail and Drive you want the agent to use.
  2. 2Add the companion skills. Make sure the gws-gmail and gws-drive skills are available alongside this one, since the recipe depends on them.
  3. 3Download and unzip the skill. Download the ZIP from our page and unzip it to get the SKILL.md file.
  4. 4Place the skill folder. Put it in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  5. 5Make a narrow request. Ask the agent to find attachments from a specific sender and name the Drive folder ID to save them to.
  6. 6Review before uploading. Check the search results and message details the agent reports, and confirm the destination folder before approving the upload.

What the skill makes the agent do

Agent skills are instruction packages that tell an AI agent how to carry out a specific task. This one is a recipe: it sets out which gws commands to run and in what order to move attachments from Gmail into Google Drive.

The agent does not just give advice. It runs the gws command-line tool against your Google account, so it acts on real email and real files. The skill relies on two companion skills, gws-gmail and gws-drive, for the underlying Gmail and Drive operations, so those must be available too.

  • Search Gmail for messages that have attachments, for example from a specific sender
  • Read the message details
  • Download the attachment files
  • Upload them to a Google Drive folder you specify

Before you install: what the skill needs

The skill will not work on its own. It requires the gws command-line tool installed and authenticated to a Google account, the gws-gmail and gws-drive companion skills, and a Google account with Gmail and Google Drive access granted to gws.

If you have not connected your Google account to gws, the agent cannot reach Gmail or Drive. Granting that access exposes all mail and files in the account, so only do it for an account you are comfortable letting the agent work with.

  • gws command-line tool, installed and authenticated
  • gws-gmail companion skill
  • gws-drive companion skill
  • Google account with Gmail and Google Drive access granted to gws

Install the skill from the ZIP download

Download the ZIP for this skill from our page and unzip it. The package contains a single file, SKILL.md. Place the unzipped skill folder in one of two locations, depending on how you want to use it.

For a personal setup available across your projects, put it in ~/.claude/skills/. For a single project, put it in that project's .claude/skills/ folder.

Alternatively, you can upload the skill in the Claude apps under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Single project: the project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills
~/.claude/skills/

Trigger the skill with a natural request

You do not need to type a command name. Describe what you want in plain language and mention Gmail, attachments and Drive. The skill's description is to find Gmail messages with attachments and save them to a Google Drive folder, so requests that match that task are the ones it is built for.

Be specific about the sender or topic and about the destination folder. The recipe's own example searches for messages with attachments from a particular sender, so a sender address or a folder ID makes the request easier to act on.

  • "Save the PDF attachments from client@example.com to my Invoices folder in Drive."
  • "Find emails with attachments from accounts@supplier.com and upload them to the Drive folder with ID FOLDER_ID."
  • "Show me which messages from my accountant have attachments before you save anything."

How the recipe runs, step by step

The recipe runs four steps in order. The agent first searches Gmail with a query for messages that have attachments, then reads the details of a message, downloads the attachment, and uploads it to a Drive folder using that folder's ID.

The examples in the skill show single-message operations, with placeholders such as MESSAGE_ID, ATTACHMENT_ID and FOLDER_ID that the agent fills in from earlier results.

  • Search: gws gmail users messages list with a query such as has:attachment from:client@example.com
  • Read: gws gmail users messages get for a message ID
  • Download: gws gmail users messages attachments get for a message and attachment ID
  • Upload: gws drive +upload with the file path and --parent set to the folder ID
gws drive +upload --file ./attachment.pdf --parent FOLDER_ID

Safety notes before you run it

This skill runs scripts and uses the network. It acts on your live Gmail and Drive, not in a sandbox, so review what it found before it uploads anything, particularly into a shared folder.

Do not use it for bulk archiving of a large mailbox without review. The steps only show single-message examples, and the agent may upload the wrong or sensitive files to a shared folder.

  • Check the search results and message details before any upload
  • Confirm the destination folder ID is the one you intend
  • Use a narrow query (sender, date range or topic) rather than the whole mailbox
  • Remember that granting gws access exposes all mail and files in the account

What people use it for

  • Filing supplier invoices from a accounts inbox into a shared Drive folder for bookkeeping
  • Collecting signed contracts sent by a client into a project folder
  • Saving receipts from a specific sender into a Drive folder for expense records
  • Gathering attachments from one correspondent into a folder for an admin team to review

Frequently asked questions

What is the recipe-save-email-attachments skill?

It is an agent skill that tells an AI agent how to find Gmail messages with attachments, download the files and upload them to a Google Drive folder you specify. It works by running the gws command-line tool against your Google account. It is a recipe that depends on the gws-gmail and gws-drive companion skills.

What do I need before this skill works?

You need the gws command-line tool installed and authenticated to a Google account, the gws-gmail and gws-drive companion skills, and Gmail and Google Drive access granted to gws. Without the gws connection the agent cannot reach Gmail or Drive.

Where do I install the skill?

Download the ZIP from our page and unzip it. Put the folder in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder, or upload it in the Claude apps under Settings → Capabilities → Skills.

Is this skill free to use?

The skill is published under the Apache-2.0 licence. The source does not state pricing for gws or any Google service, so check those separately.

Can it save attachments from every email in my account at once?

The skill is not designed for bulk archiving without review. Its steps show single-message examples, and the agent may upload the wrong or sensitive files to a shared folder, so use narrow queries and check results first.

Does this work with Outlook, Dropbox or other providers?

No. The skill only covers Gmail and Google Drive. For a non-Google email or storage provider you would need a different tool or skill.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits people who regularly file invoices, contracts or receipts from Gmail into Drive, admin staff collecting client attachments into shared folders, and developers already using gws. It is a poor fit if you have not connected a Google account to gws, want to archive a large mailbox unattended, or use a non-Google email or storage provider.

Download the skill