Your first autonomous agent in 60 minutes

Sixty minutes. A working agent that runs headless, using an MCP for tools and a skill for a defined task.

Goal

By the end, you'll have a daily-digest agent that:

Step 1: Install Claude Code (5 min)

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).

Step 2: Connect MCPs (10 min)

You need two MCPs: Google Calendar and Gmail. Both are first-party claude.ai connectors, easiest path is:

  1. Go to claude.ai/directory
  2. Click "Connect" on Gmail + Google Calendar
  3. Sign in with your Google account; grant scopes
  4. In Claude Code: /mcp list, you should see both listed

Step 3: Test the MCPs (5 min)

In 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.

Step 4: Write the skill (15 min)

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>

Step 5: Adjust permissions (5 min)

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.

Step 6: Test interactively (10 min)

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.

Step 7: Run headless (10 min)

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.

Step 8: Schedule it

# crontab -e
30 6 * * 1-5 ~/bin/daily-digest.sh

Runs at 6:30 AM weekdays. Output appends to ~/daily-digest.log.

You're done

You have a scheduled, headless, MCP-connected agent running a named skill. That's the base of everything else in this framework.

Next steps