dream

A memory cleanup skill that combines duplicate stored memories, flags conflicting information, and removes outdated entries according to retention rules. It shows proposed changes for approval before modifying anything.

In plain words
What is it for?
Use it when stored memories have grown large, searches are repetitive, or a periodic cleanup is needed.
Why use it?
It reduces noisy or repetitive memory results while keeping the user in control of deletions and other changes.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/mem0ai/mem0/dream
Any agent
npx skills add mem0ai/mem0 --skill dream
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,900 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 88% copy Near-identical to another mod 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 $0.00043 $0.01900
Opus 5 $0.00022 $0.00950
Sonnet 5 $0.00009 $0.00380
Haiku 4.5 $0.00004 $0.00190

Measured yesterday against content hash 3ced9e646633, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dream 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 yesterday.

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.

Origin

This is a copy

88% identical to mem0-dream — 31 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

integrations/mem0-plugin/skills/dream/SKILL.md · 233 lines

How it starts

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

Mem0 Dream — Memory Consolidation

This skill performs a memory consolidation pass: it fetches all project memories, identifies near-duplicates, flags contradictions, and prunes stale entries based on configured retention policies. All proposed changes are shown as a diff for user approval before anything is modified.

IMPORTANT: Execute steps strictly in order (1 → 2 → 3 → 4 → 5 → 6). Each step depends on the previous one. Do NOT run steps in parallel or skip ahead.

Step 1: Load Retention Policies

Determine the active retention policy by running the parser script. Use the appropriate PLUGIN_ROOT variable for the current platform (${CLAUDE_PLUGIN_ROOT}, ${CODEX_PLUGIN_ROOT}, or ${CURSOR_PLUGIN_ROOT}):

python3 "<PLUGIN_ROOT>/scripts/parse_mem0_config.py" "<cwd>"

Parse the JSON output (a dict of category → days | null). If the script fails or returns {}, fall back to these built-in defaults:

metadata.type Default retention
session_state 90 days
compact_summary 90 days
all others no pruning

Store the resolved policies for use in Step 3.


Step 2: Fetch ALL Project Memories

Call get_memories to retrieve every memory for the active project:

get_memories(
    filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<active_project_id>"}]},
    page_size=200,
)

If the response indicates more pages exist, paginate until all memories are fetched. Collect the full list before proceeding. If zero memories are found, print:

No memories found for project <project_id>. Nothing to consolidate.

…and stop.


Step 3: Analyze — Find Issues

Work entirely in-memory; do not modify anything yet.

Group memories by metadata.type (use "unknown" when the field is absent). For each group, identify the following:

3a. Near-duplicate pairs (merge candidates)

Two memories are near-duplicates when they express the same fact or decision but phrased differently (e.g., "Use PostgreSQL for auth" and "Auth DB is PostgreSQL").

Read the full file on GitHub · 233 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. yesterday First seen · 233 lines · 43 tokens per session scan A 3ced9e646633

Subscribe to this mod's changes

dream is a skill published in the GitHub repository mem0ai/mem0 (64,360 stars, last pushed 3d ago), licensed Apache-2.0. It adds 43 tokens to every session and 1,900 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 88% identical to mem0-dream, differing in 31 lines, and is treated as a copy.

Related

Other skills, from other repositories

mcp-apps-builder

MANDATORY for ALL MCP server work - mcp-use framework best practices and patterns. READ THIS FIRST before any MCP server work, including: Creating new MCP servers Modifying existing MCP servers (adding/updating tools, resources, prompts, widgets) Debugging MCP server issues or errors Reviewing MCP server code for…

Shubhamsaboo/awesome-llm-apps · 139 tokens

project-graveyard

Scans the developer's machine for dead side projects, autopsies each one from its git history (died at the payments wall, killed by a newer project, finished but never shipped), surfaces their personal death patterns, and picks the corpse most worth resurrecting — then helps ship it. Use when the user mentions…

Shubhamsaboo/awesome-llm-apps · 127 tokens

commit-archaeologist

Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite…

Shubhamsaboo/awesome-llm-apps · 82 tokens

dependency-doctor

Checks requirements.txt, pyproject.toml, and package.json dependency manifests for surface-level direct-dependency footguns: standard-library shadowing pins, abandoned backports, unpinned dependencies, and obvious intra-manifest conflicts, plus opt-in PyPI yanked releases. Use when the user asks to check a manifest…

Shubhamsaboo/awesome-llm-apps · 115 tokens

scope-creep-detector

Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, public API renames, config or CI edits, oversized hunks, and formatting-only files. Use when the user asks whether a change grew beyond the fix, a PR is too…

Shubhamsaboo/awesome-llm-apps · 98 tokens

chatgpt-app-builder

DEPRECATED: This skill has been replaced by mcp-app-builder. Check if mcp-app-builder is available in the skills folder. If not, install it: npx skills install mcp-use/mcp-use --skill mcp-app-builder Use mcp-app-builder instead of this skill. Build ChatGPT apps with interactive widgets using mcp-use and OpenAI Apps…

Shubhamsaboo/awesome-llm-apps · 129 tokens