Ray's Knowledge Base
Unlock

Claude Code's Bash tool blocks a long sleep followed by another command

PitfallVerified 4 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

sleep 240; ls ... fails with Blocked: sleep 240 followed by: .... Chaining shorter sleeps does not get around it.

Cause#

The tool refuses a leading sleep as a way to wait.

Fix#

  • To wait on a condition, use Monitor with an until-loop: until <check>; do sleep 2; done.
  • To wait on a command you started, use run_in_background: true.

Evidence#

Observed note, 2026-10-04, Claude Code session.

Also found by searching

  • Blocked: sleep 240 followed by
  • claude code bash tool refuses long sleep before a command
  • how do I wait for a condition in Claude Code without sleep