# MEMORY.md compact index contract — MC #101645

# MC #101645 — MEMORY.md compact index contract

**Status:** implemented locally with deterministic line-count guard.

## Contract

- `~/.claude/projects/-Users-makinja/memory/MEMORY.md` is an index, not a fact dump.
- Maximum size: 50 lines.
- Detailed facts belong in separate memory memo files, BookStack pages, MC evidence, or LightRAG.
- Global-critical facts may be linked from MEMORY.md, but should not be expanded inline.

## Implementation evidence

- Current MEMORY.md line count: 41.
- Pre-compaction snapshot: `~/.claude/projects/-Users-makinja/memory/_archive/MEMORY-pre-101645-20260521T113803Z.md`.
- Guard: `~/.claude/hooks/memory-size-gate.sh`.
- Git pre-commit hook: `~/.claude/.git/hooks/pre-commit` invokes the guard.

## Recovery

If a needed fact appears missing from the compact index, query deep memory with `node ~/system/tools/discover.js memory "topic"` or inspect the pre-compaction snapshot.