memory-ops
npx machina-cli add skill hugoguerrap/cortex/memory-ops --openclawMemory Operations
Data Location
All memory files at ~/.claude/cortex/memory/. Override with CORTEX_HOME env var.
Operations
Read Context
Load all memory files to build situational awareness:
~/.claude/cortex/memory/context.md— current priorities~/.claude/cortex/memory/strategy.md— goals and opportunities~/.claude/cortex/memory/lessons.md(last 30 lines) — recent insights~/.claude/cortex/memory/conversations.md(last 20 lines) — recent sessions~/.claude/cortex/memory/preferences.md— user preferences~/.claude/cortex/memory/watchlist.md— monitored items
Write Memory
- Determine the correct file based on content type
- Read current content
- Add new entry in the appropriate section
- Verify file stays within limits
Consolidate
Periodically merge and deduplicate entries.
Archive
Move old conversation entries (> 30 days) to ~/.claude/cortex/data/exports/conversations-YYYY-MM.md.
Memory File Limits
| File | Max | Action When Exceeded |
|---|---|---|
| context.md | 200 lines | Remove completed/stale items |
| preferences.md | 100 lines | Consolidate similar entries |
| watchlist.md | 50 items | Remove items no longer tracked |
| lessons.md | No limit | Categorize and consolidate |
| conversations.md | 30 days | Archive to data/exports/ |
| strategy.md | No limit | Review for staleness |
Source
git clone https://github.com/hugoguerrap/cortex/blob/main/skills/memory-ops/SKILL.mdView on GitHub Overview
Memory-ops automatically handles persistent memory files for Claude's cortex, enabling read, write, consolidation, and archival operations. It stores data under ~/.claude/cortex/memory/ and can be overridden via CORTEX_HOME, ensuring your context and history stay organized and durable.
How This Skill Works
Memory-ops runs automatically to build awareness by loading memory files from ~/.claude/cortex/memory. It provides four operations Read Context, Write Memory, Consolidate, and Archive to refresh context, append new entries, deduplicate data, and move older conversations to ~/.claude/cortex/data/exports/conversations-YYYY-MM.md.
When to Use It
- Before a task, load context.md, strategy.md, and recent lessons to inform decisions.
- After a chat, write new insights or user preferences to the appropriate memory file.
- Periodically consolidate memory to remove duplicates and compress entries.
- Archive old conversations (> 30 days) to the data/exports folder.
- Review memory file limits and prune stale items when a file nears its max
Quick Start
- Step 1: On startup, Read Context by loading memory files from ~/.claude/cortex/memory
- Step 2: After a session, Write Memory with new insights or preferences to the correct file
- Step 3: Periodically Run Consolidate and Archive to keep data fresh and within limits
Best Practices
- Organize entries by file type to keep memory clean and searchable
- Write meaningful, timestamped entries to aid recall
- Run Consolidate regularly to remove duplicates and unify similar items
- Archive conversations nearing 30 days to preserve long term history
- Respect per file limits and prune stale or completed items promptly
Example Use Cases
- Load context and strategy at startup to set current priorities and goals
- Append a user preference change to preferences.md after a session
- Run Consolidate to deduplicate reiterated insights across lessons and context
- Archive conversations older than 30 days to conversations-YYYY-MM.md
- Review watchlist entries and remove items no longer tracked