---
title: A morning brief in my inbox — my agent emails me my projects' pulse before I start
date: 2026-09-11
tags: [automation, claude-code, gmail, oauth, launchd, productivity]
type: success
reproducible: true
stack: macOS launchd, Claude Code, Gmail (MCP connector), gh CLI
agent: Claude Code
model: claude-opus-4-8
---

# A morning brief in my inbox — my agent emails me my projects' pulse before I start

I juggle a few projects, and every morning — or after switching between them — I'd
lose the thread: what's the state, what needs me today. I wanted to pick up my
phone with coffee and see one glance before I even open the laptop.

So I set up a small scheduled job on my Mac. Each weekday morning it runs my agent
headless with a self-contained prompt, and the agent pulls the real signals from my
actual projects: my site's numbers, the top task from my backlog, the status of the
couple of GitHub PRs and issues I'm watching, and a quick triage of my last-24h
inbox. Then it emails me one short brief. It lands before I start, I read it
anywhere on my phone, and I know exactly where to dive in.

The friction was one thing, and it's the reason I'm writing this down. The agent
could gather everything but couldn't send — Gmail kept returning "Insufficient
scope," even though the tool clearly showed "Always allow." That toggle is a tool
permission; it does not grant the Google OAuth scopes. The fix was to reconnect the
Gmail connector and approve read + send on Google's own consent screen. Once the
token actually had the scopes, the brief sent — and now it arrives every workday.

## Reproduce this
Prerequisites: an agent CLI you can run non-interactively
([Claude Code](https://www.anthropic.com/claude-code)) with a Gmail connector;
[`gh`](https://cli.github.com) for GitHub; your project(s) checked out locally; a
scheduler (macOS `launchd`; cron elsewhere).
Your agent will need from you: your Gmail address, the repos/sites to watch, and
what to include in the brief.
Steps:
1. Grant Gmail the real scopes. The gotcha: the "Always allow" tool-permission
   toggle is NOT the OAuth grant. Reconnect the Gmail connector (disconnect →
   reconnect) and approve read + send on Google's consent screen (`gmail.readonly`
   plus `gmail.modify`/send). Verify by having the agent read one thread and create
   a draft — if it says "Insufficient scope," the token still lacks it.
2. Write a self-contained briefing prompt (the scheduled agent starts with no
   context): pull your numbers, the top item from your backlog file, `gh` status of
   the PRs/issues you watch, and a Gmail triage of the last ~24h; then send ONE
   short email to your own address. Degrade gracefully — a failing source is
   skipped, the email still sends.
3. Run it headless from a small script: `claude -p "<prompt>" --dangerously-skip-permissions`.
4. Schedule it: macOS `launchd` (`StartCalendarInterval`) on weekdays before you
   start — it runs on wake if the Mac was asleep. (cron on Linux.)
5. Test it now — a real email should land that you can open on your phone.
Verify: a short brief lands in your inbox each workday, with the sections you chose,
readable on your phone before you open your laptop.
