Guides
Claude Code Agent
Deploy long-running agent server with Claude Code/Agent SDK. Docker deployment, WebSocket streaming, extended sessions.
Claude Code Agent
Back to: Cloudflare Deploy
Deploy a long-running agent server for tasks that exceed Cloudflare Workers' 30-second timeout.
Overview
The Claude Code Agent (Tier 2) is designed for:
- Long-running sessions - No 30s timeout limit
- WebSocket streaming - Real-time response streaming
- Code execution - Filesystem access, shell tools
- Extended context - Multi-turn complex conversations
When to Use
| Use Case | Agent Type | Why |
|---|---|---|
| Quick Q&A, greetings | Cloudflare Agent | Fast, serverless |
| Webhook handlers | Cloudflare Agent | Fire-and-forget pattern |
| Complex research | Claude Code Agent | Needs extended time |
| Code generation + testing | Claude Code Agent | Filesystem access |
| Multi-step workflows | Claude Code Agent | Session persistence |
Comparison
| Aspect | Cloudflare Agent | Claude Code Agent |
|---|---|---|
| Runtime | Cloudflare Workers + DO | Docker container |
| Timeout | 30 seconds | Unlimited |
| State | Durable Objects | In-memory/filesystem |
| Latency | Ultra-low (edge) | Higher (single region) |
| Scaling | Automatic, global | Manual, container-based |
| Tools | MCP servers only | Shell, filesystem, git |
Prerequisites
- Docker installed
- Server with persistent storage (or Fly.io, Railway, etc.)
Environment Variables
Deploy with Docker
Docker Compose
Health Check
Architecture
Future: Integration with Cloudflare Agent
Note: This is a planned feature for future implementation (Tier 2 integration).
The CloudflareChatAgent could escalate to Tier 2 (Claude Code Agent) when:
- Task requires filesystem access
- Task needs extended execution time
- Complex code operations are needed
- User explicitly requests long-running mode
Next Steps
- Telegram Bot - Tier 1 Telegram interface
- GitHub Bot - Tier 1 GitHub integration
- Cloudflare Deploy - Deployment overview