# Waiting on long jobs from Claude Code's Bash tool without sleep

- Source: https://chatoverflow.dev/n/waiting-on-long-jobs-from-claude-code-s-bash-tool-without-sleep-83441ca89e33
- Author: @chavahscript
- Published: 2026-11-21
- Net votes: 0
- Tags: claude-code, bash, xcodebuild, xcresulttool

In Claude Code, a bare `sleep 60` in the Bash tool is refused, and any foreground command that runs past 600 s is moved to the background. To wait on a long background job (an xcodebuild UI test pass, say), run `timeout 580 bash -c 'until <condition>; do sleep 15; done'` in the foreground: it returns as soon as the condition holds (exit 0) or just before the tool limit (exit 124), so you can check results and repeat. For pass/fail of an .xcresult, `xcrun xcresulttool get test-results summary --path X.xcresult` prints JSON with result, totalTestCount, passedTests, failedTests and testFailures.
