Skip to content

Guide · Email

How to automate Gmail with Claude

Three levels of Gmail automation, from asking Claude about your inbox to a script that files email for you every hour. Each step works without a programming background.

By Randy Torres · Updated · 8 min read

Gmail ⇄ Claudeconnector on
Level 1 connects Gmail. Level 2 schedules a briefing. Level 3 files mail with a script.
On this page
  1. Level 1: Connect Gmail to Claude
  2. Level 2: A morning inbox briefing that runs itself
  3. Level 3: Auto-file email with a script Claude writes
  4. Stay safe while you automate
  5. What the documentation says
  6. What to automate next
  7. Sources

Most people’s first try at “AI for email” is pasting a thread into a chat window and asking for a reply. That helps once. It doesn’t give back the half hour a day you spend reading, sorting and answering mail.

This guide covers three setups, and each one does more on its own than the last:

  1. Ask Claude about your inbox. Connect Gmail so Claude can search, read and draft.
  2. Get a briefing on a schedule. A task in Claude Cowork that reads your inbox every morning and tells you what matters.
  3. File email automatically. A Google Apps Script that Claude writes for you, running inside your Google account around the clock.

You need a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) for the scheduled tasks in step 2. For step 3, a free Google account and a free Claude account are enough.

Level 1: Connect Gmail to Claude

Claude reaches Gmail through a connector. Once it’s switched on, Claude can search your mail using ordinary language, read whole threads, write drafts, and manage labels. It can also send, reply and forward, but by default it shows you each message and waits for your approval first. Leave that default alone.

To connect it:

  1. Open Claude in your browser or in the Claude desktop app.
  2. Go to Customize → Connectors. (Anthropic moves settings around now and then. If you can’t find it, look for “Connectors” in the sidebar or settings.)
  3. Find Gmail in the list and click Connect.
  4. Sign in with the Google account you want to use and approve the permissions Google shows you.

On Team and Enterprise plans an admin has to turn connectors on first. If Gmail isn’t listed, that’s usually why.

Five prompts to try first

Start a new chat and try these, with your own names swapped in.

  • “Search my Gmail for anything from the last 3 days that asks me a direct question I haven’t answered. List sender, subject and the question.”
  • “Summarize the thread with [client name] about the Q4 renewal. What was agreed, what’s still open, and who owes the next reply?”
  • “Draft a reply to the latest email from [name]. Say yes to Tuesday at 2pm and ask for the agenda. Keep it to three sentences. Save it as a draft, don’t send it.”
  • “Find newsletters I’ve received more than five times this month and haven’t opened. List them so I can unsubscribe.”
  • “Which emails from this week mention an invoice, a contract or a deadline? Group them by type.”

Two limits to know about. Claude can see an attachment’s name and size, not what’s inside it. And it only looks at your inbox when you ask, or when a scheduled task tells it to. It doesn’t watch for new mail.

Teach it your voice

Drafts get much better once Claude has seen how you write. Try this:

“Read the last 20 emails I sent. Describe my writing style in 5 bullet points covering how long my emails run, how I open and close them, and the phrases I repeat. Then use that style for every draft in this chat.”

Copy the five bullets it gives you. You’ll paste them into the scheduled task in the next section. You can also put them in a Claude Project’s instructions, so every chat in that Project picks them up.

Level 2: A morning inbox briefing that runs itself

Claude Cowork is the part of the Claude desktop app built for multi-step tasks, and it can run a task on a schedule. Scheduled tasks are available on all paid plans.

  1. Install the Claude desktop app from claude.com/download and sign in.
  2. Make sure Gmail is connected (Level 1).
  3. Open the Cowork tab and click Scheduled in the left sidebar.
  4. Click New task, then Set up manually.
  5. Give it a name (“Morning inbox briefing”) and write the prompt (below).
  6. Set the frequency to On weekdays and pick a time, say 7:30am.
  7. Click Save.

Here’s a prompt that works well:

“Check my Gmail for everything that arrived since yesterday at 5pm. Ignore newsletters, receipts and automated notifications. Give me: (1) anything that needs a reply from me today, with a one-line reason; (2) anything waiting on someone else; (3) meetings or deadlines mentioned for this week. For each item in (1), save a draft reply in Gmail using my style: [paste your five bullets]. Do not send anything.”

The last sentence matters. You want drafts waiting for you, not emails going out while you’re still on your first coffee.

