compound-memory
Long-term memory that lets Claude Code and Codex remember your preferences and open threads across sessions, tools and machines.
- Source repo
- Protocol-zero-0/compound-memory
- Stars
- ★ 348
- Last updated
- 4d ago
- FARS reviewed
- Nov 29, 2026
- License
- MIT
- Primary language
- Python
- FA score
- 63/100 · Some gaps
At a glance
- How it runs
- Works with
- Portable with changesCodex · Claude CodeOpenAI API · Claude API (Partial support)
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Developers who work in Claude Code daily and are tired of restating review style and reporting preferences in every new chat.
- Not a fit if
- Users unwilling to let a tool read all local session logs
- Anyone expecting zero model spend from pure rule-based memory
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-25
- Source review
- 63/100 · Some gaps
What does this agent do, and when should you use it?
compound-memory is a local-first memory layer for coding agents, shipped as a zero-dependency Python 3.9+ command-line tool named cm. It reads the session transcripts your coding harnesses already write — Claude Code JSONL, Codex CLI rollouts, DeepSeek Harness zstd logs and Antigravity transcripts — and on a nightly cron (default 30 4 * * *) distills them with a model into memory entries about you, your decisions and your unfinished threads. Those entries are compiled into a snapshot capped by snapshot_max_chars (3200 by default) and injected at session start, either through a Claude Code SessionStart hook or a marked block in ~/.codex/AGENTS.md; cm recall searches the same memory with source attribution. Memories live locally by default but can be pushed to a private GitHub repo or a Feishu table via the sink setting so several machines share one memory. Each shared entry is judged individually for secrets before export. The installer edits a few config files and cm uninstall removes exactly what it added.
The tool scans ~/.claude/projects//*.jsonl, ~/.codex/sessions//rollout-*.jsonl, ~/.dsh/sessions/**/*.jsonl.zstd and Antigravity's transcript.jsonl, keeps only sessions with new activity inside window_days (7 by default), and processes at most nightly_limit sessions (20) per run, one model call each. Distillation produces memory entries with revision tracking so changed decisions expire rather than accumulate; only things you stated explicitly are tagged as requests and inferences are labelled separately. It then builds a snapshot under snapshot_max_chars and injects it at session start through the SessionStart hook (Claude Code, AGY) or an AGENTS.md block (Codex, dsh). cm recall "term" retrieves memories with their source session. Other commands include cm distill (--dry, --days, --limit), cm doctor, cm eval to freeze an evaluation set, cm sink-init, cm attach agy and cm uninstall/--purge. The model backend defaults to your logged-in claude CLI (opus, high effort) and can be switched to llm.backend: openai with base_url and api_key_env for any OpenAI-compatible endpoint.
- Developers who work in Claude Code daily and are tired of restating review style and reporting preferences in every new chat.
- People who alternate between Claude Code and Codex CLI and want both to draw on the same personal memory.
- Users with a desktop and a laptop who want memory synced through a private GitHub repo or a Feishu table.
- Anyone with an old pile of one-per-line JSONL memories who wants to migrate them with tools/import-legacy-jsonl.py.
- Teams writing docs or public examples who want tools/global-gate to scan every repo against a term list and session fingerprints before pushing.
- Teams that need to control model spend and want to forecast nightly cost with cm distill --dry and usage.log.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Config files
~/.compound-memory/config.yamlconfig.example.yaml- Runtime
- Python 3.9+
How do you install or deploy this agent?
You need Python 3.9+ and a model you can call: by default the claude CLI you are already logged into, otherwise an OpenAI-compatible endpoint set via llm.backend.
git clone https://github.com/Protocol-zero-0/compound-memory.git ~/compound-memory
cd ~/compound-memory && bash install.shThe installer runs one distillation immediately and prints the snapshot so you know it works now. Non-interactive or files-only:
bash install.sh --name Alex --yes
bash install.sh --no-cron --no-injectInside Claude Code it can also be installed as a plugin:
/plugin install compound-memory --marketplace Protocol-zero-0/compound-memoryOn older Claude Code, add the marketplace first:
/plugin marketplace add Protocol-zero-0/compound-memory
/plugin install compound-memory@compound-memoryConfiguration lives in ~/.compound-memory/config.yaml (copied from config.example.yaml at install) and covers user_name, language, model/effort, llm.backend, sink, nightly_limit, window_days, snapshot_max_chars and cron.
How do you use this agent?
If the snapshot appears right after install, it is working; from then on the nightly cron distills and each new session gets the snapshot injected.
cm doctor # diagnose why nothing showed up
cm distill --dry # estimate cost without calling the model
cm distill --days 60 --limit 5 # backfill the last 60 days
cm recall "supplier" # search memories with sources
cm eval --n 24 # freeze an eval set before tuning prompts
cm uninstall # remove injections and cron
cm uninstall --purge # also delete memoriesSharing across machines needs a sink:
cm sink-init # create the shared layer (e.g. a Feishu table)Importing legacy memories:
python3 tools/import-legacy-jsonl.py <old.jsonl>Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- data-flow disclosure
What are this agent's strengths and limitations?
- A single zero-dependency Python CLI that runs a distillation during install and prints the snapshot, so you verify it works immediately instead of waiting a night.
- One memory spans Claude Code, Codex CLI, DeepSeek Harness and Antigravity CLI, and can be shared across machines through a private GitHub repo or Feishu table.
- Memories are revised and expired rather than appended forever, and explicit requests are tagged separately from model inferences so guesses never become rules.
- Cost and privacy controls are concrete: nightly_limit, snapshot_max_chars, cm distill --dry and a per-call usage.log, plus per-entry judgments and scrubbing before anything is shared.
- cm uninstall removes exactly what the installer added, and tools/global-gate screens every repo on the machine against your term list before pushing.
- It reads all of your session logs — its only input — so anyone uncomfortable with that cannot adopt it.
- The default model is Claude Opus; the README reports Sonnet missing roughly a quarter of entries in testing, so downgrading has a real quality cost.
- Installation edits ~/.claude/settings.json and ~/.codex/AGENTS.md and installs a cron job, which is a system-level change of medium complexity.
- The DeepSeek Harness hook-plugin bridge is still flagged as unresolved (⚠️) in docs/dsh.md.
- The design, retrieval and privacy-gate documents are written in Chinese, so English readers must translate them.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| compound-memory This agent | 63 · Some gaps | CLIFree + model costs | ★ 348 | 4d ago | Python | Codex · Claude Code |
| MemoSync | 50 · Major gaps | Desktop appFree + model costs | ★ 429 | 3d ago | TypeScript | Codex · Claude Code · OpenAI API · Claude API |
| PowerContext | 82 · Good | CLIFree | ★ 1.9k | 1d ago | Python | Codex · Claude Code |
| agent-memory | 81 · Good | — | ★ 4k | 18d ago | Python | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Data-flow transparency is the strongest area: README and SKILL.md state it reads only local session logs, makes one model call per session nightly, injection edits settings.json/AGENTS.md with backups, cm uninstall removes exactly what it added, and --purge is required to delete memories; the privacy-gate doc notes terms live outside repos, fingerprints store only hashes, and the Action never echoes matched text. Least privilege and confirmation: install is user-initiated and SKILL.md requires asking first, but defaults enable cron and injection and default to Opus, a fairly heavy default, so 2. Sensitive data: per-entry judgment, export scrubbing, hash-only fingerprints, but fingerprints cover only Chinese and terms are self-maintained, known blind spots, deducted. Dependency security: claims zero dependencies and stdlib only, but no lockfile or audit evidence, 2. External effects: writes global git hooksPath and auto-installs Actions on new repos, intrusive though gated and logged, 2. Rollback: uninstall and --purge are clear, but --purge is irreversible with no second confirmation, deducted. Source attribution: only README and plugin.json name Protocol Zero; publisher unverified, weak attribution, 1.
Self-consistency: README, SKILL.md and cli.py commands/config largely agree, but cli.py is truncated at cmd_health so full implementation cannot be confirmed, deducted. Dependency availability: claims Python 3.9+ and zero deps, but cmd_agy_session_start uses Path.is_relative_to (3.9+) with ambiguous boundary, and it depends on an external claude CLI or OpenAI-compatible endpoint, so availability depends on user environment, 2. Failure messages: cmd_doctor, cmd_snapshot exception fallback, and cmd_sink_init errors with field hints are helpful, but some errors print only the exception type, limited, 2.
Audience and scenarios: targets Claude Code/Codex/dsh/AGY users with clear scenarios. Capability boundaries: SKILL.md states recall results are background not instructions, prefer newest, and inferences are not rules, good boundary statements; but dsh plugin bridge is marked unverified, deducted. Trigger precision: SKILL.md description gives concrete trigger phrases, but relies on the model to decide when to recall, medium precision. Environment fit: supports multiple harnesses and sinks, but depends on specific directory layouts and local CLI, cross-platform details thin, 2.
Information architecture: README is well structured with install, support matrix, config, FAQ, privacy, license, but design docs are Chinese and some links point to files not in the packet, deducted. Install notes: very thorough, including non-interactive, --no-cron/--no-inject, plugin install, legacy commands, 3. Naming stability: plugin.json version 0.1.0 but no versioning policy in README; command/config names reasonable but no stability promise, 1. Examples and FAQ: fictional example plus several FAQs, but the example is explicitly fictional and real usage examples are limited, 2. Known limitations: README and privacy-gate.md list several limitations (reads all logs, spends budget, Chinese-only fingerprints), honest, 2. License: full MIT text present, 2. Versioning/changelog: only plugin.json 0.1.0, no CHANGELOG, 1. Maintenance responsibility: only Protocol Zero named, no maintainer contact, contribution guide or issue process, publisher unverified, 1.
Output usability: snapshot and recall output are clear with sources and dates, directly injectable, 2. Marginal value: addresses cross-session memory pain, but many similar memory solutions exist and default Opus is costly, medium value, 2. Cost-benefit: nightly_limit, snapshot_max_chars, --dry preview, usage.log provide cost control, but default Opus and multiple nightly calls are not cheap, 2.
Claim traceability: README claims are mostly prose with few references to specific code or tests, and some doc links are not in the packet, 1. Cross-source corroboration: README, SKILL.md, cli.py and privacy-gate.md largely corroborate commands and behavior, but dsh support is marked unverified and some claims lack code support, 1. Fact/inference separation: SKILL.md explicitly distinguishes explicit requests from inferences and README stresses inferences are not rules, done well, 2.
- Install enables nightly cron and multi-harness injection by default and defaults to Opus, incurring ongoing model cost; run cm distill --dry first to gauge cost.
- The privacy gate's verbatim fingerprint covers only Chinese and requires self-maintained terms; English leaks and paraphrased sentences are known blind spots.
- cm uninstall --purge irreversibly deletes all memories with no second confirmation; back up first.
- Global git hooksPath and auto-installing Actions on new repos change local and remote repo behavior; confirm this is acceptable.
- Publisher identity is unverified and maintenance/update path is unclear; review the code before upgrading.
- cli.py is truncated in the packet, so full implementation and error handling cannot be confirmed; static review confidence is low.
FAQ
Will it turn things I said into rules it then follows?
What does a night cost?
Nothing showed up after installing — now what?
Can several machines share one memory?
What's left after uninstalling?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.