Documentation
Browse documentation

Bring memory in and take it out

Turn repeated decisions into project rules

When your memory keeps recording the same decision or the same fix, that is a rule nobody wrote down. distill finds those and suggests them:

npx memindex distill                    # suggestions only; nothing is written
npx memindex distill --apply            # asks about each suggestion, then writes the ones you accept
npx memindex distill --apply --only 1,3 # no keyboard: write exactly these items

Each suggestion is one line for CLAUDE.md (and AGENTS.md if the project has one), followed by the notes it came from, so you can check it before you accept it. A line needs at least three notes that say the same thing; --min-notes N changes that. When your notes spell out the same numbered procedure several times, distill suggests a skill file instead, at .claude/skills/<name>/SKILL.md.

  • Nothing is written until you approve it. Accepted rules go between two marker comments in CLAUDE.md, and nothing outside them is ever touched. If the markers are damaged, nothing is written at all.
  • Run it again whenever you like. A rule that is already there is not added twice, and an existing skill file is never overwritten.
  • No AI writer is involved, so it costs nothing: each line is worded from the oldest note in its group.
  • On this machine, notes are grouped with the same search your agent uses, and only notes that also share wording end up together. On MemIndex hosting, distill reads the 50 newest notes the server lists and groups them by shared words, and it says so.

Next steps