recall-echo
Persistent three-layer memory system for AI coding agents. Gives Claude Code (and similar tools) long-term recall across sessions.
The Problem
Claude Code's built-in memory (MEMORY.md) is a single flat file. It works for small notes, but breaks down as conversations accumulate — no session continuity, no archival history, no lifecycle management. You lose context every time a session ends or compaction kicks in.
How It Works
recall-echo adds a structured memory protocol via Claude Code's auto-loaded rules system (~/.claude/rules/). No patches, no forks — just a rules file that teaches the agent how to manage its own memory.
┌─────────────────────────────────────────────────┐
│ recall-echo │
│ │
│ Layer 1: MEMORY.md ← always in context │
│ Curated facts, preferences, stable patterns │
│ │
│ Layer 2: EPHEMERAL.md ← session bridge │
│ Last session summary, read on start, cleared │
│ │
│ Layer 3: archive logs ← searchable history │
│ ~/.claude/memories/archive-log-001.md ... │
│ Checkpointed on compaction and session end │
│ │
│ ARCHIVE.md ← lightweight index │
│ Log number, date, key topics per entry │
└─────────────────────────────────────────────────┘
Session Lifecycle
- Session start — Agent reads
EPHEMERAL.mdfor last session context, then clears it. - During session — Agent updates
MEMORY.mdwith stable facts as they're confirmed. - On compaction —
PreCompacthook fires, agent saves a checkpoint toarchive-log-XXX.md. - Session end — Agent writes a fresh
EPHEMERAL.mdsummary and a final archive log.
The agent manages all of this autonomously. You don't need to tell it to remember things — the protocol is in its rules.
Installation
cargo install (recommended)
Install script
Downloads a prebuilt binary for your platform. Falls back to a bash-only installer if no binary is available.
|
Prebuilt binaries
Download from GitHub Releases for:
x86_64-unknown-linux-gnuaarch64-unknown-linux-gnux86_64-apple-darwinaarch64-apple-darwin(Apple Silicon)
Extract and run:
Manual (from source)
What It Creates
~/.claude/
├── rules/
│ └── recall-echo.md # Memory protocol (auto-loaded by Claude Code)
├── memory/
│ └── MEMORY.md # Layer 1: curated facts
├── memories/
│ └── archive-log-001.md # Layer 3: archive logs (created by agent)
├── EPHEMERAL.md # Layer 2: session bridge
├── ARCHIVE.md # Archive index
└── settings.json # PreCompact hook merged in
The installer is idempotent — running it again won't overwrite your existing memory files. It only creates what's missing and updates the protocol rules file to the latest version.
Configuration
recall-echo requires no configuration. It works out of the box with Claude Code's existing infrastructure.
The only thing it touches in settings.json is adding a PreCompact hook that reminds the agent to checkpoint before context compaction. If you already have hooks configured, they're preserved.
How the Agent Uses It
Once installed, the agent follows the protocol automatically:
- Reads
EPHEMERAL.mdat session start to pick up where it left off - Updates
MEMORY.mdwhen it learns stable facts (never speculative or session-specific info) - Creates archive logs on compaction events and at session end
- Searches archives with
Grepwhen it needs historical context - Distills
MEMORY.mdproactively when it approaches 200 lines, moving details to topic files
You can also explicitly tell the agent to remember something, search its history, or review what it knows. The memory is transparent — it's all plain markdown files you can read and edit yourself.
Uninstall
Remove the rules file and optionally delete the memory data:
# Remove the protocol (agent stops following it)
# Optionally remove all memory data
You may also want to remove the PreCompact hook from ~/.claude/settings.json.
Contributing
See CONTRIBUTING.md for branch naming, commit conventions, and workflow.