What it looks like (fictional example below, not real user data)
At the start of a new session, this shows up in context automatically:
<compound-memory-snapshot source="shared">
# Alex · snapshot
generated 2026-09-20 04:30 · 86 live shared memories
## A Long-horizon
### What he has explicitly asked for
- Code review: correctness and simplification only, don't expand scope (09-02)
- Weekly reports: plain language, no consulting jargon (08-14)
## B Short-horizon
### Open threads
- Wait for the supplier to confirm delivery date before setting launch date (09-18)
</compound-memory-snapshot>
And you can search it anytime, with sources:
$ cm recall "supplier"
【memory】
- [open-thread, 09-18] Wait for the supplier to confirm delivery date before setting launch date
from: claude:3267ab25 · launch timing discussion
Why it's worth using
- You do nothing. Reads transcripts, distills, writes the snapshot — every night, automatically.
- Works across tools and machines. Claude Code, Codex and DeepSeek Harness share one memory.
- Gets updated, doesn't pile up. Change your mind and the old memory expires — it's not an endless log.
- Transcripts never leave the machine. Only memories judged "necessary and appropriate to share" go out, scrubbed of secrets first.
- Budget discipline. Slim calls, a nightly cap, stops cold at the limit instead of quietly burning money.
Design rationale (why per-session not per-day, why not file mtime, how revisions are decided,
full architecture diagram) → docs/design.md (Chinese; translate as needed).
🚩 Before you install
- It reads all of your session logs. That is its only input. If that's not OK, don't install it.
- It spends model budget. Up to 20 sessions per night by default, one call each.
Run
cm distill --dry first.
- Session-start injection edits a few files (
~/.claude/settings.json, ~/.codex/AGENTS.md, etc.),
each backed up and marked; cm uninstall removes exactly what it added.
- The default model is Claude Opus. Sonnet missed about a quarter of the entries in testing.
Downgrade if you want, just know the trade-off.
- An inference is not a rule. Only things you said explicitly are tagged as requests.
Install
git clone https://github.com/Protocol-zero-0/compound-memory.git ~/compound-memory
cd ~/compound-memory && bash install.sh
It runs one distillation right away and prints the snapshot — you find out whether it
works now, not tomorrow morning.
bash install.sh --name Alex --yes # non-interactive
bash install.sh --no-cron --no-inject # just lay down files
cm uninstall # remove cleanly; --purge also deletes memories
One prerequisite: a model you can call. By default it uses the claude CLI you're
already logged into. Otherwise set llm.backend: openai with base_url and api_key_env —
any OpenAI-compatible endpoint works.
In Claude Code you can also add it as a plugin. The agent then runs cm recall on its own
when it needs earlier context, and walks you through the install above if cm is missing:
/plugin install compound-memory --marketplace Protocol-zero-0/compound-memory
On older Claude Code: /plugin marketplace add Protocol-zero-0/compound-memory, then
/plugin install compound-memory@compound-memory. Just the skill: npx skills add Protocol-zero-0/compound-memory.
Support matrix