ai/claude/skills/dream/SKILL.md
Memory consolidation for Claude Code. Scans session transcripts for corrections, decisions, preferences, and patterns, then merges findings into persistent memory files. Inspired by how sleep consolidates human memory.
npx skillsauth add otto-nation/otto-workbench dreamInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Consolidates scattered auto-memory notes into a clean, organized knowledge base by scanning recent session transcripts for corrections, decisions, preferences, and patterns.
Run manually with /dream. Auto-triggers every 24 hours via the Stop hook managed by otto-workbench sync.
Dream runs 5 sequential phases. Execute them in order. Do not skip phases.
ORIENT --> GATHER SIGNAL --> CONSOLIDATE --> PRUNE & INDEX --> CONTEXT UPDATE
Goal: Understand the current state of memory before changing anything.
ls -d ~/.claude/projects/*/memory/ 2>/dev/null
Read MEMORY.md in each project's memory directory. Note:
Read each topic file to understand what's already stored.
A mental map of which projects have memory, what topics are covered, how large the files are, and what's potentially stale or contradictory.
Goal: Extract important information from recent sessions using targeted grep.
find ~/.claude/projects/*/sessions/ -name "*.jsonl" -mtime -7 2>/dev/null | sort -t/ -k6 -r
User corrections (highest priority):
grep -il "actually\|no,\|wrong\|incorrect\|not right\|stop doing\|don't do\|I said\|I meant\|that's not\|correction" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Preferences and configuration:
grep -il "I prefer\|always use\|never use\|I like\|I don't like\|I want\|from now on\|going forward\|remember that\|keep in mind\|make sure to\|default to" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Important decisions:
grep -il "let's go with\|I decided\|we're using\|the plan is\|switch to\|move to\|chosen\|picked\|decision\|we agreed" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Recurring patterns:
grep -il "again\|every time\|keep forgetting\|as usual\|same as before\|like last time\|we always\|the usual" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Review feedback signals:
grep -il "accepted\|rejected\|won't-fix\|false positive\|not applying\|review feedback summary" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
For each file that matches, read ONLY the surrounding context of the match. JSONL files have one JSON object per line. Focus on lines where type is "human" (user messages) and the immediately following "assistant" response.
For each finding, note:
Goal: Merge new findings into existing memory.
Never duplicate. Check if it already exists. If it does, update the existing entry.
Convert relative dates to absolute. "Yesterday" in a session from March 15 becomes "2026-03-14". Never store relative dates.
Delete contradicted facts. If memory says "Prefers tabs" but a recent session says "Use spaces", remove the old entry and write the new one. Add a note: (Updated YYYY-MM-DD, previously: tabs).
Preserve source attribution. Note where each new entry came from: (from session YYYY-MM-DD).
Topic file organization. Group related memories:
preferences.md — How the user likes things donedecisions.md — Choices and their rationalecorrections.md — Things the user correctedpatterns.md — Recurring workflows, common tasksreview-feedback.md — Accepted/rejected review findings and false positive patternsRoute facts to the right destination — memory, context.md, or machine.md.
machine.md (~/.claude/machine/machine.md) — facts about the machine itself:
context.md (.claude/context.md in the project) — stable project architectural truth:
memory/ — session-derived behavior and preferences:
Entry format. Each memory entry should be concise:
- [YYYY-MM-DD] The fact or preference. (source: session, confidence: high/medium)
Goal: Keep MEMORY.md lean. Remove stale content. Enforce size limits.
MEMORY.md is an index file, not a content store:
Remove or archive entries that are:
~/.claude/projects/After completing all 4 phases:
date +%s > ~/.claude/projects/<project>/memory/.last-dream
rm -f ~/.claude/.dream-pending
cp -r ~/.claude/projects/<project>/memory/ ~/.claude/projects/<project>/memory-backup-$(date +%Y%m%d)/
After running, verify:
wc -l on MEMORY.md — should be under 200 linesGoal: Push architectural facts discovered in sessions into .claude/context.md.
Memory captures behavior; context.md captures stable truth about the project.
Only if .claude/context.md exists in the project directory. Skip silently otherwise.
Re-use the session files already scanned in Phase 2. Look specifically for architectural signals:
Software/API identity discoveries:
grep -il "not synapse\|not synapse\|actually uses\|it's actually\|turned out\|the real\|wrong api\|wrong image\|wrong software" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Container constraint discoveries:
grep -il "not installed\|not available\|doesn't have\|missing tool\|no curl\|no wget\|no bash\|no shell\|minimal image\|distroless" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Architectural convention confirmations:
grep -il "the convention is\|the pattern is\|always goes in\|never edit directly\|single source\|canonical location" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
<!-- candidate: <fact> (seen: YYYY-MM-DD) --> at the bottom of the relevant section for human reviewFor each qualifying fact, determine the right section in context.md:
Format for new bullets:
- <Fact stated concisely.> <!-- added by dream YYYY-MM-DD -->
<!-- last-reviewed: YYYY-MM-DD --> header at the top of context.md to today's dateGoal: Push machine-level facts discovered in sessions into ~/.claude/machine/machine.md.
Only if ~/.claude/machine/machine.md exists. Skip silently otherwise.
Re-use the session files already scanned in Phase 2. Look for machine-level signals:
Runtime/tool changes:
grep -il "upgraded\|installed\|updated\|removed\|uninstalled\|now running\|switched to\|brew install" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
Docker/runtime state changes:
grep -il "colima\|docker.*not\|docker.*stopped\|socket.*not found\|docker desktop" ~/.claude/projects/*/sessions/*.jsonl 2>/dev/null
machine.md is auto-generated — do NOT directly edit its sections.
Instead, append a <!-- session-note: --> comment at the bottom of the relevant section:
<!-- session-note: <fact> (seen: YYYY-MM-DD) — run /machine to regenerate -->
This flags the section for refresh on the next /machine run, without corrupting the generated content.
If machine.md was updated, note it in the Phase 5 summary line. Suggest running /machine to regenerate from current system state.
testing
Address incoming PR review comments: fetch, verify, fix, and reply. Works with human and bot reviewers.
development
Reviews accumulated Claude Code memories for promotion into durable workbench artifacts — lint rules, scripts, coding rules, hooks. Prioritizes mechanical enforcement over prose.
tools
Manage GitHub PR review lifecycle: analyze unanswered threads, update review files, and post replies. Initial posting is handled by the review-post script.
tools
Refresh the machine profile (~/.claude/machine/machine.md) — hardware, OS, runtimes, Docker, Git identity, and project registry. Run after upgrading tools or to force a refresh.