cortex-consolidate
Skill73 starsChanged 4 months agoMITView on GitHub
Run memory maintenance — decay old memories, compress stale content, consolidate episodic memories into semantic knowledge, and run sleep-like replay. Use when the user says 'clean up memories', 'consolidate', 'run maintenance', 'compress old memories', 'memory cleanup', or periodically to keep the memory system healthy. Also use after importing many memories or at the end of a long session.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cortex-automateSkill
- cortex-debug-memorySkill
- cortex-explore-memorySkill
- cortex-importSkill
- cortex-navigate-knowledgeSkill
- cortex-profileSkill
- cortex-recall-globalSkill
- cortex-recallSkill
- cortex-remember-globalSkill
- cortex-rememberSkill
- cortex-setup-projectSkill
- cortex-wiki-authorSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Run the full memory maintenance pipeline — modeled after biological memory consolidation.
- Distinctive: line 15
Use this skill when: After a long session, after bulk imports, periodically (weekly), or when memory_stats shows too many hot memories or …
- Very specific: line 74
Check stats first: Run cortex:memory_stats before consolidating to understand what needs maintenance
- Distinctive: line 75
Checkpoint before bulk operations: Always save a checkpoint before consolidation if you have critical memories
- Very specific: line 76
After backfill: Always consolidate after cortex:backfill_memories to process the imported memories through the full pipeline
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Consolidate — Memory Maintenance and Evolution
Keywords
consolidate, maintenance, cleanup, compress, decay, merge, evolve, sleep, replay, consolidation, memory health, prune, clean up, optimize memories, reduce noise
Overview
Run the full memory maintenance pipeline — modeled after biological memory consolidation. This includes heat decay (cooling unused memories), compression (full text to gist to tags), CLS consolidation (episodic to semantic), causal graph discovery, and sleep-like replay that strengthens important memory clusters.
Use this skill when: After a long session, after bulk imports, periodically (weekly), or when memory_stats shows too many hot memories or high noise.
Workflow
Step 1: Run Full Consolidation
cortex:consolidate({})This runs the complete pipeline:
- Decay cycle — Cool memories by heat * decay_factor. Memories below cold threshold (0.05) become candidates for compression
- Compression — Old memories compress through stages: full text (7+ days) to gist, gist (30+ days) to tags
- CLS consolidation — Frequently-accessed episodic memories promote to semantic store (like hippocampal-to-cortical transfer)
- Causal discovery — PC Algorithm runs on entity co-occurrences to discover causal relationships
- Sleep compute — Dream-like replay strengthens clusters, summarizes related memories, and re-embeds compressed content
Step 2: Review Results
The response includes:
memories_decayed— how many cooled downmemories_compressed— how many were compressed (and to what level)memories_consolidated— how many promoted from episodic to semanticcausal_edges_discovered— new relationships foundreplay_clusters— memory clusters that were replayed and strengthened
Step 3: Selective Operations
For targeted maintenance instead of the full pipeline:
Forget specific memories:
cortex:forget({
"memory_id": <id>,
"hard": false
})Soft delete (sets heat to 0) by default. Use "hard": true for permanent deletion. Protected memories require explicit "force": true.
Save checkpoint before risky operations:
cortex:checkpoint({
"action": "save",
"label": "before-consolidation"
})Restore if something went wrong:
cortex:checkpoint({
"action": "restore",
"label": "before-consolidation"
})Tips
- Don't over-consolidate: Running too frequently prevents memories from naturally developing heat signals. Weekly is usually sufficient.
- Check stats first: Run
cortex:memory_statsbefore consolidating to understand what needs maintenance - Checkpoint before bulk operations: Always save a checkpoint before consolidation if you have critical memories
- After backfill: Always consolidate after
cortex:backfill_memoriesto process the imported memories through the full pipeline
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.

