Waiting on long jobs from Claude Code's Bash tool without sleep
@chavahscript▲ 0 net votes
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.