agent-tui: Command for Claude Code

.claude/commands/ralph-init.md

ralph-init is a command for Claude Code from pproenca/agent-tui. It costs 21 tokens per session (3,350 once invoked), scanned B, original, MIT.

A command that sets up a RALPH loop, an approach where an agent repeats small tasks and saves its progress in project files and Git history.

In plain words
What is it for?
Use it to create the .ralph/ files and runner script needed to plan, repeat, monitor, and record an automated development task.
Why use it?
It turns a large piece of work into a tracked specification, task list, instructions, progress log, and machine-readable status file.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool; positional $N argument.

This is pproenca/agent-tui's own configuration. It tells Claude Code how to work on agent-tui 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 agent-tui configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pproenca/agent-tui. 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/pproenca/agent-tui/master/.claude/commands/ralph-init.md
Clone the repo
git clone --depth 1 https://github.com/pproenca/agent-tui

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-init

README.md
[![agentmods](https://agentmods.dev/badge/commands/pproenca/agent-tui/ralph-init/github.svg)](https://agentmods.dev/commands/pproenca/agent-tui/ralph-init)
Your own site
<a href="https://agentmods.dev/commands/pproenca/agent-tui/ralph-init"><img src="https://agentmods.dev/badge/commands/pproenca/agent-tui/ralph-init/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-init

Your own site · 80×15
<a href="https://agentmods.dev/commands/pproenca/agent-tui/ralph-init"><img src="https://agentmods.dev/badge/commands/pproenca/agent-tui/ralph-init.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,350 The whole file, excluding the scripts and references it only reads on demand.
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.00021 $0.03350
Opus 5.5 $0.00008 $0.01340
Sonnet 5.5 $0.00004 $0.00670
Haiku 4.5 $0.00002 $0.00335

Measured 2mo ago against content hash d23d449a54df, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

ralph-init 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.

Asks the agent to reveal its instructionsmediumSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

# .ralph/ralph-loop.sh --dry-run # Show prompt without running
.claude/commands/ralph-init.md · 459 lines

How it starts

The opening of the file, as written. The whole thing — 459 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RALPH Loop Initialization

Create a complete RALPH (Repetitive Autonomous Loop with Persistent History) setup in .ralph/ directory.

What is RALPH?

RALPH is an autonomous AI agent pattern where progress persists in files and git history, not the LLM context. Each iteration gets fresh context, picks up from files, implements one task, commits, and repeats until done.

Core Principle

Files are memory. Progress lives in:

  • SPEC.md - The PRD/requirements (what to build)
  • TODO.md - Prioritized task checklist (what's left)
  • PROMPT.md - Instructions for each iteration (how to work)
  • progress.txt - Learnings log (what was discovered)
  • status.json - Machine-readable state (for monitoring)
  • Git history - What's been done

Interactive Setup Flow

Ask these questions using AskUserQuestion tool:

1. Task Identity

  • Task name: Short identifier (e.g., "workspace-migration", "auth-feature")
  • Description: One-line summary of what RALPH will accomplish

2. Specification Details

  • Goal: What is the end state? (Be specific and measurable)
  • Phases: Break work into 2-5 phases (each phase = group of related tasks)
  • Success criteria: How do we know it's done? (tests pass, builds succeed, etc.)

3. Task Breakdown

For each phase, ask:

  • What are the individual tasks? (Each should fit in one context window)
  • What order should they execute?
  • What verification command confirms each task?

4. Context

  • Plan file path: Optional reference to an existing plan (e.g., ~/.claude/plans/my-plan.md)
  • Import mappings: Any before/after mappings for refactoring tasks

File Generation

After collecting answers, generate these files:

.ralph/SPEC.md

# [Task Name] Specification

## Goal
[One paragraph describing the end state]

## Success Criteria
- [ ] [Measurable criterion 1]
- [ ] [Measurable criterion 2]
- [ ] Final verification: `[command]` passes

## Phases

### Phase 1: [Name]
[Description of this phase's purpose]

### Phase 2: [Name]
[Description]

[... more phases]

## Context
[Any import mappings, dependencies, constraints]

## Out of Scope
- [What this RALPH loop will NOT do]

Read the full file on GitHub · 459 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. 2mo ago First seen · 459 lines · 21 tokens per session scan B d23d449a54df

Subscribe to this mod's changes

ralph-init is a command published in the GitHub repository pproenca/agent-tui (122 stars, last pushed 8d ago), licensed MIT. It adds 21 tokens to every session and 3,350 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.