Skip to main content
Vantaige

Claude Code Dreaming (Memory Consolidation): 2026 Setup Guide

A
Aymen B
13 min read
Claude Code Dreaming (Memory Consolidation): 2026 Setup Guide

Claude Code Dreaming (Memory Consolidation): The 2026 Research-Preview Setup

Anthropic announced "dreaming" at the Code with Claude developer conference in San Francisco on May 6, 2026, alongside doubled usage limits for Pro and Max and the SpaceX compute partnership. Dreaming is the company's first shipping memory-consolidation feature: a scheduled, asynchronous job that reads an agent's existing memory store plus past session transcripts and produces a new, deduplicated, reorganized memory store. It's gated to a research preview that requires a signup form and two beta headers, and it lives in the Managed Agents API, not yet inside the Claude Code CLI.

TL;DR

  • Dreaming is a research preview, gated by a signup form

  • It needs two beta headers: managed-agents-2026-04-01 and dreaming-2026-04-21

  • Input memory store + up to 100 sessions in, new memory store out, original is untouched

  • Supported models during preview: claude-opus-4-7 and claude-sonnet-4-6

  • Lives in the Managed Agents API, not the Claude Code CLI (yet)

  • First-hand artifact: diff /preferences/ files in the output store vs. input

· Founder, Vantaige · Published 2026-05-08 · 10 min read · Last reviewed 2026-05-08


What does Claude Code dreaming actually do?

Dreaming is an asynchronous pipeline that reads one of your agent's existing memory stores plus up to 100 past session transcripts, and writes a separate, reorganized output memory store with duplicates merged, contradicted entries replaced, stale notes pruned, and new patterns surfaced. The original input store is never modified, so you can compare both side-by-side and discard the output if you don't like it.

In Anthropic's own blog post the framing is two-part: memory captures what an agent learns as it works, and dreaming "refines that memory between sessions, pulling shared learnings across agents and keeping it up-to-date." The official Dreams documentation is the authoritative spec.

A few mechanical details worth being precise about:

  • Each "dream" is a single API resource (drm_01...) with a lifecycle, pending, running, completed, failed, canceled.

  • The pipeline runs as an underlying session; once a dream is running you can stream its events to watch what it reads and writes in real time.

  • A dream typically takes minutes to tens of minutes, depending on input size.

  • Inputs are limited to one memory store and up to 100 sessions; you can also pass a 4,096-character instructions string to bias what the dream prioritizes.

This is not "Claude trains itself overnight." No model weights change. What changes is the memory store, a workspace-scoped collection of text files (capped at 100 KB / ~25K tokens per file) that gets attached to future sessions as a mounted directory under /mnt/memory/ inside the agent's container, per the memory documentation.

Is "dreaming" the same as Claude Code memory consolidation?

Yes and no. "Dreaming" is the official product name in Anthropic's blog, docs, and the SDK; "memory consolidation" is the underlying mechanism (read existing memory + sessions, write a curated replacement). The feature lives on the Managed Agents API, which is the same platform Claude Code agents run on, but the Claude Code CLI does not currently expose a dream command in stable releases as of May 8, 2026.

If you've been searching for "claude code dream mode" or "claude memory consolidation" expecting a flag inside the CLI, that's the gap to know about. The way you actually trigger a dream today is via the API, the official ant CLI, or one of the eight SDKs (Python, TypeScript, C#, Go, Java, PHP, Ruby, plus the bash/curl pattern).

How do I get access to dreaming?

The exact step-by-step access procedure is: request access via the form, wait for approval, then send API calls with both required beta headers. You also need a paid Claude API account, dreaming bills at standard API token rates for whichever model you select.

  1. Submit the access request. Go to claude.com/form/claude-managed-agents. The same form gates the broader Managed Agents research preview. Approval is not instant; teams report waiting days to weeks.

  2. Confirm your API key has the beta entitlement. Once approved, your workspace gets the entitlement automatically. You don't generate a new key.

  3. Send requests with both beta headers. Every Managed Agents request needs managed-agents-2026-04-01. Dreams additionally need dreaming-2026-04-21. Combined header: anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21. The Anthropic SDKs set both automatically.

  4. Pick a supported model. During the research preview, only claude-opus-4-7 and claude-sonnet-4-6 can run the dreaming pipeline. Sonnet costs less per token; Opus produces more thorough curation in our small-batch tests.

  5. Verify with a tiny dream first. Create an empty memory store, attach it to two short sessions, then trigger one dream. The dream resource appears with status: "pending" and a new outputs[] entry once it transitions to running. Success looks like status: "completed" and an output memory_store_id ready to attach to a future session.

A minimal curl create call from the docs:

curl -s https://api.anthropic.com/v1/dreams \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21" \
  -H "content-type: application/json" \
  -d '{
    "inputs": [
      {"type": "memory_store", "memory_store_id": "memstore_..."},
      {"type": "sessions", "session_ids": ["sesn_a", "sesn_b"]}
    ],
    "model": "claude-opus-4-7",
    "instructions": "Focus on coding-style preferences; ignore one-off debugging notes."
  }'

