Install
openclaw skills install @xiaoba-dev/distillSession knowledge distillation: assign what you just learned in this session into an agent's four-layer persistent knowledge base (rule / memory / skill / decision record). The core is four disciplines — search before adding, pick the right layer, guard against bloat, and run a hygiene pass before landing anything. Fits agent workflows that already have (or want to build) these four layers; this is not a general note- taking tool. Invoke explicitly at the end of a session to consolidate what was learned.
openclaw skills install @xiaoba-dev/distillTurn "what this session just learned" into durable knowledge. This is the dual of foraging: foraging pulls external material into a project's library; distilling pushes internal experience out into persistent form.
Fill in paths and naming conventions for your own project and IDE. This document uses placeholder notation and is not tied to any specific toolchain.
Prerequisite: your agent already has (or you want to build) all four of these — persistent rules, persistent memory, skills, and decision records. If all you have is a single markdown notebook, this layering is over-engineering — just write it down.
Ask, category by category:
Scope first, layer second. For every candidate, ask: would this still hold in a different project?
Why this comes first: a full-archive scan once found that completely generic lessons — "verify before asserting," "concurrent-session discipline" — existed in only two of thirty-odd project buckets, and every later incident traced back to a project that lacked them. The lesson had been written down; it was just written in the wrong place. The same scan found one project's memory had silently landed inside a different project's library entirely, due to a path hash collision — undetected until then.
| Signal | Goes into | Typical destination (per your IDE's convention) |
|---|---|---|
| A guardrail that should trigger automatically ("never do X", "when doing Y, check Z first") | Rule | Your IDE's rules mechanism |
| A fact or lesson to recall on demand (a preference, a gotcha, project state) | Memory | The agent's persistent memory (memory files + an index) |
| A complete reusable workflow | Skill | Your IDE's skills directory (<name>/SKILL.md) |
| An architectural or process decision with real alternatives | Decision record | The project's ADR directory |
Memory splits into four kinds: user (who they are), feedback (how to collaborate with them — always with a why and a how), project (what's currently in flight), reference (a pointer to something external).
Three rules keep distillation from rotting:
Why rule 1 comes first: in one real collaboration, the same mistake happened twice — once, a new document was created when the repository already had one covering the same ground, nobody had found it; the second time, an entire rename effort was carried out for a name that had already belonged to that account for two weeks, because a search had missed one namespace. Both traced back to the same root cause: nobody enumerated exhaustively before acting. A knowledge base rarely rots from having too little written down — it rots from the same fact being written three times, each version slightly contradicting the others, with nobody sure which one to trust.
git status first, and stage only your own specific paths (never -A or .) — don't sweep up someone else's in-progress work. Pull with --ff-only first if there's a remote.Give the user an allocation table: for each piece of knowledge, which scope it went into (global / project) × which layer (rule / memory / skill / decision record), why, and — just as important — what you decided not to add, and why (already covered / not high-value enough). Reporting what you left out is as important as reporting what you added — it's the proof you actually filtered, rather than dumping the whole session back out.