ralph-mem CLAUDE.md

ralph-mem CLAUDE.md is an instructions file for coding agents 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

Install

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.

agentmods
npx agentmods add instructions/roboco-io/ralph-mem/claude-md
Clone the repo
git clone --depth 1 https://github.com/roboco-io/ralph-mem

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.01815 $0.01815
Opus 5 $0.00907 $0.00907
Sonnet 5 $0.00363 $0.00363
Haiku 4.5 $0.00181 $0.00181

Measured 3d ago against content hash ae983bde5183, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 7mo ago), licensed MIT. It adds 1,815 tokens to every session, about $0.0091 per session on Opus 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

Other instructions, from other repositories

cognirepo CLAUDE.md

Instructions for ashlesh-t/cognirepo, covering claude.md, key rules, session start sequence (run in this order), behavioral confirmation rule and personas (cognirepo-402, cognirepo-403).

ashlesh-t/cognirepo · 2,241 tokens

aeon CLAUDE.md

Instructions for aeonfun/aeon, covering aeon, how aeon works, strategy, voice and soul file hierarchy (read in this order).

aeonfun/aeon · 3,720 tokens

inkwell-memory CLAUDE.md

Instructions for veronchenko/inkwell-memory, covering claude.md — inkwellmemory, layout, multi-tenant mode (inkwellmultitenant=1), conventions and testing.

veronchenko/inkwell-memory · 2,378 tokens

RNR-Enhanced-Cognee AGENTS.md

AGENTS.md instructions for vincentspereira/RNR-Enhanced-Cognee, covering rnr enhanced cognee implementation for codex, critical requirements, 1. ascii-only output (no unicode encoding), 2. dynamic categories (no hardcoded categories) and 3. standard memory mcp interface.

vincentspereira/RNR-Enhanced-Cognee · 6,855 tokens

memory-mcp-1file AGENTS.md

Instructions for pomazanbohdan/memory-mcp-1file, covering ⛔ l0 invariants (never violate under any circumstance), detection heuristic, 🔀 phase transition routing (⛔ blocking), gate-0: phase identification & loading and 🧾 proof-of-load requirement (critical).

pomazanbohdan/memory-mcp-1file · 7,991 tokens

openexp CLAUDE.md

Instructions for anthroos/openexp, covering openexp — development instructions, memory protocol (mandatory), before starting any task, after completing a task and when the user shares context.

anthroos/openexp · 799 tokens