Frankbria/ralph-claude-code is a command-line tool that runs Claude Code through repeated autonomous development cycles until a project is finished. It is intended for developers who want Claude Code to continue implementing and improving software while using exit checks, rate limits, and safeguards against runaway execution. The catalogue instruction describes how to use this development loop.
Borrowing it
Nothing to install: this file belongs to frankbria/ralph-claude-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/frankbria/ralph-claude-code/main/CLAUDE.mdgit clone --depth 1 https://github.com/frankbria/ralph-claude-codeWrote 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/instructions/frankbria/ralph-claude-code/claude-md)<a href="https://agentmods.dev/instructions/frankbria/ralph-claude-code/claude-md"><img src="https://agentmods.dev/badge/instructions/frankbria/ralph-claude-code/claude-md/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/instructions/frankbria/ralph-claude-code/claude-md"><img src="https://agentmods.dev/badge/instructions/frankbria/ralph-claude-code/claude-md.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.11044 | $0.11044 |
| Opus 5.5 | $0.04418 | $0.04418 |
| Sonnet 5.5 | $0.02209 | $0.02209 |
| Haiku 4.5 | $0.01104 | $0.01104 |
Grade B, and why
ralph-claude-code CLAUDE.md 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 16d 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
export E2B_API_KEY="e2b_..." # or ~/.ralph/e2b_api_key (chmod 600) How it starts
The opening of the file, as written. The whole thing — 372 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
Ralph for Claude Code — an autonomous AI development loop system enabling continuous development cycles with intelligent exit detection and rate limiting. See README.md for version info, changelog, and user documentation.
Core Architecture
Main Scripts
- ralph_loop.sh — main autonomous loop that executes Claude Code repeatedly
- ralph_monitor.sh — live monitoring dashboard for tracking loop status
- setup.sh — project initialization for new Ralph projects
- create_files.sh — bootstrap script that creates the entire Ralph system
- ralph_import.sh — converts PRD/spec documents to Ralph format; uses
--output-format jsonwith automatic text fallback for older CLI versions- GitHub issue import (Issue #69):
--github-issue <N>for an exact issue, plus--repo <owner/repo>,--include-comments - Fetches via
ghinto a markdown PRD, then the normal conversion pipeline. Comments off by default (prompt-injection surface); source content is treated as data, not instructions - Metadata filtering + selection (Issue #71), implemented in
resolve_github_issue_candidates()/select_issue_from_candidates()/preview_issue_matches()(replacedresolve_github_issue_number(); "first match" is now oldest, not gh's newest-first):- Combinable primary filters:
--github-search <query>,--github-label <labels>(comma = AND),--github-title <pattern>(*wildcard only, rest literal, case-insensitive),--github-assignee <user|@me|none>,--github-milestone <name>,--github-state <open|closed|all>; modifiers (--exclude-label <labels>,--select,--dry-run) require ≥1 primary filter;--github-issueis mutually exclusive with all of them - One
gh issue list --limit 500query (server-side where gh supports it; exclude-label and title matching client-side via jq); candidates sorted oldest-first. Cap-hit handling (gh returns newest-first, so a capped set may be missing the true oldest matches): WARN for server-side-only queries; hard ERROR when client-side filters are active (they could pick the wrong issue or report zero matches over a truncated set) --select first|interactive|prioritypicks among multiple matches: priority understands bareP0–P9andpriority: PNlabels (ties → oldest, none → first); interactive falls back to first on non-TTY/EOF.--dry-runpreviews the match table + would-be selection without importing
- Combinable primary filters:
- Completeness assessment + plan generation (Issue #70): issues are scored 0–100 via
lib/issue_analyzer.sh; below--completeness-threshold(default 60) an implementation plan is generated via Claude CLI (--plan-modelpassthrough) and appended to the PRD before conversion, plus saved to.ralph/specs/implementation-plan.md. Flags:--generate-plan(force),--no-generate-plan(fail if below threshold),--plan-model <model>,--completeness-threshold <0-100>,--auto-approve(skip the approval prompt; non-TTY sessions auto-accept)
- GitHub issue import (Issue #69):
- ralph_queue.sh —
ralph-queuecommand: batch processing and issue queue management (Issue #72). Builds a persistent queue at.ralph/queue.jsonof GitHub issues (reusesralph_import.sh'sghmachinery:resolve_github_issue_candidates,fetch_github_issue,format_issue_as_prd) or local PRD specs. Subcommands:add(--github-issues N,N| filter flags |--prd <file>),status [--json],next,remove,clear,reorder,validate,process [--halt-on-failure],resume. The sequential processor stages.ralph/from each ready item (priority + dependency order), runs the loop viaRALPH_LOOP_CMD(defaultralph_loop.sh; overridable for tests), commitsFix #N: <title>per issue, skips failures (or halts), and writes.ralph/logs/queue_processing.log. Single branch, no concurrency. See docs/QUEUE_MANAGEMENT.md - GitHub issue lifecycle (Issue #73): when
ralphis run with--github-issue <ref>, it tracks the issue across the loop vialib/github_lifecycle.sh. During development it can post progress comments every N loops (--comment-progress,--comment-interval); on graceful completion it runs a completion workflow — summary comment (--close-summary), PR creation linked withCloses #N(--create-pr --link-issue, optional--draft-pr), grouped follow-up issue from TODO/FIXME markers added during dev (--create-followups --followup-label), and issue close with optional labels (--auto-close --add-label). All steps are opt-in and degrade gracefully (a gh permission failure is logged and the loop continues). State lives in.ralph/.github_lifecycle_state. Uses theghCLI exclusively (not raw REST/GITHUB_TOKEN) - ralph_enable.sh — interactive wizard enabling Ralph in existing projects (environment detection, task source selection, generates
.ralphrc) - ralph_enable_ci.sh — non-interactive version for CI/automation;
--jsonoutput mode; exit codes: 0 (success), 1 (error), 2 (already enabled)
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.
- 16d ago Changed · +62 tokens per session 64bf12e89dbc
- 17d ago Changed · +1 lines · +244 tokens per session d62ddaf8b3d1
- 18d ago Changed · +2 lines · +311 tokens per session d7a3b39745fe
- 19d ago Changed · +1 lines · +274 tokens per session 5f862fc60916
- 20d ago Changed · +5 lines · +689 tokens per session 2349763b8957
- 1mo ago First seen · 363 lines · 9,464 tokens per session scan B 488e404bfccd
ralph-claude-code CLAUDE.md is an instructions file published in the GitHub repository frankbria/ralph-claude-code (9,717 stars, last pushed 2d ago), licensed MIT. It adds 11,044 tokens to every session, about $0.0442 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.