Permanent Memory Loader
Auto-invoke complement to epic-summarizer. Read-only.
Behavior (in order)
- Detect: if
.claude/memory/permanent_memory.mddoes NOT exist → exit silently - Read the file. For each
## Epic: <ID> — <intent>section, apply the dual-read rule (below) to load only its heading + one summary line — never the full body / subsections. - Compose a compact block: 1 line per Epic (heading + its one summary line, ≤120 chars)
- Stamp
trust: fileperrules/core/memory-trust-policy.md
Dual-read rule (v2 fast-path + v1 fallback)
Sections come in two shapes; both load, and the loader picks per section:
- v2 (fast-path): if the section body's first line is an
<!-- af-memory:v2 epic=… confidence=… items=… -->marker, load exactly three lines — the##heading, that marker line, and the single one-line human summary immediately after it. Never read the prose subsections or typed entries. - v1 (fallback, backward-compat): if the section has no
af-memory:v2marker, load the##heading + the first non-empty line after it. Existing v1 files are never rewritten or migrated — they keep working unchanged.
Exact lines loaded per section:
dualread[2]{shape,detect,lines_loaded}:
v2,"body starts with <!-- af-memory:v2 ... -->","## heading + marker line + next 1-line summary"
v1,"no af-memory:v2 marker","## heading + first non-empty line"
The marker's confidence=/items= fields are available cheaply for degradation decisions without touching the body.
Token budget
budget[3]{layer,target,hard_cap}:
always_loaded,120,200
per_epic_summary,12,20
per_subsection_line,1,2
Budget exceeded → degrade (drop Tentative → trim patterns → Epic IDs only → skip if file > 8000 tokens).
Constraints
Never loads full Epic bodies or manual_overrides.md; never writes; never decides from memory content. Epics older than 90 days are prefixed (>90d may be outdated).
Detail (example output, degradation ladder, staleness, tie-ins): skills/permanent-memory-loader/reference.md — load on demand only.