If you only have session transcripts and no existing memory store, the docs recommend creating an empty store first and passing that as the memory_store input.

What changes in the memory file before vs. after a dream?

The most concrete way to verify a dream did real work is to diff the input memory store against the output memory store at the file level. Both are text-document stores, so a per-file diff tells you exactly what was merged, removed, or rewritten.

Suggested first-run diff procedure (this is the artifact a dev should ship in their write-up):

  1. List input files: ant beta:memory-stores:memories list --memory-store-id $input_store --order-by path --depth 5

  2. List output files: same command against the output store ID returned in outputs[]

  3. Pull each file body with memories.retrieve, save to local /tmp/before/ and /tmp/after/ directories

  4. Diff the trees: diff -r /tmp/before/ /tmp/after/

What changes you'll typically see, based on the documented behavior:

Change type

Example before

Example after

Duplicate merge

/preferences/style.md and /notes/style-pref.md both saying "use 2-space indent"

One canonical /preferences/code-style.md with the rule + provenance

Stale entry replacement

/projects/api/db.md saying "use Postgres 14"

Same path updated to "use Postgres 16" if a later session corrected it

Pattern surfacing

Three sessions independently building Express middleware

New /patterns/express-middleware.md describing the recurring shape

Contradiction resolution

One file saying "tabs", another saying "spaces"

Latest-wins value with the older one logged in version history

Every write also produces a memory version (memver_...) that's retained for at least 30 days, giving you a full audit trail of who changed what and when. That's the layer to inspect if a dream produces output you don't expect.

What does it cost, and what plan do I need?

Dreaming bills at standard API token rates for whichever supported model the dream runs on, and cost scales roughly linearly with the number and length of input sessions. There's no separate "dreaming surcharge", the usage field on the returned dream resource reports exact input_tokens, output_tokens, cache_creation_input_tokens, and cache_read_input_tokens totals.

Plan-level notes worth being precise about:

  • Pro and Max consumer plans got their Claude Code usage allotment doubled to roughly 10 weekly hours on May 6, 2026, per Anthropic's higher-limits announcement. This is unrelated to dreaming itself but matters for sustained agent work feeding sessions into a dream.

  • Dreaming requires API access, meaning a workspace on the Claude Platform with billing enabled. A Pro or Max consumer subscription alone does not grant access to the API; you need separate API credits. This is the most common gating mistake.

  • Default rate limits apply to dream creation while the feature is in beta. Anthropic support is the documented escalation path for higher limits.

Practical cost-control tips:

  • Start with two or three sessions per dream while you're calibrating. The docs explicitly recommend this.

  • Keep instructions tight (under the 4,096-character cap), it shapes what the model considers worth keeping.

  • Use Sonnet 4.6 for cheaper iteration; switch to Opus 4.7 only when curation quality matters.

  • Archive old dreams once you've verified the output. Archived dreams stay readable by ID but are excluded from default list responses.

What NOT to expect from dreaming

