How to pull every business expense out of Gmail with Claude or Codex

Connecting Gmail to Claude or Codex, and the prompt that returns an expense table for a date range, including the amounts that only exist inside the attachment.

AI

Most of a small business's invoices arrive by email: the phone company, the insurer, the domain registrar, the SaaS billed in dollars, the receipt from the garage. At the end of a quarter someone has to collect them. Claude and Codex both connect to Gmail, search for every expense in a date range and return a table with supplier, date and amount. A run over two months of mail brings back a few dozen documents in a few minutes.

Connecting Gmail

In Claude, open Settings, then Connectors, and connect Gmail with the Google account your invoices arrive at. The connector works on claude.ai and in the desktop app. In Codex, install the Gmail plugin and approve the account.

For the agent to download attachments as well, it needs access to a browser. In Claude that is the Chrome extension. Without it the prompt still works, but the rows whose amount sits in a file come back empty.

If invoices are split between a personal and a business address, run the search on each one separately.

The prompt

Change the date and paste it in:

Connect to my Gmail and build a document of every business expense from 1 July 2026 to today.
Read only: do not send, delete or mark any email.

Search for invoices, receipts, bills, payment confirmations and charges, in Hebrew and English
(חשבונית, קבלה, invoice, receipt, payment, charge). Include emails I sent myself with a photo of a receipt.

For each expense: supplier, date, document number, amount, currency, VAT if shown, and which email it came from.
Leave out invoices I issued to clients, those are income.
A credit or refund goes in as its own line with a negative amount.

If the amount only appears in the attachment, open the email in the Chrome signed in to this account,
download the file, unzip it if needed, and read the amount from the PDF or image.
If two documents cover the same payment (an invoice and a receipt), keep one line.

At the end: a total for each currency separately, and a list of anything you could not complete.

The line about client invoices matters. Without it, an invoice the business issued and sent by email looks exactly like one that came in from a supplier.

Why the browser is needed

The Gmail connector returns the email body and the attachment's file name, not what is written inside it. A supplier who puts the amount in the body lands in the table complete. A supplier who sends "your July invoice is attached" with a PDF lands without an amount until someone downloads the file.

In our own run over July and August, 18 of 36 documents were like that. Phone and internet providers, insurance, building fees and everything we had emailed ourselves from a phone were all in files. Downloading through Chrome is slower than the search, and it is worth checking that the agent opens the profile signed in to the right account: with several profiles, the downloads can come from a different mailbox.

If you would rather download them yourself, one Gmail search finds them, and the files can then be added to the conversation:

has:attachment after:2026/07/01 (חשבונית OR קבלה OR invoice OR receipt)

Before it reaches your accountant

Three things come up in every run. An invoice and a receipt for the same payment can stay as two lines even when the prompt asks to merge them, and then the expense is counted twice. Foreign currency charges stay in their original currency, and conversion to shekels uses the rate on the payment date. Invoices that stay in the supplier's portal, as some newspapers and software subscriptions do, will not turn up in any search and have to be downloaded from there.

The table also cannot tell business from private. Fuel, phone and a computer are recognized at different rates, set out in the deductible expenses guide.

From the files into Slate

The downloaded files can go into Slate in one go, through bulk expense upload. Each file is read, the supplier, date, amount and VAT fill a row, and you approve the rows before they are saved. From there the expenses are already in the reports, with the recognition rate set by category.

This is general information and not tax advice. For a specific case, consult an accountant or tax adviser.