ralph-mem: Instructions file for Claude Code

CLAUDE.md

ralph-mem CLAUDE.md is an instructions file for Claude Code from roboco-io/ralph-mem. It costs 1,815 tokens per session, scanned A, original, MIT.

Project instructions for ralph-mem, a Claude Code plugin that stores and retrieves work context across sessions. It combines repeated task attempts with memory management to reduce lost context and declining responses as conversations grow.

In plain words
What is it for?
Use it when developing or maintaining ralph-mem with Bun, TypeScript, SQLite full-text search, Vitest tests, and Biome linting, or when working in its documented project structure.
Why use it?
It addresses context rot, where irrelevant history makes responses worse, and compaction or forgetfulness, where important details disappear. It is intended for complex work that may need more than one attempt.

Instructions file for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: reads .claude/ paths; mentions Claude Code.

This is roboco-io/ralph-mem's own configuration. It tells Claude Code how to work on ralph-mem 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-mem configures →

Reuse

Borrowing it

Nothing to install: this file belongs to roboco-io/ralph-mem. 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/roboco-io/ralph-mem/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/roboco-io/ralph-mem

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-mem CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/roboco-io/ralph-mem/claude-md/github.svg)](https://agentmods.dev/instructions/roboco-io/ralph-mem/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/roboco-io/ralph-mem/claude-md"><img src="https://agentmods.dev/badge/instructions/roboco-io/ralph-mem/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-mem CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/roboco-io/ralph-mem/claude-md"><img src="https://agentmods.dev/badge/instructions/roboco-io/ralph-mem/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,815 This file is loaded in full into every session.
When invoked 1,815 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01815 $0.01815
Opus 5.5 $0.00726 $0.00726
Sonnet 5.5 $0.00363 $0.00363
Haiku 4.5 $0.00181 $0.00181

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

Security

Grade A, and why

ralph-mem CLAUDE.md scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 225 lines

How it starts

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

ralph-mem

Claude Code를 위한 Ralph Loop 기반 지속적 컨텍스트 관리 플러그인

프로젝트 개요

ralph-mem은 Ralph Loop의 "성공할 때까지 반복" 철학과 지능적 컨텍스트 관리를 결합한 Claude Code 플러그인입니다.

해결하는 문제:

  • Context Rot: 누적된 불필요한 정보로 인한 모델 성능 저하
  • Compaction: context window 60-70% 초과 시 출력 품질 급락
  • Forgetfulness: 세션 간 작업 맥락 손실
  • One-shot 실패: 복잡한 작업에서 단일 시도 성공률 저조

기술 스택

항목 기술
Runtime Bun
Language TypeScript (ES2022, strict mode)
Database SQLite + FTS5
Testing Vitest
Linting Biome

프로젝트 구조

ralph-mem/
├── src/
│   ├── index.ts           # 플러그인 엔트리포인트
│   ├── core/              # Core Layer
│   │   ├── db/            # SQLite 클라이언트
│   │   ├── store.ts       # MemoryStore 인터페이스
│   │   └── search.ts      # SearchEngine 인터페이스
│   ├── hooks/             # Lifecycle hooks
│   ├── features/ralph/    # Ralph Loop 엔진
│   ├── skills/            # Slash commands
│   └── utils/             # 유틸리티
├── tests/                 # Vitest 테스트
├── docs/
│   ├── design/            # 설계 문서
│   └── issues/            # 구현 태스크 (폴더별 관리)
│       ├── 001-project-setup/
│       │   ├── README.md      # 이슈 내용
│       │   └── evidence.md    # 완료 검증 증거
│       ├── 002-plugin-manifest/
│       │   └── README.md
│       └── ...
└── .claude/               # Claude Code 설정
    ├── hooks/             # UserPromptSubmit hook
    └── commands/          # Custom skills

아키텍처

3계층 아키텍처로 구성:

  1. Core Layer (src/core/)

    • MemoryStore: 세션/관찰 관리
    • SearchEngine: FTS5 전문 검색
    • SQLite 스토리지
  2. Hook Layer (src/hooks/)

    • SessionStart: 관련 메모리 자동 주입
    • SessionEnd: 세션 요약 생성 및 저장
    • PostToolUse: 도구 사용 결과 기록
    • UserPromptSubmit: 컨텍스트 자동 주입
  3. Feature Layer (src/features/ralph/)

    • Loop Engine: 성공까지 반복 실행
    • Success Criteria: 성공 기준 평가
    • Overbaking Prevention: 과도한 반복 방지

주요 개념

Progressive Disclosure (3계층 검색)

토큰 효율적인 메모리 검색:

Layer 내용 토큰
Layer 1 Index (ID + 점수) 50-100/result
Layer 2 Timeline (시간순 컨텍스트) 200-300/result
Layer 3 Full Details 500-1000/result

Read the full file on GitHub · 225 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 · 225 lines · 1,815 tokens per session scan A ae983bde5183

Subscribe to this mod's changes

ralph-mem CLAUDE.md is an instructions file published in the GitHub repository roboco-io/ralph-mem (2 stars, last pushed 9mo ago), licensed MIT. It adds 1,815 tokens to every session, about $0.0073 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

ralph-mem CLAUDE.md compared with instructions from other repositories

ralph-mem CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ralph-mem CLAUDE.mdroboco-io/ralph-memInstructions file29mo agoMITA1,815Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode