CRUX Memories
Agents that learn. CRUX Memories lets your AI agents extract insights from completed work and reuse them in future sessions — like long-term memory for your codebase.
Agents that learn. CRUX Memories lets your AI agents extract insights from completed work and reuse them in future sessions — like long-term memory for your codebase.
The memory system is fully managed by CRUX. Consumers only provide configuration — all engine logic, storage, tracking, and lifecycle management ships with the CRUX tool.
Memories follow a continuous lifecycle: agents do work, learnings are extracted via dreaming, memories are consolidated during REM sleep, and surfaced on demand via Recall.
After a spec (or unit of work) completes, run /crux-dream to extract learnings. The agent walks through a structured analysis flow.
Periodic rebalancing of the entire memory corpus. Run /crux-dream --rem to scan all memories and trackers, detect issues, and apply corrections.
Memories are classified into types representing different categories of knowledge. As memories prove their value through repeated use, they are automatically promoted to higher-priority types.
Every time an agent's output is influenced by a memory, the reference tracker increments its count. This externalised tracking drives all promotion and demotion decisions.
Memories can be scoped to specific agent identities. Agent-scoped memories are boosted for that agent but never override higher-priority base types. This lets agents develop expertise without polluting shared knowledge.
Each memory is self-contained — its YAML frontmatter and body together provide full context. Files are organised by type in subdirectories.
---
title: "React.memo on list item components
prevents full re-render on data changes"
description: "Wrapping list item components
in React.memo with a custom comparator
reduced re-render time from 480ms to 12ms
on a 500-item list."
type: "core"
strength: 3
created: 2026-04-03
modified: 2026-04-03
source: "20260403-component-library"
tags: [react, performance, rendering]
promoted_from: "learning"
---
(CRUX-compressed memory body)
title Instructive, descriptive — conveys insight at a glancedescription Self-contained summary, enough to act on without reading bodytype Category matching directory: core, redflag, goal, learning, ideastrength Numeric score, auto-incremented on referencesource Unit of work that originated this memorypromoted_from Previous type if a transition occurredQuery and surface memories on demand. Compressed memories are decompressed for display without modifying files on disk.
/crux-dream
Extract & rebalance
/crux-dream <spec-name>Extract memories from completed work/crux-dream --remRun REM sleep rebalancing/crux-dream --rem --yoloAuto-apply non-conflict changes/crux-recall
Query & display
/crux-recallShow contextually relevant memories/crux-recall "query"Search by keyword/crux-recall <spec-name>Show memories from a specific spec/crux-forget
Remove memories
/crux-forget <memory-id>Forget a specific memory by ID/crux-forget "query"Search and select memories to forget/crux-forgetList all memories for selection/crux-remember
Ad-hoc memory creation
/crux-rememberInteractively create a new memory/crux-remember "insight"Create from provided text/crux-remember "insight" --type learningCreate with specific type/crux-meditate
Recursive exploration
/crux-meditateExplore facets from current context via file-based agent tree/crux-meditate "topic"3-level deep, 3-way fan-out exploration to meditations//crux-meditate @file @folder/Explore referenced code architecture/crux-amnesia
Session memory override
/crux-amnesiaToggle session-scoped amnesia mode/crux-amnesia onDisable ambient memory usage for this chat/crux-amnesia offReturn to config-driven memory behaviorThe memory system is modular — each operation is handled by a dedicated skill, orchestrated by the memory manager agent.
memory-crudCreate, read, update, deletememory-extractAnalyse work, propose candidatesmemory-rebalancePromote, demote, consolidatememory-compressCRUX-compress memory bodiesmemory-indexBuild prioritised indexmemory-reference-trackerTrack usage, sync strengthmemories/agents/{id}/, keeping context isolated.
Run /crux-meditate to launch a 3-level recursive, memory-informed exploration with 3-way fan-out at every level. The agent derives facets from your context and writes them to a shared working directory in meditations/. Parallel agents each explore a distinct subfocus, write their discoveries to markdown files, derive 3 narrower child subfocuses, and recurse deeper. Parent agents poll for child output files and aggregate insights back up into a final consolidation.md.
The same memory engine runs identically across platforms. Only the wiring layer differs — rules location, command format, hook mechanism.
.cursor/rules/*.mdc.cursor/commands/crux-dream.md.cursor/hooks/*.py.cursor/skills/*/SKILL.mdCLAUDE.md.claude/commands/crux-dream.md.claude/hooks/session-start.sh.mcp.jsonMEMORIES_AGENT_RULE.mdcrux-dream (shell script)Git hooks / manualMCP stdio serverFetch https://raw.githubusercontent.com/zotoio/CRUX-Compress/main/install.crux.md, read it, and follow its instructions to install CRUX Compress with --with-memories
Or with Python: curl -fsSL https://raw.githubusercontent.com/zotoio/CRUX-Compress/main/install.py | python3 - --with-memories
--with-memories flag scaffolds all memory components. Enable via .crux/crux-memories.json to start capturing agent learnings.