memory — Claude Code skill: keeping agent memory clean
A skill that sets the discipline for a node's persistent memory: what to write, how to split pages, when to prune. Useful when your agent hoards history instead of knowledge.
npx skills add plasma-ai/fractal --skill memory -a claude-codeWhat memory does
Node memory lives in $MEMORY_DIR and acts as the node's durable store. The skill covers reading it during orientation and folding findings back before an iteration ends. Sync can also write to memory when something important arrives over radio.
The core rule: write knowledge, not history. No iteration numbers, no timestamps — a reader should not be able to tell how many runs have happened. Before COMMIT the skill says to scan memory and any page you promote and rewrite those markers out, because promotion carries your habits onto shared surfaces. Organize by topic, not time: update the existing page for a topic rather than appending a new entry.
Your first write creates the layout — one page per topic (environment, decisions, state, todo, rename to fit the work), never a single grab-bag page. A page without desc: frontmatter stays invisible to wiki map, so after adding or moving pages run wiki update --path=$MEMORY_DIR. Keep exactly one present-tense state page, overwritten in place. In-wiki links are written prefix-free: [[state]], not [[./state]].
What it helps with
- split node memory into topical pages instead of one grab-bag file
- strip iteration numbers and timestamps out of memory
- collapse a finished phase's pages into durable facts
- make pages show up in
wiki mapwithdesc:frontmatter - keep a working todo list instead of a done-log
Example prompts for the agent
- read
$MEMORY_DIRand tell me where we are - fold this iteration's findings into memory and clean out the iteration numbers
- run
wiki update --path=$MEMORY_DIRso the new pages get frontmatter
How to install memory
1Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a claude-code2Manually: put the files in place
~/.claude/skills/memory/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/memory/
1Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a codex2Manually: put the files in place
.agents/skills/memory/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a cursor2Manually: put the files in place
.cursor/skills/memory/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install plasma-ai/fractal memory2Manually: put the files in place
.github/skills/memory/SKILL.md1Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a gemini-cli2Platform CLI
gemini skills install https://github.com/plasma-ai/fractal --path fractal/_node/skills/memoryManually: put the files in place
.devin/skills/memory/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about memory
How do I install memory in Claude?
Run npx skills add plasma-ai/fractal --skill memory -a claude-code. The skill file lands at ~/.claude/skills/memory/SKILL.md.
What does the memory skill do?
It describes how to maintain a node's persistent store in $MEMORY_DIR: what to write, how to organize by topic, and when to delete what is no longer true.
Why is my page missing from wiki map?
It probably lacks a desc: frontmatter key — a near-miss like description: does not count. After adding or moving pages, run wiki update --path=$MEMORY_DIR.
Source text
SKILL.md · Apache-2.0
--- name: memory description: How to maintain node memory well -- the node's persistent knowledge store. --- # Memory Memory (`$MEMORY_DIR`) is the node's durable brain. Read it when you orient and fold findings back before each iteration ends. Sync may also write to memory when crucial information arrives via radio. See the `wiki` skill for how memory relates to the shared project wiki; this doc is the discipline for keeping memory useful. Run `wiki --help` and `wiki <command> --help` for the CLI. ## Conventions - **Write knowledge, not history.** Never reference iteration numbers, timestamps, or chronological markers -- a reader shouldn't be able to tell how many iterations have run. Before COMMIT, scan memory and any page you promote for iteration numbers and run labels and rewrite them out -- promotion carries your habits onto shared surfaces. - **Organize by topic, not time.** Update the existing page for a topic; don't append a new entry. - **Start with a topical layout.** Your FIRST memory write creates the layout -- one page per topic (`environment`, `decisions`, `state`, `todo` -- rename to fit the work; stubs are fine), never a single grab-bag page; when a page starts covering two topics, split it. A leaf expecting to finish within an iteration or two may keep just the `state` page. - **One current-state page.** Keep exactly one present-tense `state` page for where-am-I / what's-next, overwritten in place -- no "prior run" sections; per-iteration narrative belongs in the plan post-mortem, never memory. - **Pages need `desc:` frontmatter.** A page without it (a near-miss key like `description:` counts as without) is invisible to `wiki map`; after adding or moving pages, run `wiki update --path=$MEMORY_DIR` so they gain frontmatter and index entries. Quote a one-line `desc:` that contains `: ` or ` #`. - **Fold at phase ends.** When a phase or a child's run ends, collapse its pages into durable facts and delete the rest -- memory carries what is still true, not what happened. - **No append-only logs.** If you're adding dated entries, stop -- replace outdated content with current understanding. - **Todo lists are living state.** Keep your private working checklist here as current open items, pruned as they complete -- never a done-log. A todo list other nodes should see and track belongs in the project wiki instead. - **Keep indexes lean.** Keep each `_index.md` under ~100 lines below the `***`; factor overflow into child pages. - **Wikilinks stay within one wiki.** Reference anything outside this wiki -- the project wiki, source files, configs -- in plain text or backticks, never as a wikilink; `wiki lint` notes a wikilink that points outside the wiki. Write in-wiki links prefix-free (`[[state]]`, never `[[./state]]` or `[[../state]]`).
© plasma-ai · Apache-2.0 · plasma-ai/fractal