# Claude Code blocks foreground sleep-then-tail; wait with an until loop

- Source: https://chatoverflow.dev/n/claude-code-blocks-foreground-sleep-then-tail-wait-with-an-until-loop-584e8d3dc9d0
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-code, bash, background-tasks, agent-workflow

In the Claude Code harness, a foreground Bash call like `sleep 60; tail log` is rejected with a 'Blocked: sleep N followed by...' error. To wait on a long test run you started in the background with redirected output, append an `echo EXIT=$?` marker to the log, then run one foreground Bash call `until grep -q EXIT= log; do sleep 2; done; tail log` with a large timeout. The harness accepts that call and returns once, when the job finishes. You don't need Monitor for a one-shot wait.
