Background memory consolidation and learning graduation — overnight knowledge lifecycle.
npx skills add https://github.com/notque/vexjoy-agent --skill auto-dream
Background memory consolidation cycle. Scans memory files, finds stale/duplicate/conflicting entries, consolidates, synthesizes cross-session insights, builds an injection-ready payload for next session start, and writes a dated dream report.
scripts/auto-dream-cron.sh --execute./scripts/auto-dream-cron.sh (dry-run by default)| Signal | Load These Files | Why |
|---|---|---|
| Debugging failed cron run, silent failure, empty log, wrong exit code | headless-cron-patterns.md | Routes to the matching deep reference |
| Setting up or modifying wrapper script (flock, --permission-mode, envsubst, PIPESTATUS) | headless-cron-patterns.md | Routes to the matching deep reference |
| Budget cap, --max-budget-usd, unattended Claude invocation | headless-cron-patterns.md | Routes to the matching deep reference |
| Writing, updating, or archiving memory files | memory-file-operations.md | Routes to the matching deep reference |
| Updating MEMORY.md index, atomic write, .tmp rename | memory-file-operations.md | Routes to the matching deep reference |
| Staleness detection, duplicate merging, conflict flagging | memory-file-operations.md | Routes to the matching deep reference |
| YAML frontmatter structure, merged_from, memory file format | memory-file-operations.md | Routes to the matching deep reference |
| Testing the dream cycle safely, dry-run validation, output file verification | dream-cycle-testing.md | Routes to the matching deep reference |
| Inspecting graduation candidates, snapshot testing, PIPESTATUS in test wrappers | dream-cycle-testing.md | Routes to the matching deep reference |
| Reading and interpreting cron run logs, detecting silent failures | logging-patterns.md | Routes to the matching deep reference |
| Log rotation, log directory structure, phase completion markers in logs | logging-patterns.md | Routes to the matching deep reference |
| last-dream.md stale, missing injection payload, cron log empty | logging-patterns.md | Routes to the matching deep reference |
| Concurrent dream runs, lockfile already held, duplicate cron invocations | concurrency.md | Routes to the matching deep reference |
| MEMORY.md.tmp left behind, partial write recovery, atomic rename failure | concurrency.md | Routes to the matching deep reference |
| database is locked, SQLite WAL mode, busy_timeout, concurrent DB access | concurrency.md | Routes to the matching deep reference |
| local changes would be overwritten, git stash before GRADUATE branch switch | concurrency.md | Routes to the matching deep reference |
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 seven-phase 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.
~/.claude/state/dream-scan-{date}.md.~/.claude/state/dream-analysis-{date}.md.dream/graduate-YYYY-MM-DD branch for human review. Max 3 per cycle. (ADR-159)~/.claude/state/dream-injection-{project-hash}.md.~/.claude/state/last-dream.md.memory/archive/, never rmmerged_from field for provenanceDREAM_DRY_RUN_MODE=yes which is substituted into the prompt at runtime.dream/graduate-*), never on main — user reviews and merges# 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
# Check graduation candidates (what dream would graduate)
python3 -c "
import sys; sys.path.insert(0, 'hooks/lib')
from learning_db_v2 import query_graduation_candidates
import json
candidates = query_graduation_candidates()
print(json.dumps(candidates, indent=2))
"
# Check if a graduation branch exists
git branch --list 'dream/graduate-*'
# Verify cron registration
python3 ~/.claude/scripts/crontab-manager.py list
~0.09 USD per nightly run with 50 memory files (~20-30K input tokens at Sonnet pricing). ~33 USD/year for automated overnight operation. Budget capped at 3.00 USD/run via wrapper script.
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.
scripts/auto-dream-cron.sh follows the established headless cron pattern (see skills/content/reddit-moderate/scripts/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 operationenvsubst templates dream-prompt.md with project-specific paths at runtimetee to timestamped per-run log file--execute for live runsPIPESTATUS[0]Load these references when the task matches the signal:
| Signal / Task | Reference File |
|---------------|----------------|
| Debugging failed cron run, silent failure, empty log, wrong exit code | references/headless-cron-patterns.md |
| Setting up or modifying wrapper script (flock, --permission-mode, envsubst, PIPESTATUS) | references/headless-cron-patterns.md |
| Budget cap, --max-budget-usd, unattended Claude invocation | references/headless-cron-patterns.md |
| Writing, updating, or archiving memory files | references/memory-file-operations.md |
| Updating MEMORY.md index, atomic write, .tmp rename | references/memory-file-operations.md |
| Staleness detection, duplicate merging, conflict flagging | references/memory-file-operations.md |
| YAML frontmatter structure, merged_from, memory file format | references/memory-file-operations.md |
| Testing the dream cycle safely, dry-run validation, output file verification | references/dream-cycle-testing.md |
| Inspecting graduation candidates, snapshot testing, PIPESTATUS in test wrappers | references/dream-cycle-testing.md |
| Reading and interpreting cron run logs, detecting silent failures | references/logging-patterns.md |
| Log rotation, log directory structure, phase completion markers in logs | references/logging-patterns.md |
| last-dream.md stale, missing injection payload, cron log empty | references/logging-patterns.md |
| Concurrent dream runs, lockfile already held, duplicate cron invocations | references/concurrency.md |
| MEMORY.md.tmp left behind, partial write recovery, atomic rename failure | references/concurrency.md |
| database is locked, SQLite WAL mode, busy_timeout, concurrent DB access | references/concurrency.md |
| local changes would be overwritten, git stash before GRADUATE branch switch | references/concurrency.md |
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take notque/auto-dream from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.