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

while true; do
    echo "[$(date)] Starting Claude researcher..." >> $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
