Complete autonomous operation system for Claude Code with time-based, event-based, and queue-based task processing.
- scheduler-mcp - Time-based task triggers (cron expressions)
- bullmq-mcp - Task queue management with Redis
- sqlite - Persistent state storage
- webhook-mcp - Event-based triggers
- Redis - Running in Docker on port 6379
- SQLite Database -
autonomous-state.dbfor persistent storage
orchestrator.py- Python orchestration engineorchestrator.ts- TypeScript orchestration engine (alternative)start.bat- Quick start scripttest-task.bat- Test autonomous operationmanage-safety.bat- Safety controls management
- Rate limiting (20 tasks/hour, 200 tasks/day)
- Circuit breaker (stops after 5 consecutive failures)
- High-risk operation detection
- Audit logging
cd C:\Users\Tanner\.claude\autonomous
.\test-task.batThis runs a simple health check task to verify everything works.
.\start.batChoose Python (P) or TypeScript (T) version when prompted.
- Uses Windows Task Scheduler
- Claude Code CLI in headless mode
- Each run is independent
Setup:
- Open Task Scheduler
- Create new task
- Set trigger (e.g., hourly)
- Action:
claude -p "your task" --output-format stream-json
- Orchestrator runs continuously
- Monitors all trigger types
- Full state management
Setup:
# Start the orchestrator
cd C:\Users\Tanner\.claude\autonomous
python orchestrator.py
# Or with PM2 for auto-restart:
npm install -g pm2
pm2 start orchestrator.py --name claude-autonomous
pm2 save- CLI for simple tasks
- Service for complex workflows
- Shared state via database
Edit safety-config.json:
{
"maxTasksPerHour": 20,
"maxTasksPerDay": 200,
"maxConsecutiveFailures": 5,
"circuitBreakerThreshold": 10
}Manage safety controls:
.\manage-safety.batMCPs are configured in .claude.json:
- scheduler-mcp:
C:\Users\Tanner\.claude\mcp-servers\scheduler-mcp - bullmq-mcp: Connected to Redis at
redis://localhost:6379 - sqlite: Database at
C:\Users\Tanner\.claude\autonomous-state.db - webhook-mcp: Ready for webhook events
type C:\Users\Tanner\.claude\autonomous\orchestrator.log.\manage-safety.bat
# Choose option 1: View Current StatusStored in SQLite database - use SQLite MCP to query.
- Hourly: Max 20 tasks
- Daily: Max 200 tasks
- Automatically resets every hour/day
- Opens after 5 consecutive failures
- Requires manual reset
- Prevents runaway operations
Warns on operations like:
rmcommands- Docker removals
- Force git pushes
.envfile modifications
.\manage-safety.bat
# Choose option 2: Reset Circuit BreakerUse scheduler MCP to create cron-based tasks:
// Add to orchestrator
const task = {
name: "daily_backup",
cron: "0 0 * * *", // Daily at midnight
prompt: "Create a backup of important files and report status"
};Use BullMQ MCP to add jobs:
// Via Claude Code
await bullmq.addJob({
name: "process_data",
priority: 1,
data: { source: "api", destination: "database" }
});Configure webhook MCP with your webhook URL:
# Set environment variable
setx WEBHOOK_URL "https://your-webhook-service.com/notify"Monitor GitHub repos for issues and auto-create PRs for fixes.
Scrape web β analyze β generate reports β deploy to Netlify.
Monitor logs β detect issues β investigate β fix automatically.
Scheduled ETL, analysis, and reporting.
Continuous test generation and execution.
docker start redis-autonomousdocker stop redis-autonomousdocker logs redis-autonomousdocker exec redis-autonomous redis-cli ping
# Should return: PONG- Check Redis is running:
docker ps | grep redis - Check Python dependencies:
cd C:\Users\Tanner\.claude\mcp-servers\scheduler-mcp && .venv\Scripts\python -m pip list - View logs:
type orchestrator.log
- Check logs for error pattern:
type orchestrator.log | findstr ERROR - Fix underlying issue
- Reset breaker:
.\manage-safety.batβ Option 2
- Check rate limits:
.\manage-safety.batβ Option 1 - Verify MCP servers:
claude mcp list - Test manually:
.\test-task.bat
- Restart Redis:
docker restart redis-autonomous - Check port 6379 is available:
netstat -an | findstr 6379 - Verify REDIS_URL in
.claude.json
- Claude Code Docs: https://docs.claude.com/en/docs/claude-code
- MCP Protocol: https://modelcontextprotocol.io
- BullMQ Docs: https://docs.bullmq.io
- Scheduler MCP: https://github.com/PhialsBasement/scheduler-mcp
- Review All Tasks before enabling autonomous mode
- Set Conservative Rate Limits initially
- Monitor Logs Daily for first week
- Test in Isolation before production use
- Keep API Keys Secure - never commit to git
- Enable Audit Logging for all operations
- Use Manual Approval for high-risk operations
- Claude API: $3-15 per 1M tokens
- Infrastructure: $0 (local Docker)
- Total: ~$10-50/month depending on usage
- Claude API: $50-200/month
- VPS: $20-50/month
- Monitoring: $20-50/month
- Total: ~$90-300/month
For issues or questions:
- Check logs:
orchestrator.log - Run diagnostics:
claude doctor - View MCP status:
claude mcp list - Test manually:
.\test-task.bat
- Test the Setup: Run
.\test-task.bat - Create Your First Task: Modify
orchestrator.pywith your use case - Monitor for a Day: Watch logs and safety status
- Gradually Increase Limits: As confidence grows
- Add More Tasks: Build your autonomous workflows
Version: 1.0.0 Created: 2025-10-07 Platform: Windows with Docker
Happy automating! π€β¨