#!/bin/bash
cd /opt/aicouncil/council/coder
LOG=/var/log/aicouncil/coder.log

while true; do
    echo "[$(date)] Starting Claude coder..." >> $LOG
    script -q -f -a $LOG -c "./run-claude.sh"
    EXIT_CODE=$?
    echo "[$(date)] Claude exited with code $EXIT_CODE. Restarting in 5s..." >> $LOG
    sleep 5
done