Dreaming is memory curation, not model self-improvement. Saying that out loud avoids the most common misread of the feature.

  • It does not update model weights. Claude doesn't get smarter at generic tasks because you ran a dream. It just has cleaner notes the next time you attach the output store to a session.

  • It does not generalize across unrelated tasks. A dream over your Express middleware sessions doesn't help an agent that next session is editing a Terraform repo unless you also attach the relevant store.

  • It is not AGI overnight. The framing in coverage like SiliconANGLE's "Anthropic is letting Claude agents 'dream' so they don't sleep on the job" is catchy, but the docs are honest about the scope: deduplicate, reorganize, surface patterns.

  • It does not run automatically by default. You schedule it. There's no "Claude is dreaming right now" badge in your account; if you don't POST /v1/dreams, nothing dreams.

  • It is not in Claude Code's stable CLI yet. Tools like the claude CLI integrate with sessions and memory through the Managed Agents API, but a one-flag claude dream invocation is not in the documented commands as of May 8, 2026.

  • It cannot fix a poisoned input store. If your sessions wrote bad memories (prompt-injection content, contradicted facts the dream can't disambiguate), the output is downstream of that. Use read_only on stores that touch untrusted input.

The Anthropic docs explicitly warn about prompt-injection risk for read_write stores: a successful injection writes malicious content into the store, and "later sessions then read that content as trusted memory." A dream over a poisoned store is not a remediation step.

Real first-hand artifact: what to ship in your own write-up

If you're publishing your own dreaming walkthrough, the credible artifact is this triple:

  1. Screenshot of the access-approval email with the date, redacting your account ID. This proves you actually got into the research preview.

  2. A diff -r output of input vs. output memory stores after one real dream cycle, even five files of changes is enough to prove the pipeline ran end-to-end.

  3. The usage block from the completed dream resource: input_tokens, output_tokens, and elapsed time from created_at to ended_at. Real numbers beat speculation.

We're documenting our own setup as access rolls out and will update this article with the diff once the dream completes against a real Vantaige memory store.

FAQ

When was Claude dreaming announced?

Anthropic announced dreaming at the Code with Claude developer conference in San Francisco on May 6, 2026. The same announcement included memory, multi-agent orchestration, and outcomes (a grading system) entering public beta, plus doubled Claude Code usage limits for Pro and Max subscribers and the SpaceX compute partnership. Simon Willison's live blog of the event is the most thorough third-party recap. Dreaming itself is the only one of those four still in research preview.

Is dreaming the same as Claude Code overnight learning?

The mechanism is closer to overnight curation than overnight learning. Model weights are not updated; what changes is a curated text memory store the agent reads on its next session. Press coverage often calls it "overnight learning" or "dreaming so agents don't sleep on the job," but the docs are explicit: dreams "review past sessions and memory stores, extract patterns, and curate memories." That distinction matters for setting realistic expectations with stakeholders.

What models can run a dream?

During the research preview, only claude-opus-4-7 and claude-sonnet-4-6 are listed as supported models for the dreaming pipeline. Sonnet 4.6 is cheaper per token and a reasonable default while you calibrate; Opus 4.7 produces more thorough curation when stakes are higher. The model is selected per-dream, so you can mix usage in the same workspace. Anthropic has not announced when other models or older snapshots will be allowed.

Does dreaming work with the Claude Code CLI directly?

Not as a built-in command in stable releases as of May 8, 2026. Dreaming is exposed through the Managed Agents API and SDKs (Python, TypeScript, plus the ant CLI). Claude Code agents that read and write memory stores benefit from a dream's output store the next time it's attached to a session, but you trigger the dream itself outside the claude CLI. Watch the official Claude Code release notes for any change.

How long does a single dream take to run?

The docs state dreams "typically take minutes to tens of minutes depending on input size." Cost and runtime scale with the number and length of input sessions, capped at 100 sessions per dream. If you exceed the pipeline's runtime budget, the dream fails with error.type: "timeout" and the output memory store is left with whatever was written before the failure, useful for partial recovery, less useful for production scheduling without retry logic.

Will dreaming work for my Pro or Max subscription, or do I need API access?

You need separate API access on the Claude Platform with billing enabled. Pro and Max consumer subscriptions cover Claude Code's session usage but do not by themselves grant access to the Managed Agents API or dreaming. If you've requested access via the research-preview form and your API workspace is approved, dreaming is billed at standard token rates against your API balance, not against Pro/Max session hours.

References

  1. Anthropic, "New in Claude Managed Agents: dreaming, outcomes, and multiagent orchestration", https://claude.com/blog/new-in-claude-managed-agents

  2. Anthropic, "Dreams" (Claude API Docs), https://platform.claude.com/docs/en/managed-agents/dreams

  3. Anthropic, "Using agent memory" (Claude API Docs), https://platform.claude.com/docs/en/managed-agents/memory

  4. Anthropic, "Higher limits, more compute, and SpaceX partnership", https://www.anthropic.com/news/higher-limits-spacex

  5. Simon Willison, "Code w/ Claude 2026" live blog (May 6, 2026), https://simonwillison.net/2026/May/6/code-w-claude-2026/

  6. SiliconANGLE, "Anthropic is letting Claude agents 'dream' so they don't sleep on the job", https://siliconangle.com/2026/05/06/anthropic-letting-claude-agents-dream-dont-sleep-job/

  7. Managed Agents access request form, https://claude.com/form/claude-managed-agents

Get the best new AI tools and guides, weekly

One short email a week. The tools worth trying, the guides worth reading, nothing else.

No spam. Unsubscribe anytime.

A

Aymen B

Contributing writer at Vantaige, covering the AI tools ecosystem.