Automate Agent Memory Cleanup with Claude Dreaming
Use the 'Dreams' feature to asynchronously purge stale agent data.
Run a 'Dream' job to automatically merge duplicate entries and resolve contradictions in your Claude Managed Agent's memory store.
The Scenario
You have an autonomous agent that has conducted dozens of customer support sessions. The agent's memory is now cluttered with duplicate user preferences and outdated troubleshooting steps.
Before & after
Developers manually review hundreds of lines of logs and session transcripts to identify stale data or contradictions, a process that usually takes 60–90 minutes.
Using the 'Dreams' feature, Claude spends about 3–5 minutes of background processing to analyze transcripts and generate a clean, contradiction-free memory store ready for review.
The Prompt
I am using Claude Managed Agents. I want to run a dream job on my existing memory store [INSERT_MEMORY_STORE_ID] using the latest session transcripts. Please provide the API request structure including the necessary beta headers 'managed-agents-2026-04-01' and 'dreaming-2026-04-21' to trigger this asynchronous cleanup.
A 'dream' is an asynchronous job that reads existing memory stores and past session transcripts. It merges duplicates, removes contradictions, and surfaces new insights without modifying the original source data.
Source
Claude Platform release notes - Claude Platform Docs"A dream reads an existing memory store alongside past session transcripts, then produces a new, reorganized memory store: duplicates merged, stale or contradicted entries replaced."
