Last active
July 14, 2026 22:16
-
-
Save portfola/0426a2ad41e48d4b0eb1acd282f04f60 to your computer and use it in GitHub Desktop.
ralph loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| n=1; while :; do | |
| echo "=== Task loop #$n starting at $(date) ===" | |
| output=$(claude --dangerously-skip-permissions --print --verbose < PROMPT.md 2>&1 | tee /dev/tty) | |
| if echo "$output" | grep -qE "You.ve hit your ([[:alnum:]-]+ )?limit"; then | |
| echo "=== Rate limited. Stopping loop #$n at $(date) ===" | |
| break | |
| fi | |
| if echo "$output" | grep -q "ALL TASKS COMPLETE"; then | |
| echo "=== All tasks complete. Stopping loop #$n at $(date) ===" | |
| break | |
| fi | |
| echo "=== Run #$n complete at $(date). Restarting in 10s... ===" | |
| ((n++)) | |
| sleep 10 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment