agentleFS
zotoiozotoio/CRUX-Compress/.cursor/skills/crux-skill-memory-index/SKILL.md

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.

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
  1. Distinctive:

    After creating, updating, or deleting memories (post-CRUD housekeeping)

    line 12
  2. Distinctive:

    When an agent needs to discover available memories sorted by priority

    line 14
  3. Distinctive:

    After bulk operations that may have changed multiple memory files

    line 15

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.py

Post-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:

  1. Checks .crux/crux-memories.json — exits early if enableMemories is not "true"
  2. Calls memory-index.py to rebuild the index
  3. 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-reference and .crux/crux-memories.json (authoritative).

Index File Format

The generated .crux/memory-index.yml contains a flat list under the memories key, sorted by:

  1. Type priority — types earlier in typePriority rank higher
  2. Strength descending — within a type, stronger memories first
  3. References descending — ties broken by reference count

Each entry has:

FieldTypeDescription
idstring7-char hex hash from frontmatter (omitted if memory predates the id field)
slugstringMemory slug derived from filename
titlestringTitle from frontmatter
descriptionstringDescription from frontmatter
typestringMemory type from frontmatter
strengthintegerStrength from frontmatter
referencesintegerTotal reference count from tracker (0 if no tracker)
tagslistTags from frontmatter
filestringRelative 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.md

Error 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 references to 0 for that memory
  • Empty memories directory: produces a valid index with an empty memories list

Prerequisites

  • Python >= 3.10
  • pyyaml package installed
  • .crux/crux-memories.json must exist with valid config

Out-of-scope and cross-skill delegation: see .cursor/skills/_memory-shared.md#cross-skill-boundaries and the agent table in AGENTS.md.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.