ralph-memory

ralph-memory is a skill for Claude Code, Codex from jmagly/aiwg. It costs 21 tokens per session (2,559 once invoked), scanned A, original, MIT.

A memory-management tool for an automated agent loop. It lists, searches, or clears lessons that the loop has stored from earlier attempts.

In plain words
What is it for?
Use it to review what the agent has learned, search lessons for a particular loop, or clear stored memory globally or for a selected loop.
Why use it?
It makes accumulated lessons and recurring failure patterns inspectable instead of leaving them hidden in the loop's history. You can also limit the operation to one loop.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Only kernel-listed skills (`aiwg-doctor`, `aiwg-refresh`, `aiwg-status`, `aiwg-help`, `use`, `steward`) are directly invokable as slash commands. See [skill-dis.

Good fit Use it to review what the agent has learned, search lessons for a particular loop, or clear stored memory globally or for a selected loop.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jmagly/aiwg
agentmods
npx agentmods add skills/jmagly/aiwg/ralph-memory

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jmagly/aiwg/ralph-memory/github.svg)](https://agentmods.dev/skills/jmagly/aiwg/ralph-memory)
Your own site
<a href="https://agentmods.dev/skills/jmagly/aiwg/ralph-memory"><img src="https://agentmods.dev/badge/skills/jmagly/aiwg/ralph-memory/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-memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/jmagly/aiwg/ralph-memory"><img src="https://agentmods.dev/badge/skills/jmagly/aiwg/ralph-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 218
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.02559
Opus 5.5 $0.00008 $0.01024
Sonnet 5.5 $0.00004 $0.00512
Haiku 4.5 $0.00002 $0.00256

Measured today against content hash 7db733ae4e6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ralph-memory 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 today.

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.

agentic/code/addons/agent-loop/skills/ralph-memory/SKILL.md · 298 lines

How it starts

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

Skill access pattern (post-kernel-pivot, 2026.5+)

Skill names referenced in this document are AIWG skills, not slash commands. Most are not kernel-listed and cannot be invoked as /skill-name by the platform. Reach them via:

aiwg discover "<capability>"
aiwg show skill <name> --body

Only kernel-listed skills (aiwg-doctor, aiwg-refresh, aiwg-status, aiwg-help, use, steward) are directly invokable as slash commands. See skill-discovery rule.

Al Memory

Inspect and manage the semantic memory that Al accumulates across loop iterations. Memory entries record lessons learned, failure patterns, and success patterns so that later iterations — and future loops on similar tasks — benefit from what earlier attempts discovered.

Natural Language Triggers

Users may say:

  • "ralph memory"
  • "ralph memories"
  • "list ralph memory"
  • "query ralph memory"
  • "what has ralph learned"
  • "show ralph lessons"
  • "clear ralph memory"

Parameters

Subcommand (required)

One of list, query, or clear.

--loop-id (optional)

Scope the operation to a specific loop's memory. If omitted, operates on the global memory store (.aiwg/ralph/memory.json).

/ralph-memory list --loop-id abc123

--query (optional, used with query subcommand)

Text to search for in memory entries. Matches against lesson, pattern, context, and tags fields.

/ralph-memory query --query "auth mocks"

--since (optional)

Filter entries created on or after this date. Accepts ISO 8601 date (2026-04-01) or relative expressions (7d, 2w).

/ralph-memory list --since 7d

Memory Entry Schema

Each entry in .aiwg/ralph/memory.json follows this structure:

{
  "id": "mem_a1b2c3",
  "loopId": "abc123",
  "iteration": 2,
  "createdAt": "2026-04-01T10:42:00Z",
  "type": "failure_pattern",
  "lesson": "Auth mocks must be initialized inside beforeEach, not at module scope",
  "context": "src/auth/auth.test.ts iteration 2 failure",
  "tags": ["auth", "mocks", "jest"],
  "confidence": 0.9
}

Read the full file on GitHub · 298 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. today Changed 7db733ae4e6c
  2. 1mo ago Changed d63b466fce26
  3. 1mo ago First seen · 298 lines · 21 tokens per session scan A c7a19937a5eb

Subscribe to this mod's changes

ralph-memory is a skill published in the GitHub repository jmagly/aiwg (225 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 2,559 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories