Memory Optimization Mechanics Deliver Cross-Session Intelligence
Anthropic's Dreaming feature, launched as a research preview at Code w/ Claude 2026 on May 6, operates as a scheduled cron job that processes your Claude agent's memory file offline. Between user sessions, it scans all prior interactions, eliminates duplicate entries to reduce bloat, resolves factual contradictions by prioritizing consistent patterns, and extracts multi-session insights—like user preferences or recurring tasks—that no single conversation could detect. This isn't a context window expansion or model upgrade; it's targeted file editing that keeps memory lean and coherent, enabling agents to maintain state across disjointed interactions without hallucinating from noisy data.
To implement a similar system yourself, use the public open-source replica: run a nightly script that ingests session logs, applies deduplication via similarity clustering (e.g., embedding-based cosine thresholds >0.9), merges conflicting facts with confidence scoring, and appends synthesized summaries. This approach scales memory indefinitely without token limits, as the job outputs a compact, structured file Claude reloads on next use.
Harvey's 6x Completion Rate Proves Production Value
Legal AI startup Harvey reported roughly 6x higher agent task completion rates in internal tests after enabling Dreaming. Agents previously stalled on long-running legal research or multi-step drafting due to memory overload—duplicates caused loops, contradictions led to errors. Post-Dreaming, optimized memory let agents chain 10x more steps reliably, surfacing patterns like "user prefers concise briefs" from weeks of chats. This validates Dreaming for production agents: expect 4-8x gains in workflows with >50 sessions, but only if your memory format supports structured edits (JSONL with metadata timestamps works best).
Replicate Harvey's setup by logging sessions to a vector store, then cron the optimization—test on 100-sample legal datasets shows completion jumps from 15% to 85% on chained queries.
Three Under-discussed Risks in Auto-Dreaming Defaults
Despite gains, Dreaming introduces pitfalls: (1) Over-pruning erodes nuance—aggressive duplicate removal can strip context-specific details, like evolving client instructions; tune similarity thresholds to 0.85 max. (2) Contradiction resolution biases toward recency, potentially overwriting valid early facts; add user-voted weights or manual review queues. (3) GDPR compliance gaps in defaults—Auto Dream processes all session data without explicit consent logging, risking fines under EU data minimization rules; implement opt-in flags and anonymization before cron runs. Avoid blindly enabling; audit memory diffs post-job to catch drifts early.