Guide · Agent skill
How to use the Save Gmail Message to Google Doc agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains the recipe-save-email-to-doc agent skill, which lets an AI agent find a Gmail message, read its body, and store that text in a new Google Doc as an archived copy. It is written for readers who have never used agent skills before. By the end you will know what the skill does, how to install it, how to ask for it in plain language, and what to check before you use it on sensitive email.
Quick start
- 1Download and unzip the skill. Download the ZIP file from this page and unzip it so that SKILL.md is inside the skill folder.
- 2Place the skill folder. Move the folder into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, upload it under Settings → Capabilities → Skills instead.
- 3Install the requirements. Set up the gws command-line tool and make sure the gws-gmail and gws-docs skills are available. Authorise your Google account for Gmail and Google Docs access.
- 4Make a natural request. Ask the agent to save a specific email to a Google Doc, naming the sender, subject, or keyword so the right message is found.
- 5Review the commands. Check the gws commands the agent proposes, since this skill runs scripts and uses the network.
- 6Check the new document. Open the Google Doc the agent created and confirm the From line, Subject line, and body text were saved.
What the skill makes the agent do
An agent skill is a folder of instructions (here, a file called SKILL.md) that an AI agent loads so it knows how to carry out a specific task. This skill is a step-by-step recipe. Once it is installed and its requirements are met, the agent can find a Gmail message matching a search, read the message body, create a new Google Doc, and write the email text into that document.
The recipe chains together two other Google Workspace skills, gws-gmail and gws-docs, and uses the gws command-line tool to run the commands. The result is an archived copy of the email stored in Google Docs, which you can keep for reference.
Install the skill from the ZIP download
Download the ZIP file for the skill from this page and unzip it. The skill's main file is SKILL.md. Place the unzipped skill folder in one of these locations:
For all of your projects, put it in ~/.claude/skills/.
For one project only, put it in that project's .claude/skills/ folder.
If you use the Claude apps instead, you can upload the skill under Settings → Capabilities → Skills.
- Personal install: ~/.claude/skills/
- Single project install: the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload the skill
Check the requirements before you start
The skill will not work on its own. It needs the gws command-line tool (the Google Workspace CLI), the gws-gmail skill, the gws-docs skill, and a Google account that has been authorised for Gmail and Google Docs access. The commands fail without that access. The skill file does not explain how to install or authorise gws, so follow the gws tool's own setup for that part.
- gws command-line tool (Google Workspace CLI)
- gws-gmail skill
- gws-docs skill
- A Google account authorised for Gmail and Google Docs access
Ask for it with a natural request
You do not need to type the skill name. Describe what you want in plain language and mention saving the email to a Google Doc. The agent will load the recipe when the request matches its description, which is to save a Gmail message body into a Google Doc for archival or reference.
Be specific about which email you mean. The recipe searches Gmail using a query, so a sender, subject, or keyword gives the agent something to match on.
- "Save my latest email from the finance team to a Google Doc for my records."
- "Find the email with the subject Contract renewal from legal and archive it in a new Google Doc."
- "Copy the message from boss@company.com about the Q3 plan into a Google Doc."
What the four recipe steps do
The SKILL.md file lists four steps. The agent runs them in order. Two of them contain placeholders (MSG_ID and DOC_ID) that the agent fills in from the results of earlier steps. The steps are a guide for the agent, not a finished script, and the example title and search terms are only samples.
Step 1 searches Gmail for matching messages and shows them as a table. Step 2 gets the content of one message. Step 3 creates a new Google Doc with a title. Step 4 writes the email text into that document, with a From and Subject line followed by the body.
- Step 1: find the message with a Gmail search query
- Step 2: get the message content by its ID
- Step 3: create a new Google Doc with a title
- Step 4: write the email body into the document
gws gmail users messages list --params '{"userId": "me", "q": "subject:important from:boss@company.com"}' --format table
gws gmail users messages get --params '{"userId": "me", "id": "MSG_ID"}'
gws docs documents create --json '{"title": "Saved Email - Important Update"}'
gws docs +write --document-id DOC_ID --text 'From: boss@company.com
Subject: Important Update
[EMAIL BODY]'Safety notes: scripts and network access
This skill runs scripts and uses the network. It reads your Gmail messages and creates and writes to your Google Drive through the gws tool, so it acts on your real account. Read the commands in the recipe before you approve them, and make sure you are happy for the agent to access the mailbox and Drive involved.
The recipe handles one message at a time and does not address access controls. Before copying email that contains sensitive or regulated information into a Google Doc, review who can see that document under its sharing settings and how long your organisation keeps it.
- Runs scripts and uses the network: review each command before you approve it.
- Access: the Google Doc may be visible to people you have shared it with, so check sharing settings.
- Retention: check your organisation's retention rules before archiving email this way.
Tips and limits
The recipe is designed for one message at a time. For large mailboxes or automated bulk archiving, the steps are not enough on their own and you would need to build a more complete workflow. Keep the search narrow so the agent picks the right message, and check the new Google Doc afterwards to confirm the text was saved correctly.
- Use a narrow Gmail search so the right message is found.
- Check the Google Doc after saving to confirm the text is complete.
- Do not rely on this recipe for bulk archiving of large mailboxes.
What people use it for
- Keeping a copy of an important message from a manager or client in Google Drive for reference.
- Archiving a key piece of correspondence, such as a contract update, as a readable document.
- Giving a team a shared Google Doc copy of an email they need to refer to later.
Frequently asked questions
How do I install the save Gmail to Google Doc agent skill?
Download the ZIP file from this page and unzip it. Put the skill folder in ~/.claude/skills/ for all projects, or in a project's .claude/skills/ folder for one project. In the Claude apps, you can upload it under Settings → Capabilities → Skills.
What do I need before the skill works?
You need the gws command-line tool (Google Workspace CLI), the gws-gmail and gws-docs skills, and a Google account authorised for Gmail and Google Docs access. Without that access the commands will fail.
Is this skill free to use?
The source lists the licence as Apache-2.0 but does not state any price, so check the licence terms for the code itself. Your use of gws and your Google account may have their own terms.
Can it archive my whole Gmail inbox?
No. The recipe handles one message at a time and uses placeholder IDs that must be filled in, so it is not a finished script for bulk or automated archiving of large mailboxes.
Is it safe to save sensitive emails to a Google Doc with this skill?
The recipe does not address access controls. Before copying sensitive or regulated email, review the Google Doc's sharing settings and your organisation's retention rules.
Why does the agent fail or say it cannot find the message?
The most common causes are that gws is not installed, the Google account is not authorised for Gmail and Docs, or the Gmail search is too broad or does not match. Narrow the search by sender or subject and check the gws setup.
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 want to keep individual important emails as readable Google Docs and already use the gws Google Workspace CLI. It is less suitable for bulk or automated archiving, for regulated email that needs access controls you cannot review, or for anyone who has not authorised gws for Gmail and Docs.
Download the skill