← ClaudeAtlas

principle-non-blocking-waitslisted

Apply when a procedure waits on something outside the session — CI, a reviewer, a vendor CLI, a long job. Spend the wait in one backgrounded call the harness reports on, never in foreground sleeps that occupy the turn.
bostonaholic/team · ★ 11 · AI & Automation · score 75
Install: claude install-skill bostonaholic/team
# Non-Blocking Waits Waiting is not work. A wait on anything outside the session — CI, a reviewer, a vendor CLI, a long job — is one **backgrounded** call that ends when the thing being waited on ends. Never a foreground `sleep`, and never a poll loop over a task whose completion the harness already reports. **Why:** a foreground wait spends a whole turn producing nothing, and it is the turn, not the wall-clock, that costs. The session is idle either way; the difference is whether the model is re-invoked once at the end or once per fragment. A 24-hour watch built from foreground sleeps costs ~192 turns and re-sends the full context on each one. The same watch built from backgrounded waits costs one turn per cycle. A foreground wait is also **capped by the harness, not by your budget**. Claude Code kills a foreground Bash call at 600 s. A stated `timeout 1800` on a foreground call is a cap that never applies: the call dies at ten minutes with exit 143, and whatever it was watching is lost. Sizing sleeps to just miss the ceiling (`sleep 570`, `sleep 590`) trades one failure for three turns and still drifts past the cap whenever the host suspends. **Pattern:** - **Background the wait.** One Bash call with `run_in_background: true`. The harness re-invokes on exit, so the completion notification *is* the wake-up. No ceiling applies. - **Put the poll inside the same backgrounded call** — `sleep <interval>; <poll command>`. One call per cycle, and the result is already in