Autonomous crash detection and repair using Claude CLI.
- Daemon Process (
autofixer/server.js): Monitors PM2 for crashed processes registered in PortOS - UI Server (
autofixer/ui.js): Web interface for viewing logs and fix history on port 5560 - PM2 Integration: Runs as
portos-autofixerandportos-autofixer-uiprocesses
- Crash Detection: Polls PM2 every 15 minutes for
erroredstatus on registered apps - Auto-Fix: Invokes Claude CLI with crash context (error logs, app info) to diagnose and repair
- Session History: Stores fix attempts with prompts, outputs, and success/failure status
- Cooldown: 30-minute cooldown per process to prevent repeated fix loops
- Log Streaming: Real-time SSE log streaming from any PM2 process
- Tailscale Compatible: Dynamic hostname for remote access
./data/autofixer/
├── index.json # Fix session index
└── sessions/
└── {sessionId}/
├── prompt.txt # Prompt sent to Claude
├── output.txt # Claude's response
└── metadata.json # Session details
Port 5560 provides:
- Process sidebar with live status indicators
- SSE-powered log viewer with pause/clear controls
- History tab showing fix attempts with success/failure status
- Links back to PortOS Dashboard
| Setting | Value |
|---|---|
| UI Port | 5560 |
| Check Interval | 15 minutes |
| Fix Cooldown | 30 minutes |
| Max History | 100 entries |