The Technique: Schedule as Your Automated Engineer
Claude Code's Schedule feature is a game-changer for solo developers and small teams. It runs tasks on a cron-like schedule directly in Anthropic's cloud infrastructure. No servers to manage, no additional API costs beyond your Claude Pro subscription.
Why It Works: Serverless Automation
The key insight: Schedule can only make HTTP requests via WebFetch. This limitation forces a clean architecture where you create thin API endpoints that expose your data and operations. The developer in this case used Supabase Edge Functions as that thin layer, connecting to PostgreSQL for persistence.
How To Apply It: Build Your Own Automation Stack
1. Define Your Tasks in CLAUDE.md
Create task definitions that Claude can execute. Each task should be a self-contained operation:
## TASK: cs-check
Frequency: Hourly
Purpose: Read support tickets and respond via FAQ or fix bugs
When triggered:
1. Fetch new tickets from /api/tickets/unread
2. For each ticket, check if answer exists in FAQ database
3. If yes, post reply via /api/tickets/reply
4. If bug, create fix branch and PR via /api/github/fix
5. Log execution to schedule_task_runs table
2. Create Thin Edge Functions
Since Schedule only speaks HTTP, you need endpoints. Here's a minimal Supabase Edge Function example:
// /supabase/functions/get-tickets/index.ts
export default async (req: Request) => {
const { data, error } = await supabase
.from('tickets')
.select('*')
.eq('status', 'unread');
return new Response(JSON.stringify({ tickets: data }), {
headers: { 'Content-Type': 'application/json' }
});
};
3. Configure RLS Policies
Schedule runs as service_role, so set up Row Level Security policies appropriately:
-- Allow service_role full access for automation tasks
CREATE POLICY "schedule_full_access" ON "tickets"
FOR ALL USING (auth.role() = 'service_role');
4. Set Up Logging
Create a schedule_task_runs table to track everything:
CREATE TABLE schedule_task_runs (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
task_name TEXT NOT NULL,
started_at TIMESTAMPTZ DEFAULT NOW(),
completed_at TIMESTAMPTZ,
status TEXT CHECK (status IN ('success', 'failure', 'running')),
logs JSONB,
error_message TEXT
);
5. Schedule Your Tasks
Use the Claude Code interface to set up schedules:
- cs-check: Hourly
- competitor-monitoring: Daily at 7 AM
- infra-health-check: Every 30 minutes
- pr-auto-review: Every 3 hours
Real-World Task Examples
Competitor Monitoring Task
## TASK: competitor-monitoring
Frequency: Daily 7 AM
When triggered:
1. Fetch competitor data from /api/competitors/list
2. For each competitor, scrape homepage via WebFetch
3. Compare with yesterday's snapshot
4. Detect changes in pricing, features, announcements
5. Post significant changes to internal Slack via webhook
6. Update competitor_snapshots table
Bug Fix Automation
## TASK: cs-check (bug fix path)
When ticket contains "bug" or "error":
1. Analyze error logs from /api/logs/recent
2. Generate fix using Claude's code understanding
3. Create branch: fix/bug-{ticket_id}
4. Commit changes
5. Open PR with description of fix
6. Update ticket status to "fix_in_progress"
Key Implementation Details
- Keep Edge Functions minimal - They should just fetch data or trigger actions. Let Claude do the heavy thinking.
- Use WebFetch for external data - Competitor websites, RSS feeds, API status checks.
- Batch operations - Schedule can run for up to 5 minutes, so group related tasks.
- Implement retry logic - Log failures and retry important tasks.
Cost Structure
- Claude Pro: $20/month (you're already paying for development)
- Additional API costs: $0
- Server costs: $0
- Total automation overhead: $0
This follows Anthropic's pattern of adding practical, developer-focused features to Claude Code that leverage their existing infrastructure. The Schedule feature turns CLAUDE.md from a static documentation file into a living operations manual that executes your instructions automatically.








