Building a serverless AI agent platform on AWS for $0.01/month with Claude Code

Project Overview
Serverless OpenClaw is a full-stack serverless AI agent platform built entirely through conversational prompts to Claude Code over 29 hours across 5 weeks. The platform runs the OpenClaw AI agent on-demand on AWS with a React web chat UI and Telegram bot, deploying the entire infrastructure with a single cdk deploy command.
Technical Details
Cost Optimization: The project reduced monthly costs from a typical ~$70+ serverless setup down to $0.01/month on Lambda with zero idle costs. Specific eliminations include:
- NAT Gateway: -$32/month
- ALB (Application Load Balancer): -$18/month
- Fargate always-on: -$15/month
- Interface VPC Endpoints: -$7/month each
- Provisioned DynamoDB: Variable savings
Performance Metrics:
- Cold start: 1.35s (Lambda), 0.12s warm
- Total AWS cost during development: ~$0.25
- Monthly running cost: ~$0.01 (Lambda)
Code Quality:
- Unit tests: 233
- E2E tests: 35
- CDK stacks: 8
- TypeScript packages: 6 (monorepo)
Development Process
The entire project was built without manual coding—just prompts, reviews, and course corrections. Claude Code was used for:
- Architecture design: "Design a serverless platform that costs under $1/month" → Claude Code produced the PRD, CDK stacks, network design
- TDD workflow: Claude Code wrote tests first, then implementation (233 tests before a single deploy)
- Debugging sessions: Docker build failures, cold start optimization (68s → 1.35s), WebSocket auth issues
- Phase 2 migration: Moved from Fargate to Lambda Container Image mid-project, including S3 session persistence and smart routing
The prompts were originally in Korean, and Claude Code handled bilingual development seamlessly.
Tech Stack
TypeScript monorepo (6 packages) on AWS using: CDK for IaC, API Gateway (WebSocket + REST), Lambda + Fargate Spot for compute, DynamoDB, S3, Cognito auth, CloudFront + React SPA, Telegram Bot API. Multi-LLM support via Anthropic API and Amazon Bedrock.
Practical Patterns
API Gateway instead of ALB: Saves $18+/month. WebSocket + REST on API Gateway with Lambda handlers.
Tutorial Structure
The 7-chapter "vibe coding" tutorial documents every prompt, failure, and fix:
- Chapter 1: The $1/Month Challenge (~2h) - PRD, architecture design, cost analysis
- Chapter 2: MVP in a Weekend (~8h) - 10-step Phase 1, CDK stacks, TDD
- Chapter 3: Deployment Reality Check (~4h) - Docker, secrets, auth, first real deploy
- Chapter 4: The Cold Start Battle (~6h) - Docker optimization, CPU tuning, pre-warming
- Chapter 5: Lambda Migration (~4h) - Phase 2, embedded agent, S3 sessions
- Chapter 6: Smart Routing (~3h) - Lambda/Fargate hybrid, cold start preview
- Chapter 7: Release Automation (~2h) - Skills, parallel review, GitHub releases
Each chapter includes: the actual prompt given → what Claude Code did → what broke → how we fixed it → lessons learned → reproducible commands.
📖 Read the full source: r/ClaudeAI
👀 See Also

Running OpenClaw Locally with Ollama to Avoid API Costs
A Reddit user shares their experience switching from API-based OpenClaw to running it locally with Ollama, eliminating API costs while maintaining workflows. They created a step-by-step installation video guide.

Cut Token Costs by 95% with OpenClaw's Seven Optimization Techniques
A comprehensive guide detailing seven techniques to reduce AI agent token consumption by 95%+, including tree-structured boot files, AI auto-compression, local model offloading, and cron-based CPU tasks.

OpenClaw setup guide from Reddit analysis: hardware, cost, memory, and security practices
A Reddit user analyzed common OpenClaw mistakes and created a setup guide covering hardware requirements, cost optimization to $10/month, memory management using MEMORY.md files, and security practices to prevent prompt injection attacks.

How to Migrate OpenClaw and Hermes Between Machines Using SSH Self-Migration
A user transferred OpenClaw and Hermes from WSL2 Ubuntu on a laptop to an EVO-X2 WSL2 Ubuntu 2604 instance by having the tools SSH in and migrate themselves.