crux-skill-memory-index
Skill8 starsChanged 2 months agoMITView on GitHub
Build a prioritised memory index from all memory files and reference trackers. Use when rebuilding the memory index, after memory CRUD operations, or when agents need a sorted discovery list.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/crux-memories-integration.crux.mdcCursor rule
- .cursor/rules/crux-memories-integration.mdCursor rule
- .cursor/rules/_CRUX-RULE.mdcCursor rule
- .cursor/rules/docs-sync.crux.mdCursor rule
- .cursor/rules/docs-sync.crux.mdcCursor rule
- .cursor/rules/docs-sync.mdCursor rule
- .cursor/rules/example/coding-standards-demo.crux.mdcCursor rule
- .cursor/rules/example/coding-standards-demo.mdCursor rule
- .cursor/rules/ignore-example-rules.crux.mdCursor rule
- .cursor/rules/ignore-example-rules.crux.mdcCursor rule
- .cursor/rules/ignore-example-rules.mdCursor rule
- .cursor/rules/skill-and-agent-references.mdcCursor rule
- .cursor/rules/spec-agent-allocation.crux.mdCursor rule
- .cursor/rules/spec-agent-allocation.crux.mdcCursor rule
- .cursor/rules/spec-agent-allocation.mdCursor rule
- .cursor/rules/spec-implementation-hygiene.mdcCursor rule
- .cursor/rules/version-bump.crux.mdCursor rule
- .cursor/rules/version-bump.crux.mdcCursor rule
- .cursor/rules/version-bump.mdCursor rule
- .cursor/rules/zip-contents-protection.crux.mdCursor rule
- .cursor/rules/zip-contents-protection.crux.mdcCursor rule
- .cursor/rules/zip-contents-protection.mdCursor rule
- crux-skill-memory-compressSkill
- crux-skill-memory-crudSkill
- crux-skill-memory-extractSkill
- crux-skill-memory-meditation-coordinationSkill
- crux-skill-memory-meditation-ensembleSkill
- crux-skill-memory-meditation-quickSkill
- crux-skill-memory-meditation-reportSkill
- crux-skill-memory-meditation-researchSkill
- crux-skill-memory-meditation-reviewSkill
- crux-skill-memory-rebalanceSkill
- crux-skill-memory-reference-trackerSkill
- crux-utilsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
After creating, updating, or deleting memories (post-CRUD housekeeping)
- Distinctive: line 14
When an agent needs to discover available memories sorted by priority
- Distinctive: line 15
After bulk operations that may have changed multiple memory files
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CRUX Skill: Memory Index
Builds a prioritised index of all memory files by scanning the configured memory directories, joining with reference tracker data, and writing a sorted index to .crux/memory-index.yml.
When to Use
- After creating, updating, or deleting memories (post-CRUD housekeeping)
- During REM sleep / dream cycles to refresh the index
- When an agent needs to discover available memories sorted by priority
- After bulk operations that may have changed multiple memory files
Quick Start
# Rebuild the index (uses default config path)
python .cursor/skills/crux/crux-skill-memory-index/scripts/memory-index.py
# Rebuild with a custom config path
python .cursor/skills/crux/crux-skill-memory-index/scripts/memory-index.py --config path/to/config.json
# Post-dream rebuild (checks enableMemories flag, then rebuilds)
python .cursor/skills/crux/crux-skill-memory-index/scripts/post-dream.pyPost-Dream Rebuild
The post-dream.py script is a convenience wrapper invoked programmatically by the /crux-dream workflow after memory extraction or REM sleep completes. It:
- Checks
.crux/crux-memories.json— exits early ifenableMemoriesis not"true" - Calls
memory-index.pyto rebuild the index - The MCP server's file watcher detects the index timestamp change automatically
This script is not a Cursor event hook and is not registered in .cursor/hooks.json.
Configuration
Reads .crux/crux-memories.json — uses cruxMemories.storage.memoriesDir / agentMemoriesDir / indexFile, cruxMemories.referenceTracking.trackingDir, and cruxMemories.typePriority.
Config keys and defaults: see
.cursor/skills/_memory-shared.md#config-referenceand.crux/crux-memories.json(authoritative).
Index File Format
The generated .crux/memory-index.yml contains a flat list under the memories key, sorted by:
- Type priority — types earlier in
typePriorityrank higher - Strength descending — within a type, stronger memories first
- References descending — ties broken by reference count
Each entry has:
| Field | Type | Description |
id | string | 7-char hex hash from frontmatter (omitted if memory predates the id field) |
slug | string | Memory slug derived from filename |
title | string | Title from frontmatter |
description | string | Description from frontmatter |
type | string | Memory type from frontmatter |
strength | integer | Strength from frontmatter |
references | integer | Total reference count from tracker (0 if no tracker) |
tags | list | Tags from frontmatter |
file | string | Relative path to the memory file |
Example Output
# Generated by crux-skill-memory-index — do not edit manually
# Last rebuilt: 2026-04-03T14:22:00Z
memories:
- id: "b3f1a2c"
slug: react-memo-list-rendering
title: "React.memo on list item components prevents full re-render"
description: "Wrapping list item components in React.memo..."
type: "core"
strength: 3
references: 12
tags: [react, performance, rendering]
file: memories/core/react-memo-list-rendering.memory.crux.mdError Handling
- Missing config: exits with code 1 and prints an error to stderr
- Corrupt/missing frontmatter: skips the file with a warning to stderr
- Missing tracker file: sets
referencesto 0 for that memory - Empty memories directory: produces a valid index with an empty
memorieslist
Prerequisites
- Python >= 3.10
pyyamlpackage installed.crux/crux-memories.jsonmust exist with valid config
Out-of-scope and cross-skill delegation: see
.cursor/skills/_memory-shared.md#cross-skill-boundariesand the agent table inAGENTS.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

