Files
claude-code/mcp/delegation
OpenCode Test 2e128d54ef Fix gcal_delegate.py timestamp format
Remove redundant 'Z' suffix from isoformat() - timezone-aware
datetimes already include +00:00 offset, so appending 'Z' created
invalid RFC3339 timestamps that Google Calendar API rejected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 22:15:31 -08:00
..

Model Delegation Helper

Spawns lower-tier Claude models via Claude CLI using your subscription.

Setup

No API key needed! Uses Claude CLI with your existing subscription.

Requirements:

  • Claude CLI at /home/linuxbrew/.linuxbrew/bin/claude
  • Active Claude subscription (Pro/Max)

Usage

Gmail operations (tiered)

PY=~/.claude/mcp/gmail/venv/bin/python
HELPER=~/.claude/mcp/delegation/gmail_delegate.py

# Haiku tier - just fetch and list (no LLM call)
$PY $HELPER check-unread --days 7

# Sonnet tier - fetch + summarize (uses claude CLI)
$PY $HELPER summarize --query "from:github.com"

# Sonnet tier - urgent triage (uses claude CLI)
$PY $HELPER urgent

Model Tiers

Tier Model LLM Call Use For
haiku (none - just fetch) No List, count, group emails
sonnet claude --model sonnet Yes Summarize, categorize, triage
opus (PA direct) N/A Complex reasoning, prioritization

How It Works

  1. check-unread: Fetches emails via Gmail API, groups by sender. No LLM needed.
  2. summarize: Fetches emails, then spawns claude --print --model sonnet to summarize.
  3. urgent: Fetches flagged emails, spawns Sonnet to triage by urgency.

Integration with PA

The Personal Assistant (Opus) delegates gmail operations:

User Request Delegation Model Used
"Check my email" check-unread None (fetch only)
"Summarize X emails" summarize Sonnet via CLI
"What's urgent?" urgent Sonnet via CLI
"What should I prioritize?" (direct) Opus (PA)