ralph-claude-code: Instructions file for Claude Code

CLAUDE.md

ralph-claude-code CLAUDE.md is an instructions file for Claude Code from frankbria/ralph-claude-code. It costs 11,044 tokens per session, scanned B, original, MIT.

A system for running repeated Claude Code development cycles, with monitoring, rate limiting, exit detection, and tools for importing project requirements.

In plain words
What is it for?
Use it to start and monitor autonomous coding loops, set up projects, convert specifications into tasks, and import GitHub issues and their comments.
Why use it?
It helps automate ongoing development while showing whether the loop is still working and preventing unbounded or unnecessary runs.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is frankbria/ralph-claude-code's own configuration. It tells Claude Code how to work on ralph-claude-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ralph-claude-code configures →

About the project

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.

frankbria/ralph-claude-code · 9,717 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/frankbria/ralph-claude-code/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/frankbria/ralph-claude-code

Made for: Claude Code.

Wrote 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.

agentmods badge for ralph-claude-code CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/frankbria/ralph-claude-code/claude-md/github.svg)](https://agentmods.dev/instructions/frankbria/ralph-claude-code/claude-md)
Your own site
<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.

agentmods 80×15 button for ralph-claude-code CLAUDE.md

Your own site · 80×15
<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>
Per session 11,044 This file is loaded in full into every session.
When invoked 11,044 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 16d ago against content hash 64bf12e89dbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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)
CLAUDE.md · 372 lines

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 json with 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 gh into 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() (replaced resolve_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-issue is mutually exclusive with all of them
      • One gh issue list --limit 500 query (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|priority picks among multiple matches: priority understands bare P0–P9 and priority: PN labels (ties → oldest, none → first); interactive falls back to first on non-TTY/EOF. --dry-run previews the match table + would-be selection without importing
    • 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-model passthrough) 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)
  • ralph_queue.sh — ralph-queue command: batch processing and issue queue management (Issue #72). Builds a persistent queue at .ralph/queue.json of GitHub issues (reuses ralph_import.sh's gh machinery: 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 via RALPH_LOOP_CMD (default ralph_loop.sh; overridable for tests), commits Fix #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 ralph is run with --github-issue <ref>, it tracks the issue across the loop via lib/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 with Closes #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 the gh CLI 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; --json output mode; exit codes: 0 (success), 1 (error), 2 (already enabled)

Read the full file on GitHub · 372 lines

Changes

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.

  1. 16d ago Changed · +62 tokens per session 64bf12e89dbc
  2. 17d ago Changed · +1 lines · +244 tokens per session d62ddaf8b3d1
  3. 18d ago Changed · +2 lines · +311 tokens per session d7a3b39745fe
  4. 19d ago Changed · +1 lines · +274 tokens per session 5f862fc60916
  5. 20d ago Changed · +5 lines · +689 tokens per session 2349763b8957
  6. 1mo ago First seen · 363 lines · 9,464 tokens per session scan B 488e404bfccd

Subscribe to this mod's changes

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.

Related

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).

microsoft/vscode · 9,715 tokens

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.

vercel/next.js · 7,786 tokens

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).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

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).

microsoft/vscode · 2,731 tokens

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.

denoland/deno · 3,077 tokens