Skip to content
Development
Skill

/auto-dream

Background memory consolidation — overnight review, merge, and injection payload for memory files.

From plugin
vexjoy-agent
44363 skills198 agents12 commands83 hooks

Claude Code

$ npx -y skills add notque/vexjoy-agent --skill auto-dream --agent claude-code

SKILL.md

auto-dream.SKILL.md
name: auto-dream
description: Background memory consolidation — overnight review, merge, and injection payload for memory files.
user-invocable: true
command: dream
context: fork
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - Bash
routing:
  triggers:
    - dream
    - consolidate memories
    - clean up memories
    - memory maintenance
    - memory consolidation
    - deduplicate memories
  category: meta-tooling
  pairs_with: []

Background memory consolidation cycle. Scans memory files, finds stale, duplicate, and conflicting entries, consolidates them, synthesizes cross-session insights, builds an injection-ready payload for the next session start, and writes a dated dream report.

When to invoke

  • User says "run dream", "consolidate memories", "clean up memories", "memory maintenance", "deduplicate memories"
  • Cron job at 2 AM nightly via wrapper script: `scripts/auto-dream-cron.sh --execute`
  • Manual trigger for testing: `./scripts/auto-dream-cron.sh` (dry-run by default)

Instructions

When invoked interactively (not via cron), read `skills/meta/auto-dream/dream-prompt.md` and execute its phases directly. The prompt is self-contained -- it describes the full cycle including safety constraints, file paths, and output formats.

For cron invocation: the dream prompt is passed directly to `claude -p` and runs as a standalone headless session with no CLAUDE.md, no hooks, no project context. All instructions are embedded in the prompt.

Phases

1. **SCAN** — Read all memory files and the recent git log. Write the scan document to `~/.claude/state/dream-scan-{date}.md`. 2. **ANALYZE** — Identify stale, duplicate, conflicting memories and cross-session patterns. Write analysis to `~/.claude/state/dream-analysis-{date}.md`. 3. **CONSOLIDATE** — Apply consolidation actions (max 5 changes). Archive stale/merged files, update MEMORY.md atomically. 4. **SYNTHESIZE** — Create insight memories from cross-session patterns (max 2 new memories per cycle). 5. **SELECT** — Build the injection-ready payload for session start. Write to `~/.claude/state/dream-injection-{project-hash}.md`. 6. **REPORT** — Write the dream summary to `~/.claude/state/last-dream.md`.

Safety constraints (always enforced)

  • Never delete files — archive to `memory/archive/`, never `rm`
  • Write the REPORT before executing any CONSOLIDATE filesystem operations
  • Maximum 5 memory changes per cycle — excess items deferred to next cycle
  • Flag conflicts for human review, never auto-resolve
  • Preserve YAML frontmatter when merging; use `merged_from` field for provenance
  • Memory files are the only write target. Knowledge reaches an agent or skill file through a reviewed human edit, never through this cycle.
  • In dry-run mode (the default), CONSOLIDATE and SYNTHESIZE describe proposed changes only — no filesystem writes. The wrapper script sets `DREAM_DRY_RUN_MODE=yes`, substituted into the prompt at runtime.

Testing

# Dry run (read-only, no filesystem changes — dry-run is the default)
./scripts/auto-dream-cron.sh

# Full run (execute consolidation)
./scripts/auto-dream-cron.sh --execute

# Check output
cat ~/.claude/state/last-dream.md

# Verify cron registration
python3 ~/.claude/scripts/crontab-manager.py list

Cost estimate

~0.18 USD per nightly run with 50 memory files (~20-30K input tokens at Opus 5.5 list price; the wrapper passes `--model opus`). ~66 USD/year for automated overnight operation. Budget capped at 3.00 USD/run via wrapper script.

Cron setup

Use `crontab-manager.py` (not raw `crontab -e`) to install. The wrapper script handles PATH, lockfile, logging, budget cap, and dry-run/execute toggle.

# Preview the cron entry
python3 ~/.claude/scripts/crontab-manager.py add \
  --tag "auto-dream" \
  --schedule "7 2 * * *" \
  --command "/home/feedgen/vexjoy-agent/scripts/auto-dream-cron.sh --execute >> /home/feedgen/vexjoy-agent/cron-logs/auto-dream/cron.log 2>&1" \
  --dry-run

# Install (after dry-run testing passes)
python3 ~/.claude/scripts/crontab-manager.py add \
  --tag "auto-dream" \
  --schedule "7 2 * * *" \
  --command "/home/feedgen/vexjoy-agent/scripts/auto-dream-cron.sh --execute >> /home/feedgen/vexjoy-agent/cron-logs/auto-dream/cron.log 2>&1"

# Verify
python3 ~/.claude/scripts/crontab-manager.py verify --tag auto-dream

Note: schedule uses 2:07 AM (off-minute) per cron best practice — avoids load spikes from jobs firing at :00.

Wrapper script details

`scripts/auto-dream-cron.sh` follows the established headless cron pattern (see `skills/content/content/scripts/reddit-moderate/reddit-automod-cron.sh`):

  • `flock` lockfile prevents concurrent runs
  • `--permission-mode auto` (never `--dangerously-skip-permissions`)
  • `--max-budget-usd 3.00` caps spend per run
  • `--no-session-persistence` for clean headless operation
  • `envsubst` templates `dream-prompt.md` with project-specific paths at runtime
  • `tee` to timestamped per-run log file
  • Dry-run by default, `--execute` for live runs
  • Exit code propagation via `PIPESTATUS[0]`

Deep References

Load when the task requires detailed guidance beyond the phases above.

| Signal | Reference | |--------|-----------| | Failed cron run, wrapper script setup, budget cap | `references/headless-cron-patterns.md` | | Memory file writes, YAML frontmatter, staleness, merging | `references/memory-file-operations.md` | | Dry-run validation, output file verification | `references/dream-cycle-testing.md` | | Cron log interpretation, rotation, phase markers | `references/logging-patterns.md` | | Concurrent runs, lockfile, partial write recovery | `references/concurrency.md` |

Read more
@notque
Ships withvexjoy-agent

Essays and writing behind this toolkit live at vexjoy.com. VexJoy Agent connects plain-English requests to specialist agents, skills, and workflows. /do selects the knowledge and tools needed for your task.

44363 skills198 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
443
Star history of notque/vexjoy-agent on GitHub, a chart by star-history.com

Other skills on vexjoy-agent.

assessment

assessment

Assessment: read-only inspection, codebase overview, value analysis, health checks, ADR consultation, decision analysis,…

@notque@notqueInstall Skill
business-ops

business-ops

Business operations: strategy, technology, growth, competitive intelligence, support, finance, HR, legal, operations, sales,…

@notque@notqueInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about auto-dream.

Which coding agents can use auto-dream?
auto-dream installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.