· Back to the setup

AI Setups That Work

Job emails to a sheet with Claude Code

Tested by AI Setups That Work. Ran with Claude Code in a cloud session, Nov 17, 2026, on made-up data: the page prompt turned a 12-message sample mailbox into a 10-row requests.csv in one run, and 10 of 10 rows matched the known answers. It passed with snags: the same session wrote the sample and the script, so the script fit the sample, and a rerun rewrites the whole file. Manual mode and a real mailbox were not tested.

What it does

Turn a pile of repair or job request emails into one spreadsheet with a small script, instead of a bot that reads your inbox all day.

Who it is for

Trades and service owners whose job requests arrive by email and who want a list of every request without paying an AI to read the inbox on a schedule.

Tools

Steps

  1. In Gmail, put one label, such as "Job requests", on the request emails. A filter can do it for new ones, for example on your contact form's sender address.
  2. Go to Google Takeout, deselect everything, select Mail, and choose only that label. Takeout sends a download link; Gmail arrives as an MBOX file inside a ZIP.
  3. Make a new folder, unzip the export into it, and open Claude Code in that folder in Manual mode (cd into the folder, then type claude --permission-mode manual).
  4. Paste the prompt below. In Manual mode, Claude Code stops and asks before it edits files or runs commands. Read what it wants to do, then approve. Newer versions start in auto mode by default, so check the mode indicator shows Manual.
  5. Open the CSV it makes in Google Sheets or Excel. Check 10 rows against the real emails before you trust the rest.
  6. Next week, export again into the same folder and ask Claude Code to rerun the script. Only new emails should add rows.

The prompt

In this folder is an MBOX file exported from one Gmail label. Each email is a job or repair request from a customer.

Write a small script, in a language you can run here, that reads the MBOX and writes requests.csv with one row per email and these columns:
date, from name, from email, phone (if one is in the message), address or town (if given), job type (one or two words), first 300 characters of the message, and a needs-check column.

Rules:
- Only read the file. Do not send, delete or change any email, and do not connect to Gmail.
- Use only what is in each email. If a field is missing, leave it blank. Do not guess.
- Put YES in needs-check when you are unsure about the phone, address or job type.
- Skip emails that are replies I sent.
- Before you run it, tell me what the script will do. After you run it, show me the first 5 rows and the total count.

Tips

Sources