Memory - Long-term Context

VerifiedSafe

Reads long-term memory files (errors.md, context.md, files.md) to access historical context, code references, and error fix records. Useful after session compaction or when needing to recall previous discussions, avoid repeating mistakes, or find code patterns.

Sby Skills Guide Bot
ProductivityIntermediate
6/2/2026
Claude Code
#memory#context#long-term#compact#error-prevention

Recommended for

Automated summary

Reads long-term memory files (errors, context, files) to restore historical context after session compaction, preventing important information from being lost.

Strengths

  • Automatically preserves critical details across compacts
  • Prioritizes error fixes to avoid repeating mistakes
  • Intelligent truncation to save context
  • Selective file reading by topic

Limitations

  • Requires prior setup with the memory.py script
  • Only works within the Claude Code ecosystem
  • Truncation may lose older details if the file is very large
When to use it

Use this skill after every compact or when resuming a session to recover historical context and avoid past errors.

When not to use it

Do not use it if the session is very short or if you want to start fresh without any history.

Security analysis

Safe
Quality score90/100

The skill instructs running a local Python script to read specific memory files, with no destructive, exfiltrating, or obfuscated actions. It does not involve network access, secret handling, or disabling safety features.

No concerns found

How this analysis is made

Examples

Read error memory after compact
Read my error memory to recall past mistakes before fixing this test failure.
Read context memory for project background
Read context.md to remember the project requirements and previous discussions.
Read all memory files for full rebuild
Read all memory files to get the complete historical context after compact.

name: memory description: Read long-term memory files to get historical context, code references, and error fix records. Use when user wants to read memory, get context, check history, avoid repeating errors.

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

| File | Content | Priority | |------|---------|----------| | errors.md | Error fix records | Highest - Avoid repeating mistakes | | context.md | User messages + technical concepts | Medium - Full background | | files.md | Code file references | Low - 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:

| Situation | Command | |-----------|---------| | Encountering errors / Tests failing | uv run memory.py errors.md | | Need to recall previous discussions | uv run memory.py context.md | | Reusing code patterns / Finding files | uv 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

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/memory-long-term-context-mmk3ni0e' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/memory-long-term-context-mmk3ni0e/download' --output '.skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md.part' && mv '.skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md.part' '.skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md' && test -s '.skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/memory' && cp -R '.skill-downloads/memory-long-term-context-mmk3ni0e' '.claude/skills/memory'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/memory-long-term-context-mmk3ni0e'

openskills read 'memory-long-term-context-mmk3ni0e'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/memory-long-term-context-mmk3ni0e/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills