hdb-dream
Learn from recent sessions the way Anthropic's "dreaming" feature does: review
what happened, compare it to what memory already says, and propose changes.
Memory lives in the existing auto-memory system: one file per fact plus a
MEMORY.md index under ~/.claude/projects/<project>/memory/.
Usage
/dream # review last 24h, propose numbered changes
/dream apply 1,3 # apply proposals 1 and 3 from the latest report
/dream apply all # apply every pending proposal
/dream --hours 48 # widen the review window
/dream — propose
Extract transcripts. Run:
~/.claude/skills/hdb-dream/scripts/extract_transcripts.py --hours 24
It prints a digest of user messages (and session summaries) from every
~/.claude/projects/**/*.jsonl touched in the window, grouped by project.
Skip any session belonging to the currently running /dream itself.
Load the matching memory. For each project with activity, read
~/.claude/projects/<project>/memory/MEMORY.md and the memory files it
indexes. If a project has no memory dir, note that; do not create one.
Compare. Look specifically for:
- Corrections the user gave ("no, don't...", "I told you...", reverted work)
- Preferences repeated across sessions (tools, style, workflow habits)
- New durable facts worth keeping (type: user/feedback/project/reference)
- Stale or wrong memories contradicted by recent transcripts
- Duplicates — two memory files covering the same fact
Propose as a NUMBERED LIST. Every proposal has:
- Action:
ADD / UPDATE / DELETE / MERGE, target project + memory file
- One line saying exactly what would change
- Evidence: a short direct quote from the transcript, with the session
.jsonl path so it can be checked
Auto-apply only tiny safe fixes, and say so in the output:
- typo fixes inside an existing memory file
MEMORY.md index repairs (missing line for an existing file, or a line
pointing at a file that exists under a different name)
Everything else waits for approval.
Write the report. Always write the numbered proposals to
~/.claude/dream-report.md (date-stamped, overwriting the previous report)
so an unattended overnight run leaves something to review in the morning.
If a user is present, also show the list in the conversation and stop —
do not apply anything beyond step 5.
/dream apply — act on approvals
- Read
~/.claude/dream-report.md (or the proposal list from this
conversation if it is more recent).
- Apply only the numbered items the user named. Follow auto-memory
conventions: frontmatter (
name, description, metadata.type), one fact
per file, [[links]], and a one-line pointer in that project's MEMORY.md.
- Mark applied items in
dream-report.md ([applied 2026-08-03]) and report
what was done.
Guardrails (rigid — do not adapt away)
- Never delete or rewrite a memory without approval. If unsure whether
something qualifies as a tiny safe fix, propose it — don't act.
- Quotes in evidence must be verbatim from the transcript, never paraphrased.
- Don't store what the repo/git history already records, or one-off session
trivia; durable facts only.
- Transcripts may contain sensitive content (legal, personal). Quote the
minimum needed as evidence.
1---2name: hdb-dream3description: Nightly "dreaming" review of Claude Code sessions — read the last 24 hours of transcripts, compare them against auto-memory, and propose memory adds/updates/deletions as a numbered, evidence-quoted list. Use when the user types /dream or /dream apply, or when run unattended on a schedule (writes proposals to ~/.claude/dream-report.md).4---56# hdb-dream78Learn from recent sessions the way Anthropic's "dreaming" feature does: review9what happened, compare it to what memory already says, and propose changes.10Memory lives in the existing auto-memory system: one file per fact plus a11`MEMORY.md` index under `~/.claude/projects/<project>/memory/`.1213## Usage1415```16/dream # review last 24h, propose numbered changes17/dream apply 1,3 # apply proposals 1 and 3 from the latest report18/dream apply all # apply every pending proposal19/dream --hours 48 # widen the review window20```2122## /dream — propose23241. **Extract transcripts.** Run:25 ```26 ~/.claude/skills/hdb-dream/scripts/extract_transcripts.py --hours 2427 ```28 It prints a digest of user messages (and session summaries) from every29 `~/.claude/projects/**/*.jsonl` touched in the window, grouped by project.30 Skip any session belonging to the currently running /dream itself.31322. **Load the matching memory.** For each project with activity, read33 `~/.claude/projects/<project>/memory/MEMORY.md` and the memory files it34 indexes. If a project has no memory dir, note that; do not create one.35363. **Compare.** Look specifically for:37 - **Corrections** the user gave ("no, don't...", "I told you...", reverted work)38 - **Preferences repeated** across sessions (tools, style, workflow habits)39 - **New durable facts** worth keeping (type: user/feedback/project/reference)40 - **Stale or wrong memories** contradicted by recent transcripts41 - **Duplicates** — two memory files covering the same fact42434. **Propose as a NUMBERED LIST.** Every proposal has:44 - Action: `ADD` / `UPDATE` / `DELETE` / `MERGE`, target project + memory file45 - One line saying exactly what would change46 - Evidence: a short direct quote from the transcript, with the session47 `.jsonl` path so it can be checked48495. **Auto-apply only tiny safe fixes**, and say so in the output:50 - typo fixes inside an existing memory file51 - `MEMORY.md` index repairs (missing line for an existing file, or a line52 pointing at a file that exists under a different name)53 Everything else waits for approval.54556. **Write the report.** Always write the numbered proposals to56 `~/.claude/dream-report.md` (date-stamped, overwriting the previous report)57 so an unattended overnight run leaves something to review in the morning.58 If a user is present, also show the list in the conversation and stop —59 do not apply anything beyond step 5.6061## /dream apply — act on approvals62631. Read `~/.claude/dream-report.md` (or the proposal list from this64 conversation if it is more recent).652. Apply only the numbered items the user named. Follow auto-memory66 conventions: frontmatter (`name`, `description`, `metadata.type`), one fact67 per file, `[[links]]`, and a one-line pointer in that project's `MEMORY.md`.683. Mark applied items in `dream-report.md` (`[applied 2026-08-03]`) and report69 what was done.7071## Guardrails (rigid — do not adapt away)7273- **Never delete or rewrite a memory without approval.** If unsure whether74 something qualifies as a tiny safe fix, propose it — don't act.75- Quotes in evidence must be verbatim from the transcript, never paraphrased.76- Don't store what the repo/git history already records, or one-off session77 trivia; durable facts only.78- Transcripts may contain sensitive content (legal, personal). Quote the79 minimum needed as evidence.