mcpField
M
memory

memory

github.com/maxgent-aiAgent workflows053 installsUpdated 37w ago
Repository

About memory

A Claude Code skill that reads long-term memory files saved during conversation compaction. It uses a script to retrieve error records, background context, or file references, with truncation for large files.

Key features

  1. 01Read error, context, and file records
  2. 02Select specific files or read all
  3. 03Truncate large files automatically
  4. 04Skip files that do not exist

Use cases

  1. 01Recall saved context after compaction
  2. 02Check prior fixes when errors recur
  3. 03Retrieve earlier technical discussions
  4. 04Find references to code files

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/maxgent-ai/maxgent-plugin --skill memory

After installing, type/memoryin Claude Code to confirm it loaded.

Bundled filesmemory.py

Details

From the project README

Memory - Long-term Context

Read the current session's long-term memory files to access historical context preserved across compacts.

Background

Claude Code's /compact compresses conversations to save context. Repeated compaction causes "memory decay" - important early details gradually get lost.

Max's memory system automatically saves accumulated content to files during each compact, ensuring important information is never lost.

Memory Files

FileContentPriority
errors.mdError fix recordsHighest - Avoid repeating mistakes
context.mdUser messages + technical conceptsMedium - Full background
files.mdCode file referencesLow - Only when needed

Instructions

Use the memory.py script to read files with automatic truncation (large files are trimmed to last ~15000 chars to save context):

# Read errors.md only (default, recommended)
cd /path/to/skills/memory && uv run memory.py errors.md

# Read specific files
cd /path/to/skills/memory && uv run memory.py errors.md context.md

# Read all files
cd /path/to/skills/memory && uv run memory.py all

The script automatically:

  • Reads from ~/.claude/projects/$MAX_PROJECT_ID/max/$MAX_SESSION_ID/memory/
  • Truncates files > 15000 chars (keeps most recent content)
  • Skips non-existent files

When to Read Memory

After compact - When you see "Earlier details saved to..." in the summary:

  • Always read errors.md first - Critical to avoid repeating past mistakes

On demand - Read specific files based on the situation:

SituationCommand
Encountering errors / Tests failinguv run memory.py errors.md
Need to recall previous discussionsuv run memory.py context.md
Reusing code patterns / Finding filesuv run memory.py files.md

Notes

  • Memory files are automatically updated during each /compact
  • Files are appended with timestamps, newest content at the bottom
  • Large files are truncated to ~15000 chars (≈3% of context) to prevent context overflow

Comments

Markdown supported