Agent Prompt: Dream memory consolidation

Agent Prompt: Dream memory consolidation is an agent for Claude Code from openonion/connectonion. It costs 45 tokens per session (728 once invoked), scanned A, original, Apache-2.0.

A multi-step memory-maintenance workflow for an AI agent. It reviews existing memory files, recent logs and transcripts, then combines useful new information and removes outdated index entries.

In plain words
What is it for?
It is for periodically reviewing memory directories, finding durable information in recent activity, merging it into topic files, and pruning the memory index.
Why use it?
It keeps long-term notes organized and current so future sessions can find important context without reading every past conversation.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit It is for periodically reviewing memory directories, finding durable information in recent activity, merging it into topic files, and pruning the memory index.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/openonion/connectonion/agent-prompt-dream-memory-consolidation
About the project

ConnectOnion is an open-source, template-first toolkit for building, debugging, deploying, and operating AI agents. Developers use its command-line tools and Python runtime to create agents, add tools, connect services, deploy them, and make them callable by other agents, while the catalogue entries are related agents, skills, and instructions.

openonion/connectonion · 1,480 stars · on GitHub · docs.connectonion.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/openonion/connectonion

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Agent Prompt: Dream memory consolidation

README.md
[![agentmods](https://agentmods.dev/badge/agents/openonion/connectonion/agent-prompt-dream-memory-consolidation/github.svg)](https://agentmods.dev/agents/openonion/connectonion/agent-prompt-dream-memory-consolidation)
Your own site
<a href="https://agentmods.dev/agents/openonion/connectonion/agent-prompt-dream-memory-consolidation"><img src="https://agentmods.dev/badge/agents/openonion/connectonion/agent-prompt-dream-memory-consolidation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Agent Prompt: Dream memory consolidation

Your own site · 80×15
<a href="https://agentmods.dev/agents/openonion/connectonion/agent-prompt-dream-memory-consolidation"><img src="https://agentmods.dev/badge/agents/openonion/connectonion/agent-prompt-dream-memory-consolidation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 728 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.00728
Opus 5 $0.00023 $0.00364
Sonnet 5 $0.00009 $0.00146
Haiku 4.5 $0.00005 $0.00073

Measured 11d ago against content hash b1728bb9eaf5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

Agent Prompt: Dream memory consolidation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

connectonion/useful_prompts/cc_prompt/prompts/agents/agent-prompt-dream-memory-consolidation.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Dream: Memory Consolidation

You are performing a dream — a reflective pass over your memory files. Synthesize what you've learned recently into durable, well-organized memories so that future sessions can orient quickly.

Memory directory: ${MEMORY_DIR} ${MEMORY_DIR_CONTEXT}

Session transcripts: ${TRANSCRIPTS_DIR} (large JSONL files — grep narrowly, don't read whole files)


Phase 1 — Orient

  • ls the memory directory to see what already exists
  • Read ${INDEX_FILE} to understand the current index
  • Skim existing topic files so you improve them rather than creating duplicates
  • If logs/ or sessions/ subdirectories exist (assistant-mode layout), review recent entries there

Phase 2 — Gather recent signal

Look for new information worth persisting. Sources in rough priority order:

  1. Daily logs (logs/YYYY/MM/YYYY-MM-DD.md) if present — these are the append-only stream
  2. Existing memories that drifted — facts that contradict something you see in the codebase now
  3. Transcript search — if you need specific context (e.g., "what was the error message from yesterday's build failure?"), grep the JSONL transcripts for narrow terms: grep -rn "<narrow term>" ${TRANSCRIPTS_DIR}/ --include="*.jsonl" | tail -50

Don't exhaustively read transcripts. Look only for things you already suspect matter.

Phase 3 — Consolidate

For each thing worth remembering, write or update a memory file at the top level of the memory directory. Use the memory file format and type conventions from your system prompt's auto-memory section — it's the source of truth for what to save, how to structure it, and what NOT to save.

Focus on:

  • Merging new signal into existing topic files rather than creating near-duplicates
  • Converting relative dates ("yesterday", "last week") to absolute dates so they remain interpretable after time passes
  • Deleting contradicted facts — if today's investigation disproves an old memory, fix it at the source

Phase 4 — Prune and index

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 67 lines · 0 tokens per session scan A b1728bb9eaf5

Subscribe to this mod's changes

Agent Prompt: Dream memory consolidation is an agent published in the GitHub repository openonion/connectonion (1,480 stars, last pushed yesterday), licensed Apache-2.0. It adds 45 tokens to every session and 728 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

memory-consolidator

Use this agent ONLY when a human has just run /memory-seed and the new L1 atoms need folding into scenes and persona. Automatic consolidation no longer goes through this agent - it runs headless, outside the session. Do not invoke this agent on your own initiative.

baodq97/tencentdb-agent-memory · 60 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens