# Memory distill

> Memory distill is an open-source agent skill for knowledge and memory. Turns logged corrections and failed checks into proposed memory, hook and rule updates. It is available on Claude Code, Cursor and Codex.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Cursor, Codex
- **Website:** https://github.com/tonyghiani/ai-essentials/tree/main/skills/memory-distill
- **Repository:** https://github.com/tonyghiani/ai-essentials
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** memory-distill
- **Collection:** https://github.com/tonyghiani/ai-essentials
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-03

## About

Memory distill reviews the signals an agent collects over time, including a correction log written by a hook, a failed-check log, lessons taken from accepted review comments, and overruled decisions. It groups recurring themes, requires at least two independent occurrences or one explicit standing instruction, and discards one-off fixes and anything already covered by existing instructions or code style guides.

For each surviving theme the skill proposes a destination, such as a memory file, a path or lint rule, a hook or deny rule, a skill gotcha, an eval task or a precedent, and records the reason behind it. Nothing is written until the user approves a numbered list. Approved memories follow a one-fact-per-file format with a type, a why and a how-to-apply line, and the consumed log lines are archived afterward.

The skill expects the ai-work and ai-decisions command-line tools and a per-project memory folder under the Claude Code configuration directory. It is written in Markdown with bash snippets and is intended to run periodically rather than at the end of every session.

## When your agent uses it

> Turn logged correction signals into durable memory files. Reads the correction log (written automatically by the log-correction-signal hook in Claude Code, Cursor and Codex whenever Marco corrects the assistant or states a preference), plus the failed-check log, lessons from accepted review comments and overruled decisions, groups recurring themes, and proposes a memory, hook, rule, eval or skill gotcha for each, for approval. Invoke when the user says "distill memory", "update your memory", "what have you learned", or after a stretch of work where preferences came up.

## What it can access

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

- [Instructions only, no scripts](https://github.com/tonyghiani/ai-essentials/tree/HEAD/skills/memory-distill)
- [License: MIT](https://github.com/tonyghiani/ai-essentials/tree/HEAD/skills/memory-distill)

## Features

- **Correction log review:** Reads prompts where the user corrected behaviour or stated a preference and clusters them into themes.
- **Multi-source signal intake:** Also draws on failed checks, accepted review lessons, learning notes and overruled decisions.
- **Approval-based proposals:** Presents each candidate with its claim, reason, evidence and destination before anything is written.
- **Destination matching:** Maps each theme to the cheapest enforcing place, such as a memory, lint rule, hook or skill gotcha.
- **Memory file formatting:** Writes approved memories as one fact per file with frontmatter, a reason and a usage trigger.
- **Log archiving:** Archives consumed signal lines so the next distillation run starts from a clean log.

## Good for

- Review recent corrections and propose memory updates
- Find repeated check failures that should become lint or eval rules
- Turn accepted review comments into durable project guidance
- Summarise what the assistant has learned from recent preferences

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/memory-distill` to use it in all your projects:

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

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

### Codex

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

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

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

### Cursor

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

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

For one project only, put the folder in `.cursor/skills/memory-distill` 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/tonyghiani/ai-essentials.git --path skills/memory-distill
```

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

### VS Code

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

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

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

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git
```

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

## FAQ

### When does Memory distill trigger?

When the user says distill memory, update your memory, or what have you learned, or after a stretch of work where preferences came up.

### Does Memory distill write memories automatically?

No. It proposes candidates with a destination and writes only the ones the user approves.

### Which clients does Memory distill support?

The content ties it to Claude Code, Cursor and Codex through the correction log hook, and it relies on Claude Code's memory folder.

### What does Memory distill need to run?

It calls the ai-work and ai-decisions command-line tools and reads a per-project memory directory.

### How do I install Memory distill in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/memory-distill to use it in all your projects, or to .claude/skills/memory-distill in one project.

### Does Memory distill 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 Memory distill?

Claude Code, Cursor 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 Memory distill?

The closest alternatives to Memory distill are Compound memory, Memory review, Memory audit, Vibe reflect and compound and Record bug fix memory.

## Where this comes from

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

## Alternatives

- [Compound memory](https://ai-powered.com/skills/compound-memory-protocol-zero-0): Compound memory 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.
- [Memory audit](https://ai-powered.com/skills/memory-audit): Memory audit is an open-source agent skill for knowledge and memory.
- [Vibe reflect and compound](https://ai-powered.com/skills/vibe-reflect-and-compound): Vibe reflect and compound is an open-source agent skill for knowledge and memory.
- [Record bug fix memory](https://ai-powered.com/skills/record-bug-fix-memory-ruan-cat): Record bug fix memory 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.
- [Claude mem](https://ai-powered.com/skills/claude-mem-smartworldarafath): Claude mem 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.

---
Source: https://ai-powered.com/skills/memory-distill
