It's NOT a memory store — it's an index of one-line pointers to topic files. Truncated at 200 lines / 25KB. Topic files are auto-surfaced by Sonnet (not FileReadTool). Session transcripts are grep-only. Background consolidation via autoDream fires after 24h + 5 sessions.
MEMORY.md is always injected into the system prompt. But it contains no actual memory content — just one-line pointers to topic files.
- [User role](user_role.md) — data scientist focused on observability - [Testing preferences](feedback_testing.md) — use real DB, not mocks - [Merge freeze](project_freeze.md) — starts 2026-03-05 for mobile release - [Bug tracker](reference_linear.md) — pipeline bugs in Linear "INGEST"
Each line: - [Title](file.md) — one-line hook
Max ~150 chars per line. Lines after 200 truncated. Warning appended if truncated.
feedback_testing.md) with YAML frontmatter: name, description, typeNever write memory content directly into MEMORY.md. It's an index, not a store.
Not FileReadTool — an automatic background system using Sonnet as a relevance ranker.
memoryScan.ts reads up to 200 .md files (excluding MEMORY.md). Extracts: filename, mtime, frontmatter description (first 30 lines), type. Sorted newest first.sideQuery() with Sonnet model. Input: user's current query + formatted manifest ([type] filename (timestamp): description). System prompt: "Select memories you are CERTAIN will be helpful. Filter out recently-used tool docs."{ selected_memories: string[] } (max 256 tokens). Already-surfaced memories filtered out. Results: up to 5 {path, mtimeMs} entries.readMemoriesForSurfacing() loads file contents. Injected as relevant_memories attachments — the model sees them in context without any FileReadTool call. Fully automatic.Role, goals, knowledge, preferences. "User is a data scientist focused on observability." Tailors responses to expertise level.
What to do/avoid based on corrections AND confirmations. "Use real DB, not mocks — burned last quarter." Includes Why + How to apply.
Ongoing work, goals, deadlines, incidents. "Merge freeze starts 2026-03-05 for mobile release." Converts relative dates to absolute.
Pointers to external systems. "Pipeline bugs tracked in Linear INGEST project." "Oncall dashboard at grafana.internal/d/api-latency."
name, description (used by Sonnet selector — be specific), type (user/feedback/project/reference). The description is what Sonnet reads to decide relevance — vague descriptions = never surfaced.Fires after ≥24h since last consolidation AND ≥5 sessions. Runs as a forked subagent via runForkedAgent().
ls memory directory, read MEMORY.md, skim topic files, review daily logs if assistant-mode.
Priority 1: Daily logs. Priority 2: Drifted existing memories. Priority 3: Transcript grep with narrow terms (large JSONL — never read whole files).
Write/update memory files. Merge signal into existing. Convert relative → absolute dates. Delete contradicted facts.
Update MEMORY.md pointers. Remove stale entries. Demote verbose entries. Add new memory pointers. Resolve contradictions.
.consolidate-lock file in memory dir containing PID. Stale guard at 60 minutes (prevents dead process holding lock forever). On failure, rollbackConsolidationLock() rewinds mtime so next session retries.git log / git blame are authoritative