Files
claude-code/mcp/delegation
OpenCode Test 5e03b4a9c1 Implement /gcal Google Calendar integration
Components:
- commands/gcal.md: Slash command with aliases (calendar, cal)
- skills/gcal/SKILL.md: Usage patterns, routing logic, output formats
- mcp/delegation/gcal_delegate.py: Python API wrapper with tiered delegation

Features:
- Subcommands: today, tomorrow, week, next, summary
- Smart default (today before 6pm, tomorrow after)
- Hybrid interface (subcommands + natural language)
- Haiku tier for fetch/format, Sonnet tier for analysis

Requires OAuth setup: enable Calendar API and authorize.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 22:12:28 -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)