Skip to content
RALPH LOOP

Running the Ralph Loop with custom options

Terminal window
# Run the agent loop (default: 10 iterations)
./ralph.sh
# Run with custom iteration limit
./ralph.sh 5
./ralph.sh -n 5
./ralph.sh --max-iterations 5
# Run exactly one iteration
./ralph.sh --once
# Run with a different supported agent
./ralph.sh --agent codex
./ralph.sh -a cursor -n 5
# Log in to an agent inside Ralph's deterministic sandbox
./ralph.sh --login
./ralph.sh --login --agent cursor
# Publish the configured dev port to the selected agent sandbox
./ralph.sh --ports
./ralph.sh --ports --agent codex
# Print the deterministic sandbox name
./ralph.sh --print-name
./ralph.sh --print-name --agent codex
# Pass extra options to the selected agent
./ralph.sh --agent codex -- --model gpt-5.5
./ralph.sh -a gemini -- --model pro
# Show help
./ralph.sh --help

NB: you might need to run chmod +x ralph.sh to make the script executable.

The default “mode” is “implementation”. Depending on your use case, you might want to change .agent/PROMPT.md to a different mode, e.g. “refactor”, “review”, “test” etc.

⚠️ If you want to use a different language or testing framework, see below.

(Optional) Adjusting to your language/framework

Section titled “(Optional) Adjusting to your language/framework”

This script assumes the following are installed:

If you’d like to use a different language, testing framework etc. please adjust .agent/PROMPT.md to reflect your setup, server ports and startup commands etc.

👉 The loop is controlled by this prompt, which will be sent to the agent each iteration.