Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboardingWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/ralph-loop)<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/ralph-loop"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/ralph-loop/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/ralph-loop"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/ralph-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.01583 |
| Opus 5.5 | $0.00020 | $0.00633 |
| Sonnet 5.5 | $0.00010 | $0.00317 |
| Haiku 4.5 | $0.00005 | $0.00158 |
Grade B, and why
ralph-loop scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
cat > "$CLAUDE_PROJECT_DIR/.claude/ralph-loop.local.md" <<EOF How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ralph Loop
Start an autonomous iteration loop for the given task.
Setup
# Parse arguments and create state file
ARGS="$ARGUMENTS"
PROMPT_PARTS=()
MAX_ITERATIONS=10
COMPLETION_PROMISE="null"
VERIFY_CMD="null"
while [[ $# -gt 0 ]]; do
case "$1" in
--max-iterations)
MAX_ITERATIONS="$2"; shift 2 ;;
--completion-promise)
COMPLETION_PROMISE="$2"; shift 2 ;;
--verify-cmd)
VERIFY_CMD="$2"; shift 2 ;;
*)
PROMPT_PARTS+=("$1"); shift ;;
esac
done
PROMPT="${PROMPT_PARTS[*]}"
if [[ -z "$PROMPT" ]]; then
echo "❌ No prompt provided. Usage: /ralph-loop \"Your task\" --max-iterations 10"
exit 1
fi
mkdir -p "$CLAUDE_PROJECT_DIR/.claude"
if [[ "$COMPLETION_PROMISE" != "null" ]]; then
CP_YAML="\"$COMPLETION_PROMISE\""
else
CP_YAML="null"
fi
if [[ "$VERIFY_CMD" != "null" ]]; then
VC_YAML="\"$VERIFY_CMD\""
else
VC_YAML="null"
fi
cat > "$CLAUDE_PROJECT_DIR/.claude/ralph-loop.local.md" <<EOF
---
active: true
iteration: 1
max_iterations: $MAX_ITERATIONS
completion_promise: $CP_YAML
verify_cmd: $VC_YAML
started_at: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
---
$PROMPT
EOF
# Progress state file (separate from the hook-managed loop file — survives loop end).
# If one already exists, KEEP it: a re-run after a crash/cancel resumes from prior progress.
RALPH_STATE="$CLAUDE_PROJECT_DIR/.claude/ralph-state.local.md"
if [[ -f "$RALPH_STATE" ]]; then
echo "📄 Existing ralph-state.local.md found — resuming with prior progress/escalations."
echo " (Starting an unrelated task? Delete it first: rm .claude/ralph-state.local.md)"
else
cat > "$RALPH_STATE" <<EOF
# Ralph loop state
## Last run
$(date -u +%Y-%m-%dT%H:%M:%SZ) · iteration 1 · loop started
## In progress
- (nothing yet)
## Completed
- (nothing yet)
## Escalated to humans (do NOT retry)
- (none)
## Lessons learned (durable discoveries — write here, not in chat)
- (none)
## Attempt counts
- (sub-task: N failed attempts)
EOF
fi
echo ""
echo "🔄 Ralph loop activated!"
echo " Iteration: 1 of $(if [[ $MAX_ITERATIONS -gt 0 ]]; then echo $MAX_ITERATIONS; else echo '∞ (unlimited)'; fi)"
if [[ "$COMPLETION_PROMISE" != "null" ]]; then
echo " Promise: $COMPLETION_PROMISE"
if [[ "$VERIFY_CMD" != "null" ]]; then
echo " Verifier: $VERIFY_CMD (must exit 0 — the promise alone will NOT end the loop)"
fi
echo ""
echo "═══════════════════════════════════════════════"
echo " To exit: output <promise>$COMPLETION_PROMISE</promise>"
echo " ONLY when the statement is GENUINELY TRUE."
if [[ "$VERIFY_CMD" != "null" ]]; then
echo " The loop then runs: $VERIFY_CMD"
echo " Exit happens ONLY if that command returns exit 0."
fi
echo " Do NOT output a false promise to escape."
echo "═══════════════════════════════════════════════"
fi
echo ""
echo " Monitor: head -5 .claude/ralph-loop.local.md"
echo " Cancel: /cancel-ralph"
echo ""
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 133 lines · 49 tokens per session scan B 1d420093ff05
ralph-loop is a command published in the GitHub repository kumaran-is/claude-code-onboarding (37 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 1,583 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
ralph-loop compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ralph-loopkumaran-is/claude-code-onboarding | Command | 37 | yesterday | MIT | B | 49 | Claude Code |
| checklistgithub/spec-kit | Command | 153k | today | MIT | A | 13 | Claude Code |
| clarifygithub/spec-kit | Command | 153k | today | MIT | A | 27 | Claude Code |
| specifygithub/spec-kit | Command | 153k | today | MIT | A | 13 | Claude Code |
| analyzegithub/spec-kit | Command | 153k | today | MIT | A | 26 | Claude Code |
| convergegithub/spec-kit | Command | 153k | today | MIT | A | 35 | Claude Code |
| implementgithub/spec-kit | Command | 153k | today | MIT | A | 14 | Claude Code |