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
Deep research — paired HTML + PDF report
/crux-meditate "topic"Research mode (default) — depth-first recursion, peer review, mandatory citations/crux-meditate --quick "topic"Fast parallel fan-out for breadth-first scoping/crux-meditate --random-model "topic"Single tree, model randomly picked from modelPool (no extra cost)/crux-meditate --model-per-branch "topic"Single tree, each top-level branch assigned a different model from the pool (no extra cost)/crux-meditate --ensemble "topic"Ensemble max — run across every model in the pool in parallel, then cross-model synthesis/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 strength/crux-meditate spawns crux-cursor-meditation-guide as the dedicated recursive research orchestrator. Six additional skills power the meditation tree.
meditation-researchResearch Phases A–G recursionmeditation-quickQuick parallel fan-outmeditation-ensembleEnsemble cross-model synthesismeditation-reviewAdversarial review cyclemeditation-reportHTML+PDF report generationmeditation-coordinationFile coordination primitivesmemories/agents/{id}/, keeping context isolated.
Run /crux-meditate "your topic" to launch a recursive, memory-informed research tree that writes its outputs to meditations/{yyyymmdd}-{topic-slug}/. The deliverable is not a chat reply — it’s a paired report-{topic-slug}-{ts}.html and report-{topic-slug}-{ts}.pdf with infographics, Chart.js / D3 visualisations, a clickable table of contents, a citations index, and a mandatory adversarial review pass over every output file. Reach for it on the high-stakes questions you’d otherwise spend a day on by hand.
A meditation is configured on two orthogonal axes: a recursion mode (how the tree explores) and a model strategy (how cruxMemories.meditate.modelPool is used, if at all).
--quick
Parallel fan-out (the legacy shape illustrated below). Same report contract, no peer review, warn-only citation enforcement. Use for early-stage breadth-first scoping.
--random-model
One tree, model randomly picked from modelPool at the start. Same agent count as the baseline — useful for cheap diversity sampling across multiple invocations.
--model-per-branch
One tree, each top-level facet branch assigned a distinct model from the pool (descendants inherit). Peer reviewer and adversarial reviewer run on the caller’s model for a unified evaluator. Same agent count as the baseline; the report carries per-branch model attribution.
--ensemble
Run the entire meditation across every model in the pool in parallel, then aggregate into a cross-model synthesis report highlighting convergence, divergence, and unique insights. ~N× baseline + 1 agents. Combinable with --quick.
--random-model, --model-per-branch, and --ensemble are mutually exclusive. The cost-and-richness gate also offers in-place swaps between strategies whenever the configured modelPool size allows.
Before the tree spawns, a merged pre-spawn gate covers depth selection, cost & scope acknowledgment with mode-swap options, and richness level — choose from compact, default (preselected), detailed, or exhaustive to control report depth and agent count. The depth-0 manager also produces init-time suggestions for report sections, visualisation types, and additional focus areas before branches spawn. An anti-homogenisation theme preflight and facet confirmation complete the gates. After consolidation, a finalisation-enhancement gate (multi-select 0–5 curated upgrades) refines the report before adversarial review; skipping all reproduces previous behaviour. If the adversarial review cycle can’t reach PASS within three iterations, the report is not generated and you receive the iteration files plus unresolved findings instead.
The diagram below shows the Quick-mode parallel fan-out tree (the legacy shape, still in use under --quick). Research mode runs the same three top-level branches but recurses depth-first — each depth’s findings drive the next depth’s facet derivation — and adds a peer-review pass across the three branches before consolidation.
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.