/ralph-knowledge:dream-loop [--since 24h | --mode bootstrap|verify]from ralph-knowledge
Run, bootstrap, or verify the dream-loop — the nightly memory-consolidation pipeline that ingests the last window of raw activity (Gemma lab logs, git history, llm-cli transcripts, Claude Code sessions) as memory_tier=raw documents, then clusters them and synthesizes one memory_tier=reflection per cluster. This is the memorykeepers surface that orchestrates the existing scripts/dream/ infra (ingest.py + reflect.py + logrotate.sh). Use when the user mentions "dream", "dream-loop", "dream-now", "consolidate memories", "run reflection", "memorykeepers", "ingest raw memories", or wants to manually trigger the memory tiers (raw to reflection) without waiting for the 03:00 launchd fire. Also use for machine wiring and health checks — "bootstrap the dream loop", "set up dream-loop", "install the nightly schedule", "check dream-loop status", "verify the dream loop ran", "did the dream loop ingest anything" — via --mode bootstrap and --mode verify.
Trending skills
7-day visitors to each skill page
Ships in ralph-knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The dream-loop is the memory-consolidation pipeline for ralph-knowledge. It pulls raw activity into memory_tier=raw documents, then clusters them (UMAP/HDBSCAN) and asks a local model to synthesize one memory_tier=reflection per cluster. This skill is the memorykeepers surface for the pipeline: a manual run entrypoint by default, plus --mode bootstrap (first-time machine wiring) and --mode verify (post-run health checks).
| Mode | When | What it does |
|---|---|---|
| (default) run | "run the dream loop", "consolidate memories" | Steps 1–6 below: ingest → reflect → logrotate → report |
--mode bootstrap | first run on a machine, "bootstrap the dream loop" | Delegates to scripts/dream/bootstrap.sh; see Bootstrap |
--mode verify | "did it run?", "check dream-loop status" | Read-only health checks; see Verify |
Resolve the mode from intent, not just the flag — "set up the dream loop on this machine" is bootstrap, "did last night's run work?" is verify, even without --mode.
You are a librarian. Cite the memory tier and the path for every operation. State promotion/synthesis decisions as facts, not recommendations, and always include the verification step that preceded the operation.
reflections/2026-05/cluster-7.md (memory_tier=reflection). Verification: clustered from 3 raw sources under dream-memories/2026/05/, no contradictions found."You refuse to:
/ralph-knowledge:curate surface, not this one)scripts/dream/ (ingest.py, reflect.py, logrotate.sh). It is NOT bundled inside this plugin — this skill orchestrates the repo-root scripts.cd <repo>/scripts/dream && uv sync (one-time).~/.ralph/knowledge.config.json authored with the roots to scan and dbPath.RALPH_LLM_URL (default http://localhost:8000) for the reflection synthesis step. If the model is unreachable, the pipeline fails open: empty reflections and a single stderr warning — raw ingest still succeeds.If any prerequisite is missing, that is a bootstrap problem, not a run problem — switch to Bootstrap below rather than surfacing a bare error.
Parse --since from the arguments (default 24h). This bounds how far back ingest.py pulls raw activity.
Find the repo root and confirm scripts/dream/ingest.py and scripts/dream/reflect.py exist. Cite the resolved path.
cd <repo>/scripts/dream
uv run ingest.py --since <WINDOW>
ingest.py writes markdown under memory_tier=raw to ~/projects/thoughts/dream-memories/YYYY/MM/DD/. Report the count of raw documents written and the path.
uv run reflect.py --since <WINDOW>
reflect.py clusters the raw memories and writes memory_tier=reflection synthesis documents to .../dream-memories/reflections/YYYY/MM/DD/. If a local model id is known (e.g. via RALPH_DREAM_MODEL), pass it with --model. Report the number of clusters and reflections written, and each reflection path.
./logrotate.sh
Caps the pipeline log files so repeated runs do not grow unbounded.
State, as facts with paths and tiers:
dream-memories/YYYY/MM/DD/)reflections/YYYY/MM/DD/)process-improvement follow-up--mode bootstrap)scripts/dream/bootstrap.sh is the single source of truth for machine wiring — it idempotently provisions ~/.ralph/knowledge.config.json, renders + loads the templated launchd plist for the 03:00 nightly fire, and smoke-tests ingest. Never re-implement its steps inline; when wiring logic changes, it changes in bootstrap.sh.
cd <repo>/scripts/dream && uv sync # python deps (one-time)
cd <repo>/plugin/ralph-knowledge && npm install && npm run build # indexer (one-time)
bash <repo>/scripts/dream/bootstrap.sh # config + launchd + smoke ingest
After it completes, run the Verify checks to confirm the wiring took. /ralph-knowledge:setup Step 4 invokes the same script — either surface is fine; they cannot drift because both delegate.
Machine conventions (optional): if the machine has a model-gate checkout (~/projects/model-gate), prefer its surfaces for anything model-adjacent: model-up <name> to load the reflection model safely (stop-before-start on :8000), and the gate-aware dream-now zsh function as the shell-side equivalent of a full run. Registry of valid model names: ~/projects/models.yml; setup details: model-gate/README.md. Absent model-gate, any OpenAI-compatible server at RALPH_LLM_URL works.
--mode verify)Read-only. Run what applies, report as facts with counts and paths:
# Run state — read these FIRST: each cadence's last terminal outcome
cat ~/.ralph-hero/dream-state.json # nightly reflect.py (GH-2112)
cat ~/.ralph-hero/dream-meta-state.json # weekly meta_reflect.py (GH-2159)
# DB schema + tier breakdown
sqlite3 ~/.ralph-hero/knowledge.db "SELECT * FROM meta WHERE key='schema_version'"
sqlite3 ~/.ralph-hero/knowledge.db "SELECT memory_tier, COUNT(*) FROM documents GROUP BY memory_tier"
# Files on disk vs indexed (stale index if these diverge)
echo "On disk: $(find ~/projects/thoughts/dream-memories -name '*.md' | wc -l)"
echo "Indexed: $(sqlite3 ~/.ralph-hero/knowledge.db 'SELECT COUNT(*) FROM documents WHERE path LIKE "%dream-memories%"')"
# Local model reachability
curl -fsS "${RALPH_LLM_URL:-http://localhost:12000}/v1/models" | jq '.data[].id'
# launchd jobs (if installed): PID "-" when idle, exit status 0 after a clean run
launchctl list | grep -E 'dream-loop|dream-weekly'
Interpretation notes:
outcome: empty/deferred are healthy zeroes; failed means clusters were attempted and nothing was written — the defect (an alarm issue is auto-filed on the board for it). A run_at older than ~2 days means the loop is not firing at all — the one class the state file records only by its absence of freshness.outcome: empty/deferred/suppressed are healthy zeroes — suppressed specifically means the model answered and the dedup gates dropped every candidate as already-known, which is health, not failure. Only failed (reflections cleared the min_reflections gate and zero candidates were synthesized) is the defect, and it files its own standing alarm, distinct from the nightly's. The weekly fires Sundays, so a run_at older than ~8 days means it is not firing at all.near_misses in the run state (GH-2259) counts paraphrase near-misses recorded, never suppressed — nothing branches on it. It is the measurement #1965's deferral is waiting on, and the readings are not interchangeable: an absent <wiki_dir>/_near_misses.jsonl means never instrumented, a kind: "scan" record with near_misses: 0 means instrumented and no churn — but only once at least one scan compared a candidate against a known axiom (a failed/empty run's candidates: 0 scan proves the instrument ran, not that the corpus is clean; the report says NOT CERTIFIABLE until then, GH-2283), and non-zero means #1965's trigger has fired. Read the accumulation with uv run scripts/dream/meta_reflect.py --near-miss-report (from the repo root; this skill already runs the dream scripts by repo path).near_misses: null in dream-meta-state.json (GH-2283) is a THIRD reading, distinct from both: it means THIS run's scan write itself failed (an OSError — disk full, permissions), so this run left no evidence either way. It is not the same as 0 (ran clean, found nothing) and not the same as the file being wholly absent (never instrumented at all — a different, older run). meta_reflect.py logs a WARNING and dream_health.warn_if_uninstrumented surfaces it, but never fails the run over it — a missing datum may not cost a real weekly run.schema_version=3 is correct, not stale — the wiki-tier CHECK-constraint change is labeled "Migration v4" in db.ts but deliberately does not bump the meta stamp.doc (curated), raw (dream ingest), reflection (synthesized), wiki (human-curated via /ralph-knowledge:curate; not writable by the record tool). A healthy post-run breakdown shows raw and reflection counts growing.scripts/dream/launchd/com.dubiel.dream-loop.plist.template, installed by bootstrap.sh (directly or via /ralph-knowledge:setup). Fires at 03:00 daily. This skill is the manual on-demand counterpart.dream-now — a model-gate zsh function that is gate-aware (loads the model first, then ingest + reflect + logrotate). Owned by model-gate, not this plugin. The default run mode here invokes the scripts directly; point users at dream-now when they want the gate-managed shell path./ralph-knowledge:curate — the human-gated promotion of reflections into the personal wiki tier. The dream-loop produces reflections; curate (not this skill) decides what becomes canonical.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cdubiel08/ralph-hero --plugin ralph-knowledge5 skills in this plugin
/captureCapture — In-Flow Memory CaptureCapture an insight, decision, or session learning as a raw memory in ralph-knowledge — the in-flow "remember this" surface. Distills what just happened (an exchange, a debugging breakthrough, a whole session) into 1-3 atomic raw memories via the knowledge_remember MCP tool, so the nightly dream-loop reflection pass can synthesize them. Use when the user says "remember this", "capture this", "save this insight", "make a memory of this", "don't let me forget", "TIL", "turn this session into memories", or wants to bank a learning without leaving flow. Not for curated knowledge — wiki promotion is the human-gated /ralph-knowledge:curate surface./curateCurate the personal wiki tierCurate the personal wiki tier — the third memory tier above raw and reflection. Iterates through atomic axiom candidates one at a time, fact-checks each against the corpus, external sources, and code, applies governance gates (outside-code-surface, atomicity, lede-writability, MUSTIE, domain freshness), and presents fully-evidenced candidates for the user to gate y/n/edit. Use whenever the user mentions "curate the wiki", "promote to wiki", "find canonical entries", "add to my wiki", "wiki tier", "wiki axioms", or wants to grow their thoughts/wiki/ directory. Also trigger when the user wants to distill recurring patterns from their thoughts/ corpus into canonical entries, synthesize reflections into wiki-grade material, or when they ask to "find atomic axioms" in their notes. The wiki resists growth — the gate is biased toward rejection./setupRalph Knowledge SetupSet up or rebuild the ralph-knowledge index from markdown documents. Use when setting up ralph-knowledge for the first time, reindexing after adding new documents, rebuilding a corrupted knowledge DB, or when knowledge_search returns empty results. Also use when the user mentions "index thoughts", "reindex", "set up knowledge", or "knowledge search not working"./setup-obsidianRalph Knowledge — Obsidian SetupSet up Obsidian as the browsing UI for ralph-knowledge documents. Provisions .obsidian/ config, updates .gitignore, and runs reindex with index note generation. Use when users want to browse thoughts/ in Obsidian, set up Obsidian integration, or ask about viewing knowledge documents.Other plugins' skills for the same job