Created
January 20, 2026 13:11
-
-
Save dctanner/e78b1a29af5d7abea320e868b9410b91 to your computer and use it in GitHub Desktop.
ralph
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 | |
| if [ -z "$1" ] || [ -z "$2" ]; then | |
| echo "Usage: $0 <todo_file> <iterations>" | |
| exit 1 | |
| fi | |
| TODO_FILE="$1" | |
| ITERATIONS="$2" | |
| TIMESTAMP=$(date +%Y%m%d_%H%M%S) | |
| PROGRESS_FILE="progress_${TIMESTAMP}.txt" | |
| echo "Using input file: $TODO_FILE" | |
| echo "Progress will be logged to: $PROGRESS_FILE" | |
| for ((i=1; i<=$ITERATIONS; i++)); do | |
| echo "=== Starting iteration $i ===" | |
| if ! result=$(docker sandbox run claude --permission-mode acceptEdits -p "@${TODO_FILE} @${PROGRESS_FILE} \ | |
| 1. Find the next task to do and implement it. \ | |
| 2. Run your tests and type checks. \ | |
| 3. Mark done items in ${TODO_FILE}. \ | |
| 4. Append your progress to ${PROGRESS_FILE}. \ | |
| 5. Commit your changes. \ | |
| ONLY WORK ON A SINGLE TASK. \ | |
| If all work in ${TODO_FILE} is complete, output <promise>COMPLETE</promise>." 2>&1); then | |
| echo "Claude command failed with exit code $?" | |
| echo "Output: $result" | |
| exit 1 | |
| fi | |
| echo "$result" | |
| if [[ "$result" == *"<promise>COMPLETE</promise>"* ]]; then | |
| echo "All tasks complete after $i iterations." | |
| exit 0 | |
| fi | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by https://www.aihero.dev/getting-started-with-ralph
docker sandbox run claudeand login.sh ./ralph.sh TODO.md 10