← Back to blog

Get a daily inbox summary from your agent on a schedule

guidesclaude-code

A good morning email summary answers three questions: what needs a reply today, what changed since yesterday, and what can wait. You can ask an agent those questions by hand every morning. Claude Code can also ask them for you on a schedule, so the answer is ready when you sit down.

Claude Code has a scheduler built in, so you do not need cron or a shell script. This guide connects your mailbox with read-only access, writes the digest as a reusable skill, and schedules it two ways: inside a running Claude Code session, and as a Desktop scheduled task that keeps running every day. It works with Gmail, Outlook, and IMAP mailboxes through Fluxmail, a self-hosted MCP server.

1. Connect your mailbox read-only

Follow the quickstart to install Fluxmail and connect a mailbox. Then add it to Claude Code with the read-only profile:

claude mcp add fluxmail -- fluxmail stdio --profile read-only

A scheduled job runs while you are not watching, so it should not be able to send, draft, or change anything. With read-only, Claude Code can search and read your mail and nothing else. Permissions lists what each profile allows. Even if a message in your inbox contains instructions aimed at the agent, the worst outcome is a wrong summary.

Because the profile is read-only, it is safe to let Claude Code use every Fluxmail tool without asking. Otherwise a scheduled run would stop and wait at the first permission prompt. Add an allow rule to ~/.claude/settings.json:

{
  "permissions": {
    "allow": ["mcp__fluxmail"]
  }
}

The rule mcp__fluxmail covers every tool from the server named fluxmail, which here means the read-only tools and nothing else.

2. Write the digest as a skill

Put the instructions in a Claude Code skill so every run uses the same prompt, and so you can improve it in one place. Create ~/.claude/skills/inbox-digest/SKILL.md:

---
name: inbox-digest
description: Summarize the last day of email into a short morning digest.
---

Search my inbox for mail received since yesterday morning.

Write a digest in this order:
1. Needs a reply today: sender, subject, and what they are asking for.
2. Worth knowing: updates, decisions, and anything that changed a plan.
3. Everything else: one line with a count by type (newsletters,
   notifications, receipts).

Rules:
- Mail from @mycompany.com and from customers goes first.
- Open the full thread when a preview is not enough to tell what is needed.
- Ignore newsletters and notifications except in the count.
- Keep it under 250 words.
- If this run is late, for example after noon, say so at the top.

Try it by hand first. Start Claude Code and run /inbox-digest. Claude Code searches with Fluxmail's search_emails tool, opens threads with get_thread when it needs more than a preview, and prints the digest. Adjust the rules until the output is what you want to read every morning.

3a. Schedule it inside a session

Claude Code can schedule prompts inside a running session. Ask for the schedule in plain language:

Every weekday at 7am, run /inbox-digest.

Claude Code turns that into a cron expression (0 7 * * 1-5), schedules it with its CronCreate tool, and confirms the time and a task ID. At 7 AM local time, the digest runs in that session and the result appears in the conversation. Ask "what scheduled tasks do I have?" to list them, or "cancel the inbox digest" to stop it.

Session scheduling is quick to set up, with some limits:

  • The session has to stay open. Tasks fire only while Claude Code is running and idle. If you close the terminal, they stop. You can move the session to the background so it keeps running without a terminal.
  • Recurring tasks expire after seven days. The task fires one last time and deletes itself. Recreate it each week, or use a Desktop scheduled task.
  • Runs can be a little late. Claude Code offsets recurring tasks by up to 30 minutes so that sessions do not all hit the API at once.

That makes session scheduling a good fit for a week of trying the digest out, or for a machine where Claude Code is always running.

3b. Schedule it as a Desktop task

For a digest that runs every day, use a Desktop scheduled task. It runs on your machine with your MCP servers and settings, and it does not need an open session.

In the Claude Desktop app, open the Code tab and select Routines. Select New routine, then Local, and fill in:

  • Name: inbox-digest
  • Instructions: Run /inbox-digest.
  • Schedule: Weekdays, at 7:00 AM
  • A working folder, which can be any folder you trust. The digest does not touch files.

Select Run now once after saving. If Claude Code asks for permission to use a Fluxmail tool, choose to always allow it, so later runs do not stop and wait.

Each run starts a new session under Scheduled in the sidebar and shows a desktop notification. Open the session to read the digest.

The Desktop app has to be open and your computer awake for a task to run. If your computer sleeps through 7 AM, Desktop runs the missed digest once when it wakes. That is why the skill asks Claude to say when a run is late. To stop the Mac from sleeping when idle, turn on Keep computer awake in the app's settings.

Which one to use

Session task Desktop task
Set up with A prompt in any session The Routines page, or a prompt in Desktop
Runs when The session is open and idle The app is open and the computer is awake
Lasts Seven days Until you pause or delete it
Missed runs Skipped One catch-up run on wake
Where the digest appears In the session A new session, with a notification

Claude Code can also run routines in the cloud, even when your computer is off. A cloud routine cannot reach a Fluxmail server that runs on your laptop over stdio, though. It would need a Fluxmail server it can reach over HTTPS, such as one deployed with Docker. For most people, a Desktop task is simpler.

Improve the digest

  • Tune the skill, not the schedule. When the digest keeps flagging the same unimportant sender, add a rule to SKILL.md. The next run uses it.
  • Cover several mailboxes. Fluxmail can search up to 20 connected mailboxes in one request. Tell the skill which ones to include and to label each section by mailbox.
  • Act on it later. The digest is read-only on purpose. When you want to archive or draft replies, open a normal session with a read-write connection. Triage your Gmail inbox with Claude Code shows how.