Get the FREE Ultimate OpenClaw Setup Guide →

memory-ops

npx machina-cli add skill hugoguerrap/cortex/memory-ops --openclaw
Files (1)
SKILL.md
1.6 KB

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

  1. ~/.claude/cortex/memory/context.md — current priorities
  2. ~/.claude/cortex/memory/strategy.md — goals and opportunities
  3. ~/.claude/cortex/memory/lessons.md (last 30 lines) — recent insights
  4. ~/.claude/cortex/memory/conversations.md (last 20 lines) — recent sessions
  5. ~/.claude/cortex/memory/preferences.md — user preferences
  6. ~/.claude/cortex/memory/watchlist.md — monitored items

Write Memory

  1. Determine the correct file based on content type
  2. Read current content
  3. Add new entry in the appropriate section
  4. 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

FileMaxAction When Exceeded
context.md200 linesRemove completed/stale items
preferences.md100 linesConsolidate similar entries
watchlist.md50 itemsRemove items no longer tracked
lessons.mdNo limitCategorize and consolidate
conversations.md30 daysArchive to data/exports/
strategy.mdNo limitReview 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

  1. Step 1: On startup, Read Context by loading memory files from ~/.claude/cortex/memory
  2. Step 2: After a session, Write Memory with new insights or preferences to the correct file
  3. 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

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers