Sixty minutes. A working agent that runs headless, using an MCP for tools and a skill for a defined task.
By the end, you'll have a daily-digest agent that:
npm install -g @anthropic-ai/claude-code
claude
First run triggers auth. Sign in with an Anthropic account (or enter an API key for headless use later).
You need two MCPs: Google Calendar and Gmail. Both are first-party claude.ai connectors, easiest path is:
/mcp list, you should see both listedIn Claude Code, try:
Using Gmail, search for emails from my boss in the last week.
Claude should use the Gmail MCP. Accept the tool-use prompt. Verify the results look right. Repeat with Calendar.
Create ~/.claude/skills/daily-digest/SKILL.md:
---
name: daily-digest
description: Produce a daily digest from email + calendar
---
You are producing the user's daily digest. Keep it under 150 words.
Steps:
1. Use Google Calendar to list events for today
2. Use Gmail to find emails received since yesterday at 6pm with importance flags or from senders marked as important
3. Synthesize into one paragraph, covering:
- The 3 most important meetings today
- Any action-required emails from last night/this morning
- A one-sentence priority recommendation
Format:
<digest>
(your paragraph here)
</digest>
Edit ~/.claude/settings.json:
{
"permissions": {
"defaultMode": "auto",
"allow": [
"mcp__claude_ai_Gmail__*",
"mcp__claude_ai_Google_Calendar__*",
"Write",
"Read"
]
}
}
This auto-approves Gmail + Calendar tool calls and file operations. No other tools are auto-approved.
Launch Claude Code. Type /daily-digest. Watch it run. Verify the output.
Tune the skill if needed, shorten the summary, change the priority logic, whatever.
Create ~/bin/daily-digest.sh:
#!/bin/bash
cd ~
claude --headless --print --max-turns 10 <<'EOF' >> ~/daily-digest.log 2>&1
/daily-digest
EOF
Make it executable:
chmod +x ~/bin/daily-digest.sh
Run it manually. Check the log.
# crontab -e
30 6 * * 1-5 ~/bin/daily-digest.sh
Runs at 6:30 AM weekdays. Output appends to ~/daily-digest.log.
You have a scheduled, headless, MCP-connected agent running a named skill. That's the base of everything else in this framework.