agent-dream
Nightly memory consolidation and self-reflection for OpenClaw agents. Your agent dreams — reviewing sessions, organizing memories, pruning stale info, and reflecting on its own behavior. Works with any OpenClaw agent. Features: 5-phase dream cycle, safe 2-pass deletion, automatic backup, change gates (>50% blocked), gate check (24h + 5 sessions), growth notifications, old memory resurface, zero-config setup. Inspired by Claude Code Dream but open-source with real self-awareness. Use when: dream, memory, consolidation, self-reflection, agent identity, persistent memory, long-term memory, memory organization, nightly cleanup, memory management.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ahaaiclub/agent-dreamAgent Dream 🌙
Your agent forgets everything between sessions. This fixes that.
What This Does
Your agent periodically enters a "dream" state where it:
- Consolidates scattered daily notes into organized long-term memory
- Prunes stale information (safely — never deletes on first pass)
- Reflects on its own behavior, mistakes, and relationship with you
- Wakes up with a notification showing what changed and what it's thinking about
This is different from other memory skills. Those organize files. This one builds self-awareness.
First-Time Setup
When this skill is first installed, run setup to auto-detect your workspace:
node {baseDir}/scripts/setup.js
Setup will:
- Scan your workspace for MEMORY.md, SOUL.md, memory/, sessions/
- Detect your agent ID and session path automatically
- Save config to
{baseDir}/assets/dream-config.json - Report what it found and what's missing
Then configure a cron job (recommended: daily, off-peak hours):
name: "agent-dream"
schedule: { kind: "cron", expr: "0 3 * * *", tz: "<your timezone>" }
payload: {
kind: "agentTurn",
message: "Time to dream. Read your openclaw-dream skill and follow every step.",
timeoutSeconds: 900
}
sessionTarget: "isolated"
The One Question
On the first dream run, the agent will ask you one question:
"Dream will update your MEMORY.md during consolidation. Allow this?"
- Yes → Dream can update MEMORY.md (with safety rails — see below)
- No → Dream only writes to
memory/dreams/and leaves MEMORY.md untouched
This is saved in config. You won't be asked again. Change it anytime in dream-config.json.
Dream Cycle (what the agent does each run)
Gate Check
Before dreaming, verify conditions are met:
- Read
{dreamsDir}/.dream-lock(Unix timestamp of last dream, or "0" if first) - If < 24 hours since last dream → skip (but still send a notification — see Completion)
- Count
.jsonlsession files modified since last dream - If < 1 session → skip (but still send a notification)
- Gate passed → write current timestamp to
.dream-lock(save previous to.dream-lock.prevfor rollback) - Backup: Copy MEMORY.md to
MEMORY.md.pre-dreambefore any changes. Also back up any topic files (inmemory/projects/,memory/people/, etc.) that you plan to modify — copy each to<filename>.pre-dreamin the same directory.
Phase 1 — Orient
- Read
dream-config.jsonfrom{baseDir}/assets/for all paths - Read MEMORY.md to understand current long-term memory
- Skim existing topic files (memory/projects/, memory/people/, etc.) to avoid duplicates
- Read most recent dream record from
{dreamsDir}/to see what last dream concluded - Read SOUL.md — confirm core identity, note anything outdated
Phase 2 — Gather Recent Signal
Sources in priority order:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ahaaiclub-agent-dream": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
openclaw-spirits
Companion spirit system for OpenClaw agents. Every user gets a unique spirit creature — deterministically generated from their identity (24 species, 5 rarities from Common to Mythic 2%). Spirits have personality, elemental affinity, and evolve with interactions. Features: deterministic generation (same user always gets same spirit), rarity system, personality traits, interaction tracking, visual generation prompts. Use when: spirit, companion, pet, 灵兽, summon, familiar, creature, virtual pet, agent companion, gamification, engagement.
knowyourself
Visual identity discovery for AI agents — not an avatar generator, but a self-reflection system that creates a face from your agent's personality, memory, and relationship with its human. Quick mode: 5 minutes. Full mode: 5-phase deep identity discovery with batch generation and professional three-axis evaluation. Works with any image generation tool (DALL-E, Flux, Midjourney, Stable Diffusion). The face comes from the inside out, not from a prompt template. Use when: agent visual identity, avatar, self-portrait, agent face, agent image, identity discovery, profile picture, agent appearance, character design, AI identity, visual persona.