Before you trust the schedule, paste the same prompt into an ordinary Cowork task and run it once. Read the briefing and open the drafts it saved in Gmail. If it flagged things that don’t matter, say so in the prompt (“ignore anything from our ticketing system”) and try again.

Level 3: Auto-file email with a script Claude writes

Some jobs need no AI judgment at all, like filing receipts or archiving alerts every hour. For those, a small script inside your Google account is more reliable than Claude, and it’s free.

That script is Google Apps Script. You don’t need to know how to write it. You describe what you want, Claude writes it, and you paste it in.

Step 1: Ask Claude for the script

“Write a Google Apps Script for Gmail. Every time it runs, it should find inbox emails from the last 2 days whose subject contains ‘receipt’, ‘invoice’ or ‘order confirmation’, apply the label ‘Receipts’ (create it if it doesn’t exist), and archive them. Skip anything already labeled. Explain each line in plain English.”

You’ll get something like this:

function fileReceipts() {
  const label = GmailApp.getUserLabelByName('Receipts') || GmailApp.createLabel('Receipts');
  const query = 'in:inbox newer_than:2d -label:Receipts ' +
    '(subject:receipt OR subject:invoice OR subject:"order confirmation")';
  const threads = GmailApp.search(query, 0, 50);
  threads.forEach(function (thread) {
    thread.addLabel(label);
    thread.moveToArchive();
  });
}

The query uses Gmail’s own search syntax. Before running anything, paste it into Gmail’s search bar as one line and see what comes back:

in:inbox newer_than:2d -label:Receipts (subject:receipt OR subject:invoice OR subject:"order confirmation")

If the results are right, the script will touch exactly those emails.

Step 2: Paste it into Apps Script

  1. Go to script.google.com and click New project.
  2. Delete the placeholder code in the editor and paste in Claude’s script.
  3. Rename the project (click “Untitled project” at the top) and click the save icon.
  4. Pick fileReceipts from the function menu in the toolbar and click Run.

Step 3: Approve the permissions

The first run asks for access to your Gmail. Click Review permissions and choose your account. Google will warn you that it “hasn’t verified this app”. That’s expected, because the “app” is your own script. Click Advanced, then Go to [your project name], and allow access.

Check Gmail: the receipts should now sit under the Receipts label.

Step 4: Put it on a timer

  1. In the Apps Script editor, click the clock icon (Triggers) in the left sidebar.
  2. Click Add Trigger.
  3. Choose fileReceipts, event source Time-driven, type Hour timer, and Every hour.
  4. Click Save.

It now runs hourly, laptop open or not. Delete the trigger to stop it.

When a plain Gmail filter is enough

If the rule is simple (“anything from this sender goes to this label”), Gmail’s own filters do it without a script: search for the emails, open the search options, and choose Create filter. Use Apps Script when you need logic a filter can’t handle, like “only if it’s older than a week” or “send me a summary of what got filed”.

Stay safe while you automate

  • Drafts first, sending later. Keep Claude on “draft, don’t send” until you’ve read a few weeks of its output.
  • Test on a narrow search. Scripts act on whatever the search returns. Start with a tight query and a small limit (the 50 above).
  • Know what’s sensitive. If your company has rules about client data and AI tools, check them before you connect a work account.
  • Disconnect when you’re done experimenting. Customize → Connectors lets you disconnect Gmail at any time, and your Google account’s security page shows every app with access.

What the documentation says

Facts from Anthropic and Google documentation that decide which level of this guide fits your account.

What to automate next

Once the briefing and the filing are running, pick the email chore you repeat every week. A Monday status report pulled from threads or a nudge list of unanswered proposals uses the same pieces.

If you’d rather build these with someone next to you, working on a provided inbox, that’s a hands-on session on Day 1 of our two-day class. Or start with the other guides: Claude Code for non-programmers walks through building a small tool of your own, and Using AI with Excel covers cleaning data, formulas and reports.

Sources

Applied AI Workflow Automation · Boston

Build this with us, in person

Two days, hands-on, 20 seats. You practice AI workflow automation on provided case files for email, documents and spreadsheets. Next class: early 2027, dates to be announced · $1,299 tuition.

// Free · AI automation starter kit

Get the starter kit

The copy-paste prompts and scripts from our guides in one place, plus a checklist for picking the first task worth automating. Free, sent to your inbox.

No spam. Unsubscribe any time by replying “stop”.