Agent skill · operations · yonatangross
dream
Nightly memory consolidation: prunes stale entries, merges duplicates, resolves contradictions, rebuilds MEMORY.md. Use when memory needs cleanup. To store use remember; to search use memory.
Why this skill is useful
Adds a deterministic script for memory consolidation that resolves stale entries, duplicates, and contradictions, which the AI wouldn't reliably generate on its own.
What it needs
About 11k tokens when loaded. Last updated 2026-08-06. 215 stars on the source repository.
What this skill does
Dream - Memory Consolidation Deterministic memory maintenance: detect stale entries, merge duplicates, resolve contradictions, rebuild the MEMORY.md index. All pruning decisions are based on verifiable checks (file exists? function exists? duplicate content?), not LLM judgment. Argument Resolution Overview Memory files accumulate across sessions. Over time they develop problems: Stale references — memories pointing to files, functions, or classes that no longer exist Duplicates — multiple memories covering the same topic with overlapping content Contradictions — newer memories superseding older ones without cleanup Index drift — MEMORY.md index out of sync with actual memory files This skill fixes all four problems using deterministic checks only. Finish line. Done means: MEMORY.md is rebuilt from the surviving files and passes the STEP 5.5 verify, the STEP 6 report is printed, and STEPs 7 to 9 have each run or printed a one-line skip reason. Budget: one read pass over the discovered memory files (STEP 1), one MEMORY.md rewrite (STEP 5) plus the STEP 5.5 trailer rewrite when the index is over budget, and no subagents (every check is deterministic); stop and report at the finish line or the first cap, whichever comes first. Cadence (CC 2.1.142+): Reactive compaction now sizes its first summarize attempt to the actual overflow, so long sessions stall mid-turn far less often. The "run nightly" cadence can relax toward "run when memory files accumulate" — consolidation is no longer needed to head off compaction inefficiency. --- STEP 1: Discover Memory Files Read every discovered memory file. Parse frontmatter (name, description, type) and body content. Build an in-memory inventory: --- STEP 2: Detect Staleness For each memory file, extract references and verify they still exist. 2a: File Path References Extract paths that look like file references (patterns: paths with / and file extensions, backtick-wrapped paths): Classify each ref's SCOPE before verifying it. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills yonatangross/dream--a0890d