# Compound memory

> Compound memory is an open-source agent skill for knowledge and memory. Lets your agent recall your past decisions and preferences from earlier sessions. It is available on Claude Code and Codex.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex
- **Website:** https://github.com/Protocol-zero-0/compound-memory/tree/main/skills/compound-memory
- **Repository:** https://github.com/protocol-zero-0/compound-memory
- **GitHub stars:** 348
- **License:** MIT
- **Skill name:** compound-memory
- **Collection:** https://github.com/Protocol-zero-0/compound-memory
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-01

## About

Compound memory is a long-term memory layer for the user across Claude Code and Codex sessions. A nightly process distills past AI session logs into a memory profile, and a short snapshot is injected at the start of each session. This skill teaches the agent to search that memory by topic before asking the user to repeat themselves, and to treat the results as background rather than instructions, preferring the newest dated memory when entries conflict.

The skill also covers setup. When the user explicitly asks for it, the agent explains that the tool reads local session logs, calls a model once per new session each night (the local claude CLI by default), and adds a session-start injection and a cron job that can be removed with a single uninstall command. Installation is done from a stable git clone, and a dry-run option previews distillation cost without calling a model.

The skill expects a shell with git and bash, the cm command-line tool, and local Claude Code or Codex session logs to draw from.

## When your agent uses it

> Long-term memory about the user across Claude Code and Codex sessions. Use when the user refers to something from an earlier conversation ("like we discussed", "my usual setup", "what did I decide about X"), when you need their past preferences or decisions before acting, or when they ask to set up persistent memory across sessions or machines.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/Protocol-zero-0/compound-memory/tree/HEAD/skills/compound-memory)
- [License: MIT](https://github.com/Protocol-zero-0/compound-memory/tree/HEAD/skills/compound-memory)

## Features

- **Topic memory search:** Queries the distilled memory by topic, with options for more results or including overturned memories.
- **Session snapshot:** Prints the short memory snapshot that is injected at the start of each session.
- **Health check:** Verifies whether the memory tool is installed and working before searching.
- **Guided installation:** Walks through a git-based install with a name preference and a first test distillation.
- **Reversible setup:** Backs up the session-start hook and cron job it adds, and removes them on uninstall.
- **Cost preview:** Offers a dry-run mode that estimates distillation work without calling a model.

## Good for

- Recall a deployment checklist I settled on last month
- Check what I previously decided about pricing before drafting a proposal
- Look up my usual project setup before starting a new repo
- Set up persistent memory across my Claude Code and Codex sessions
- Find out whether an older plan was later overturned

## Install

### Claude Code

This skill ships in the `compound-memory` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add Protocol-zero-0/compound-memory
/plugin install compound-memory@compound-memory
```

Or copy only this skill to `~/.claude/skills/compound-memory`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Protocol-zero-0/compound-memory.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/compound-memory &&
cp -R "$tmp/skills/compound-memory" ~/.claude/skills/compound-memory &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/compound-memory` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/compound-memory` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Protocol-zero-0/compound-memory.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/compound-memory &&
cp -R "$tmp/skills/compound-memory" ~/.agents/skills/compound-memory &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/compound-memory` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/compound-memory` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Protocol-zero-0/compound-memory.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/compound-memory &&
cp -R "$tmp/skills/compound-memory" ~/.cursor/skills/compound-memory &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/compound-memory` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/Protocol-zero-0/compound-memory.git --path skills/compound-memory
```

Or copy the folder to `~/.gemini/skills/compound-memory` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/compound-memory`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Protocol-zero-0/compound-memory.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/compound-memory &&
cp -R "$tmp/skills/compound-memory" ~/.copilot/skills/compound-memory &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/compound-memory` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/Protocol-zero-0/compound-memory.git
```

Then copy `compound-memory/skills/compound-memory` into your agent's skills folder as `compound-memory`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Compound memory need to work?

It needs the cm command-line tool installed. If it is missing, the skill can guide a git clone and install, and it reads local Claude Code or Codex session logs as its input.

### Does Compound memory send my session logs anywhere?

The skill states that it calls a model once per new session each night, by default the local claude CLI using Opus. Session logs are the only input it reads.

### How do I remove Compound memory?

Running cm uninstall removes exactly what the installer added, such as the session-start injection and the nightly cron job.

### When does the agent use Compound memory?

When the user refers to earlier conversations, when past preferences or decisions are needed before acting, or when they ask for persistent memory across sessions or machines.

### How do I install Compound memory in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/compound-memory to use it in all your projects, or to .claude/skills/compound-memory in one project. Or install the compound-memory plugin, which includes it: /plugin marketplace add Protocol-zero-0/compound-memory, then /plugin install compound-memory@compound-memory.

### Does Compound memory run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Compound memory?

Claude Code and Codex. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Compound memory?

The closest alternatives to Compound memory are Claude mem, Recap, Memory sync, Memory review and Learn.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Claude mem](https://ai-powered.com/skills/claude-mem-smartworldarafath): Claude mem is an open-source agent skill for knowledge and memory.
- [Recap](https://ai-powered.com/skills/recap-onebrain-ai): Recap is an open-source agent skill for knowledge and memory.
- [Memory sync](https://ai-powered.com/skills/memory-sync): Memory sync is an open-source agent skill for knowledge and memory.
- [Memory review](https://ai-powered.com/skills/memory-review): Memory review is an open-source agent skill for knowledge and memory.
- [Learn](https://ai-powered.com/skills/learn): Learn is an open-source agent skill for knowledge and memory.
- [Memory](https://ai-powered.com/skills/memory-chachamaru127-2): Memory is an open-source agent skill for knowledge and memory.
- [Nemo rl session memory](https://ai-powered.com/skills/nemo-rl-session-memory): Nemo rl session memory is an open-source agent skill for knowledge and memory.
- [Continual learning](https://ai-powered.com/skills/continual-learning): Continual learning is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/compound-memory-protocol-zero-0
