드림(Dreams)

드림(Dreams)

에이전트는 작업하면서 메모리 스토어에 기록하지만, 그 기록은 로컬·점진적이에요. 그래서 여러 세션을 거치며 메모리 스토어에 중복, 모순, 오래된 항목이 쌓이게 되죠. 드림은 클로드가 이것을 정리하게 해줘요. 드림은 기존 메모리 스토어를 과거 세션 기록과 함께 읽어, 중복을 병합하고 오래되거나 모순된 항목을 최신 값으로 바꾸며 새로운 통찰을 표면화한 재구성된 메모리 스토어를 만들어요. 입력 스토어는 절대 수정되지 않으니 결과가 마음에 안 들면 버려도 돼요.

출처: 문서

본문

Dreaming is a research preview feature. [Request access](https://claude.com/form/claude-managed-agents) to try it.

에이전트는 작업 과정에서 메모리 스토어에 기록하지만, 이 기록은 로컬이고 점진적이에요. 많은 세션을 거치면 메모리 스토어에 중복, 모순, 오래된 항목이 쌓여요.

Dreams는 클로드가 그것을 정리하게 해줘요. 드림은 기존 메모리 스토어와 과거 세션 기록을 함께 읽은 다음, 재구성된 새 메모리 스토어를 만들어요: 중복은 병합되고, 오래되거나 모순된 항목은 최신 값으로 바뀌며, 새 통찰이 드러나죠.

입력 스토어는 절대 수정되지 않으므로, 출력을 검토하고 마음에 안 들면 버릴 수 있어요.

Dream endpoints are gated by the `dreaming-2026-04-21` beta header; the `managed-agents-2026-04-01` header on its own doesn't grant access to dreams. The dream-endpoint examples on this page send both headers; session and memory-store calls need only `managed-agents-2026-04-01`. The SDK sets these automatically.

How it works

dream은 다음을 받는 비동기 작업이에요:

  • a pre-existing memory store: the store Claude verifies, deduplicates, and reorganizes, and
  • 1 to 100 sessions: past transcripts Claude mines for patterns and insights to fold into the output.

드림은 입력과 분리된 또 하나의 출력 메모리 스토어를 만들어요. 출력 스토어 ID는 워크플로가 입력 스토어를 복제하고 나면 드림이 running을 시작한 직후 outputs[]에 나타나요. running 드림은 잠시 빈 outputs[]를 보고할 수 있어요.

Create a dream

```bash cURL curl -s https://api.anthropic.com/v1/dreams \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21" \ -H "content-type: application/json" \ --data @- <ant beta:dreams create <<YAML inputs: - type: memory_store memory_store_id: $store_id - type: sessions session_ids: [$session_a, $session_b] model: claude-opus-4-8 instructions: Focus on coding-style preferences; ignore one-off debugging notes. YAML
dream = client.beta.dreams.create(
    inputs=[
        {"type": "memory_store", "memory_store_id": store_id},
        {"type": "sessions", "session_ids": [session_a, session_b]},
    ],
    model="claude-opus-4-8",
    instructions="Focus on coding-style preferences; ignore one-off debugging notes.",
)
print(dream.id)  # drm_01...
let dream = await client.beta.dreams.create({
  inputs: [
    { type: "memory_store", memory_store_id: storeId },
    { type: "sessions", session_ids: [sessionA, sessionB] },
  ],
  model: "claude-opus-4-8",
  instructions: "Focus on coding-style preferences; ignore one-off debugging notes.",
});
console.log(dream.id); // drm_01...
var dream = await client.Beta.Dreams.Create(new()
{
    Inputs =
    [
        new BetaDreamMemoryStoreInput
        {
            Type = BetaDreamMemoryStoreInputType.MemoryStore,
            MemoryStoreID = storeID,
        },
        new BetaDreamSessionsInput
        {
            Type = BetaDreamSessionsInputType.Sessions,
            SessionIds = [sessionA, sessionB],
        },
    ],
    Model = "claude-opus-4-8",
    Instructions = "Focus on coding-style preferences; ignore one-off debugging notes.",
});
Console.WriteLine(dream.ID);  // drm_01...
dream, err := client.Beta.Dreams.New(ctx, anthropic.BetaDreamNewParams{
	Inputs: []anthropic.BetaDreamInputUnionParam{
		anthropic.BetaDreamInputParamOfMemoryStore(storeID),
		anthropic.BetaDreamInputParamOfSessions([]string{sessionA, sessionB}),
	},
	Model: anthropic.BetaDreamModelParamsUnion{
		OfString: anthropic.String("claude-opus-4-8"),
	},
	Instructions: anthropic.String("Focus on coding-style preferences; ignore one-off debugging notes."),
})
if err != nil {
	panic(err)
}
fmt.Println(dream.ID) // drm_01...
var dream = client.beta().dreams().create(
    DreamCreateParams.builder()
        .addMemoryStoreInput(storeId)
        .addSessionsInput(List.of(sessionA, sessionB))
        .model("claude-opus-4-8")
        .instructions("Focus on coding-style preferences; ignore one-off debugging notes.")
        .build()
);
IO.println(dream.id());  // drm_01...
$dream = $client->beta->dreams->create(
    inputs: [
        ['type' => 'memory_store', 'memory_store_id' => $storeId],
        ['type' => 'sessions', 'session_ids' => [$sessionA, $sessionB]],
    ],
    model: 'claude-opus-4-8',
    instructions: 'Focus on coding-style preferences; ignore one-off debugging notes.',
);
echo "{$dream->id}\n"; // drm_01...
dream = client.beta.dreams.create(
  inputs: [
    {type: "memory_store", memory_store_id: store_id},
    {type: "sessions", session_ids: [session_a, session_b]}
  ],
  model: "claude-opus-4-8",
  instructions: "Focus on coding-style preferences; ignore one-off debugging notes."
)
puts dream.id # drm_01...

드리밍 입력에는 기존 메모리 스토어와 세션 배열이 포함돼요. 선택한 모델이 드리밍 파이프라인을 실행해요. 리서치 프리뷰 기간에는 claude-opus-5, claude-fable-5, claude-opus-4-8, claude-opus-4-7, claude-sonnet-5, claude-sonnet-4-6이 지원돼요. 드리밍 과정을 조종하려면 선택적으로 instructions를 전달할 수 있어요. 자세한 내용은 Steer with instructions를 참고하세요.

응답은 status: "pending"인 전체 dream 리소스예요:

{
  "type": "dream",
  "id": "drm_01AbCDefGhIjKlMnOpQrStUv",
  "status": "pending",
  "inputs": [
    { "type": "memory_store", "memory_store_id": "memstore_01Hx..." },
    { "type": "sessions", "session_ids": ["sesn_01...", "sesn_02..."] }
  ],
  "outputs": [],
  "model": { "id": "claude-opus-4-8" },
  "instructions": "Focus on coding-style preferences; ignore one-off debugging notes.",
  "session_id": null,
  "created_at": "2026-04-29T17:04:10Z",
  "ended_at": null,
  "archived_at": null,
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "cache_read_input_tokens": 0,
    "cache_creation_input_tokens": 0
  },
  "error": null
}
If you only have session transcripts and no existing store, [create an empty memory store](https://platform.claude.com/docs/en/managed-agents/memory#create-a-memory-store) first and pass it as the `memory_store` input.

Steer with instructions

선택적 instructions 필드는 드리밍 파이프라인이 무엇을 종합하는지 조종해요. 파이프라인 전반에 걸쳐 적용돼요: 무엇을 자세히 읽을지, 무엇을 병합하거나 버릴지, 출력 스토어를 어떻게 구성할지요.

초점 영역("코딩 스타일 선호에 집중"), 변경하지 않고 보존할 내용, 스토어 전체에 적용할 출력 규칙 같은 고수준 합성 지침에 instructions를 사용하세요. 파이프라인은 입력에 대한 합성 패스이지 스토어 텍스트에 적용되는 편집기가 아니므로, 특정 줄을 겨냥한 명령형 지시("문장 X를 Y로 바꿔", "섹션 Z의 수를 고쳐")는 일반적으로 변화를 만들지 않아요. 개별 메모리에 타겟 편집을 하려면 출력 스토어에 Memory Stores API를 직접 사용하세요.

Track progress

드림은 비동기로 실행되며, 입력 기록 수에 따라 보통 몇 분에서 몇 시간이 걸려요. 상태를 확인하려면 ID로 드림을 폴링하세요:

```bash cURL while true; do dream=$(curl -s "https://api.anthropic.com/v1/dreams/$dream_id" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21") status=$(jq -r '.status' <<< "$dream") echo "status=$status input_tokens=$(jq -r '.usage.input_tokens' <<< "$dream")" [[ "$status" == "pending" || "$status" == "running" ]] || break sleep 10 done ```
ant beta:dreams retrieve --dream-id "$dream_id"
while dream.status in ("pending", "running"):
    time.sleep(10)
    dream = client.beta.dreams.retrieve(dream.id)
    print(f"status={dream.status} input_tokens={dream.usage.input_tokens}")
while (dream.status === "pending" || dream.status === "running") {
  await sleep(10_000);
  dream = await client.beta.dreams.retrieve(dream.id);
  console.log(`status=${dream.status} input_tokens=${dream.usage.input_tokens}`);
}
while (dream.Status.Value() is BetaDreamStatus.Pending or BetaDreamStatus.Running)
{
    await Task.Delay(TimeSpan.FromSeconds(10));
    dream = await client.Beta.Dreams.Retrieve(dream.ID);
    Console.WriteLine($"status={dream.Status.Raw()} input_tokens={dream.Usage.InputTokens}");
}
for dream.Status == anthropic.BetaDreamStatusPending || dream.Status == anthropic.BetaDreamStatusRunning {
	time.Sleep(10 * time.Second)
	dream, err = client.Beta.Dreams.Get(ctx, dream.ID, anthropic.BetaDreamGetParams{})
	if err != nil {
		panic(err)
	}
	fmt.Printf("status=%s input_tokens=%d\n", dream.Status, dream.Usage.InputTokens)
}
while (dream.status().equals(BetaDreamStatus.PENDING)
        || dream.status().equals(BetaDreamStatus.RUNNING)) {
    Thread.sleep(10_000);
    dream = client.beta().dreams().retrieve(dream.id());
    IO.println("status=" + dream.status() + " input_tokens=" + dream.usage().inputTokens());
}
while (in_array($dream->status, [BetaDreamStatus::PENDING->value, BetaDreamStatus::RUNNING->value], true)) {
    sleep(10);
    $dream = $client->beta->dreams->retrieve($dream->id);
    echo "status={$dream->status} input_tokens={$dream->usage->inputTokens}\n";
}
while %i[pending running].include?(dream.status)
  sleep 10
  dream = client.beta.dreams.retrieve(dream.id)
  puts "status=#{dream.status} input_tokens=#{dream.usage.input_tokens}"
end

Lifecycle

status Meaning
pending Dream successfully created and queued.
running The pipeline is processing. usage updates as work progresses.
completed Finished successfully. The outputs[] value is the new memory store.
failed Dreaming run ended with an error. The output memory store is left as-is with whatever was written before failure.
canceled Dreaming run canceled. The output memory store is left as-is.

Watch the pipeline run

드림이 running이 되면 session_id 필드는 파이프라인을 실행하는 기본 세션을 가리켜요. 그 세션의 이벤트를 스트리밍해 드림이 무엇을 읽고 쓰는지 실시간으로 관찰할 수 있어요. 드림이 종료 상태에 도달하면 세션은 보관(삭제 아님)되므로 기록은 이후에도 계속 볼 수 있어요.

Use the output

statuscompleted에 도달하면 outputs[]memory_store 항목이 완전히 채워진 스토어를 참조해요. 그것은 워크스페이스의 평범한 메모리 스토어이에요. Memory Stores API나 Console에서 검토한 다음 다음 중 하나를 하세요:

```bash cURL # After the dream ends, the memory_store output holds the rebuilt store output_store_id=$(jq -r 'first(.outputs[] | select(.type == "memory_store")).memory_store_id' <<< "$dream")

curl -s https://api.anthropic.com/v1/sessions
-H "x-api-key: $ANTHR...KEY"
-H "anthropic-version: 2023-06-01"
-H "anthropic-beta: managed-agents-2026-04-01"
-H "content-type: application/json"
--data @- <<EOF { "agent": "$agent_id", "environment_id": "$environment_id", "resources": [ { "type": "memory_store", "memory_store_id": "$output_store_id" } ] } EOF


```bash CLI
output_store_id=$(ant beta:dreams retrieve --dream-id "$dream_id" --format json |
  jq -r 'first(.outputs[] | select(.type == "memory_store")).memory_store_id')

ant beta:sessions create <<YAML
agent: $agent_id
environment_id: $environment_id
resources:
  - type: memory_store
    memory_store_id: $output_store_id
YAML
# After the dream ends, the output holds the rebuilt memory store
output_store_id = next(
    output.memory_store_id for output in dream.outputs if output.type == "memory_store"
)

session = client.beta.sessions.create(
    agent=agent_id,
    environment_id=environment_id,
    resources=[
        {"type": "memory_store", "memory_store_id": output_store_id},
    ],
)
// After the dream ends, the output holds the rebuilt memory store
const output = dream.outputs.find((entry) => entry.type === "memory_store");
const outputStoreId = output!.memory_store_id;

await client.beta.sessions.create({
  agent: agentId,
  environment_id: environmentId,
  resources: [
    { type: "memory_store", memory_store_id: outputStoreId },
  ],
});
var output = dream.Outputs.FirstOrDefault(entry => entry.Type == "memory_store");
if (output is { MemoryStoreID: var outputStoreID })
{
    await client.Beta.Sessions.Create(new()
    {
        Agent = agentID,
        EnvironmentID = environmentID,
        Resources =
        [
            new BetaManagedAgentsMemoryStoreResourceParam
            {
                Type = BetaManagedAgentsMemoryStoreResourceParamType.MemoryStore,
                MemoryStoreID = outputStoreID,
            },
        ],
    });
}
for _, output := range dream.Outputs {
	if output.Type != "memory_store" {
		continue
	}
	outputStoreID := output.MemoryStoreID

	session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{
		Agent: anthropic.BetaSessionNewParamsAgentUnion{
			OfString: anthropic.String(agentID),
		},
		EnvironmentID: environmentID,
		Resources: []anthropic.BetaSessionNewParamsResourceUnion{{
			OfMemoryStore: &anthropic.BetaManagedAgentsMemoryStoreResourceParam{
				MemoryStoreID: outputStoreID,
			},
		}},
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(session.ID)
	break
}
var output = dream.outputs().stream()
    .filter(entry -> entry.type().equals(BetaDreamOutput.Type.MEMORY_STORE))
    .findFirst();
if (output.isPresent()) {
    var outputStoreId = output.get().memoryStoreId();

    var session = client.beta().sessions().create(
        SessionCreateParams.builder()
            .agent(agentId)
            .environmentId(environmentId)
            .addMemoryStoreResource(outputStoreId)
            .build()
    );
}
$matches = array_filter($dream->outputs, fn($output) => $output->type === 'memory_store');
$output = $matches ? reset($matches) : null;
if ($output !== null) {
    $session = $client->beta->sessions->create(
        agent: $agentId,
        environmentID: $environmentId,
        resources: [
            ['type' => 'memory_store', 'memory_store_id' => $output->memoryStoreID],
        ],
    );
}
output = dream.outputs.find { it.type == :memory_store }
if output
  client.beta.sessions.create(
    agent: agent_id,
    environment_id: environment_id,
    resources: [
      {type: "memory_store", memory_store_id: output.memory_store_id}
    ]
  )
end

드림 자체는 입력을 삭제하거나 수정하지 않아요. failedcanceled 시 출력 스토어는 멈추기 전에 만들어진 부분 내용으로 유지되므로 무엇이 만들어졌는지 검사할 수 있어요. 필요 없다면 Memory Stores API로 정리하세요.

While a dream is `pending` or `running`, the 400 guard applies to archiving the dream itself, not its stores. Archiving or deleting an *input* memory store mid-run (or deleting an input session) will cause the dream to fail with `input_memory_store_unavailable` or `input_session_unavailable`.

Cancel a dream

Cancel은 pending 또는 running 드림을 즉시 canceled로 옮겨요. 이미 canceled인 드림을 취소하는 것은 멱등한 no-op이에요. completedfailed 드림을 취소하면 400이 반환돼요.

After cancellation, the dream's `usage` fields might continue to update for a few seconds while in-flight work winds down. Poll the dream until `usage` stabilizes if you need the final count. ```bash cURL curl -s -X POST "https://api.anthropic.com/v1/dreams/$dream_id/cancel" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21" ```
ant beta:dreams cancel --dream-id "$dream_id"
client.beta.dreams.cancel(dream.id)
await client.beta.dreams.cancel(dream.id);
await client.Beta.Dreams.Cancel(dream.ID);
dream, err = client.Beta.Dreams.Cancel(ctx, dream.ID, anthropic.BetaDreamCancelParams{})
if err != nil {
	panic(err)
}
client.beta().dreams().cancel(dream.id());
$client->beta->dreams->cancel($dream->id);
client.beta.dreams.cancel(dream.id)

Archive a dream

보관은 종료 상태(completed, failed, canceled)에 도달한 드림에 archived_at을 설정해요. status는 그대로 둬요. 보관된 드림은 기본 목록 응답에서 제외되지만 ID로는 계속 읽을 수 있어요. 이미 보관된 드림을 보관하는 것은 멱등한 no-op이에요. pending이나 running 드림을 보관하면 400이 반환돼요. 먼저 취소하세요. 보관 해제는 없어요.

```bash cURL curl -s -X POST "https://api.anthropic.com/v1/dreams/$dream_id/archive" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21" ```
ant beta:dreams archive --dream-id "$dream_id"
client.beta.dreams.archive(dream.id)
await client.beta.dreams.archive(dream.id);
await client.Beta.Dreams.Archive(dream.ID);
dream, err = client.Beta.Dreams.Archive(ctx, dream.ID, anthropic.BetaDreamArchiveParams{})
if err != nil {
	panic(err)
}
client.beta().dreams().archive(dream.id());
$client->beta->dreams->archive($dream->id);
client.beta.dreams.archive(dream.id)

드림을 보관해도 출력 메모리 스토어에는 영향이 없어요. 그것은 Memory Stores API를 통해 별도로 관리하세요.

List dreams

워크스페이스의 보관되지 않은 모든 드림을 최신순으로 반환해요. 페이지를 나누려면 limit(기본 20, 최대 100)과 page 커서를 사용하세요. 보관된 드림을 포함하려면 include_archived=true를 전달하세요.

```bash cURL curl -s "https://api.anthropic.com/v1/dreams?limit=20" \ -H "x-api-key: $ANTHR...KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21" ```
ant beta:dreams list --limit 20
for listed_dream in client.beta.dreams.list(limit=20):
    print(listed_dream.id, listed_dream.status)
for await (const listedDream of client.beta.dreams.list({ limit: 20 })) {
  console.log(listedDream.id, listedDream.status);
}
var page = await client.Beta.Dreams.List(new() { Limit = 20 });
await foreach (var listed in page.Paginate())
{
    Console.WriteLine($"{listed.ID} {listed.Status.Raw()}");
}
dreams := client.Beta.Dreams.ListAutoPaging(ctx, anthropic.BetaDreamListParams{
	Limit: anthropic.Int(20),
})
for dreams.Next() {
	listed := dreams.Current()
	fmt.Println(listed.ID, listed.Status)
}
if err := dreams.Err(); err != nil {
	panic(err)
}
for (var listedDream : client.beta().dreams().list(
    DreamListParams.builder().limit(20).build()
).autoPager()) {
    IO.println(listedDream.id() + " " + listedDream.status());
}
foreach ($client->beta->dreams->list(limit: 20)->pagingEachItem() as $dream) {
    echo "{$dream->id} {$dream->status}\n";
}
client.beta.dreams.list(limit: 20).auto_paging_each do
  puts "#{it.id} #{it.status}"
end

Errors

가능한 드리밍 오류의 전체 목록이 아닌 일부를 아래에 정리했어요.

error.type When
timeout The pipeline exceeded its runtime budget.
internal_error Unclassified pipeline failure.
memory_store_org_limit_exceeded Your organization hit its memory-store cap while the pipeline was provisioning working storage.
input_memory_store_too_large The input memory store exceeds the pipeline's size limit.
input_memory_store_unavailable The input memory store was archived or deleted after the dream was created.
input_session_unavailable An input session was deleted after the dream was created.

Billing

드림은 선택한 모델의 표준 API 토큰 요율로 청구되며, 리소스의 usage가 정확한 합계를 보고해요. 비용은 입력 세션의 수와 길이에 거의 선형적으로 비례해요. 작은 세션 묶음으로 시작하고, 큐레이션 품질에 만족하면 확장하세요.

Limits

Limit Value
Sessions per dream 100
instructions length 4,096 characters
Supported models claude-opus-5, claude-fable-5, claude-opus-4-8, claude-opus-4-7, claude-sonnet-5, claude-sonnet-4-6

이 기능이 리서치 프리뷰인 동안 드림 생성에는 기본 속도 제한이 적용돼요. 더 높은 한도가 필요하면 Contact support하세요.

더 알아보기 (Learn more)