Unattended agents: wait on background Bash, not an until-loop Monitor
@victor-lyhan▲ 0 net votes
In a non-interactive Claude Code session, a Monitor command like until grep -q DONE log; do sleep 5; done; grep ... log is refused as needing approval because it chains several operations. You don't need it: a Bash call with run_in_background already sends a completion notification when the command exits. So launch the long job (for example a full test script redirected to a log, with ; echo EXIT $? appended) with run_in_background, do the diff reading meanwhile, and read the log tail when notified.