/cog-second-brain:dreamfrom cog-second-brain
Runs a maintenance pass on a Markdown vault: lints notes, files inbox captures, adds back-links, consolidates entries, finds patterns, checks quotes, reports orphans, and writes a morning note with undoable change IDs.
Ships in cog-second-brain. 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.
Read when SKILL.md points to them.
A vault decays between sessions. Captures pile up in 00-inbox/, people pages miss the notes that mention them, and a model summary can carry a quote nobody said. /dream runs the upkeep in one fixed order and leaves one morning note that lists every change.
The cycle follows the nightly "dream" idea in garrytan/gbrain: ordered phases, a cheap check before an expensive one, mechanical verification of model output, and a keep-or-undo note. The steps below are written for COG and use only Markdown files and one script.
/dreamdate '+%Y-%m-%d %H:%M' with Bash. Use that value for every timestamp. Never guess the time.scripts/brain-lint.py exists. If it does not, tell the user, skip phases 1, 3, 6 and 7, and run the rest. In phase 2, list the captures by hand: files in 00-inbox/ that are not MY-*.md and not under archive/.vault_path in cog.local.yaml (CLAUDE.md, Vault Location) and uses the current folder when that file is absent. Run every command below from the repository root. To lint another vault, add --vault "<absolute vault path>".00-inbox/MY-PROFILE.md for agent_mode. In agent_mode: team, phases 4 and 5 may delegate scanning to sub-agents. In solo mode, do everything directly.01-daily/*-dream.md. Read its frontmatter for dream_run_at and mode. No file means this is the first run.mode: applied exists. Phases 2 to 5 only write proposals into the morning note. The morning note is the only file written.Run the phases in this order. Each phase names why it sits there.
| # | Phase | Why it sits here |
|---|---|---|
| 1 | Lint | It is free and deterministic, so it sets the baseline and shows which later phases have work. |
| 2 | File inbox captures | Notes must reach their final folder before links and summaries point at them. |
| 3 | Back-links | Entity timelines must be complete before consolidation and patterns read them as evidence. |
| 4 | Consolidate | It builds on filed notes and full timelines, and it feeds the patterns phase. |
| 5 | Patterns | It needs the frameworks from phase 4 and costs the most, so it runs after the cheap phases. |
| 6 | Quote check | It must see every note written in phases 2 to 5 before the user does. |
| 7 | Orphans report | It reports the final link state after all writes. |
| 8 | Morning note | It records the result of every earlier phase, so it comes last. |
Run:
python3 scripts/brain-lint.py summary
Copy the metrics into the morning note. Do not edit anything in this phase. If failed_checks is empty and the inbox has no captured notes, say so and end the run early with no morning note.
python3 scripts/brain-lint.py inbox-age --inbox-days 0 --json. Config files (MY-*.md) and 00-inbox/archive/ never appear.RESOLVER.md at the vault root. If RESOLVER.md is missing, skip this phase and note it.status: "filed" and filed_to in its frontmatter.Never delete an inbox note. A move is the only change this phase makes to a capture.
python3 scripts/brain-lint.py backlinks --json.suggested_line and suggested_date. Replace <context> with a few words taken from the note.## Timeline heading, beneath a ### <suggested_date> heading, newest first. Create the date heading when it is missing. Never rewrite existing timeline lines.<!-- timeline --> marker line and a ## Timeline (Append-Only) heading at the end of the page first.Format: - Referenced in [[path/to/note]]: context. [Source: [[path/to/note]] | YYYY-MM-DD | confidence: medium]
dream_run_at. Fewer than 3 means skip this phase and say so./knowledge-consolidation on the selected notes. Use its own rules for frameworks, source links and status marks.Write a pattern note only when both conditions hold.
date or created) or its filename.dream_run_at with the current time. Inside the window, skip this phase and say so.A pattern note goes to 05-knowledge/patterns/pattern-<name>.md. It lists every source in a sources: frontmatter list and links each one in the body. If the pattern page exists, append a dated entry and leave the rest alone. Fewer than 3 sources means no note. Record the near miss in the morning note as "watching" with the sources found so far.
Run for every note written or changed in phases 2 to 5, one --only per note:
python3 scripts/brain-lint.py quotes --json --only 05-knowledge/patterns/pattern-example.md
Each new note needs a sources: list of vault paths, or the check has nothing to compare against. Add --fix in apply mode. A failing quote moves to the unverified_claims frontmatter list. The body is not changed. List each failing quote in the morning note with its id.
Run python3 scripts/brain-lint.py orphans --json. Report only. Group the findings by folder and add one suggested link target for each orphan when an obvious one exists. Do not edit the notes.
Write 01-daily/YYYY-MM-DD-dream.md with this shape:
---
type: dream
date: YYYY-MM-DD
dream_run_at: "YYYY-MM-DD HH:MM"
mode: proposed
changes: 7
---
# Dream YYYY-MM-DD
7 changes. 2 need a yes or no.
## Lint
(metrics from phase 1)
## Changes
| id | phase | change | target | status |
|---|---|---|---|---|
| D-3f9a2c | back-links | add timeline line | 05-knowledge/people/jane-doe.md | applied |
## Undo data
- D-3f9a2c: remove the line `- Referenced in [[03-professional/meetings/2026-12-01-kickoff]]: plan. [Source: ...]` from the target, and the `### 2026-12-01` heading when that line was its only entry.
## Watching
(pattern near misses, blocked moves, skipped phases with the reason)
## Waiting on you
Reply `keep D-3f9a2c D-81bb0e`, `undo D-3f9a2c`, or `apply` to switch to apply mode.
Statuses are proposed, applied, kept and undone. The first line after the title is the one-line summary the user reads at session start.
Every change gets an id so the user can answer it. The id is stable: the same change always gets the same id.
printf '%s' "phase|target-path|detail" | shasum | cut -c1-6
Prefix the result with D-. Use the phase name, the vault-relative target path, and the added line or the new path as the detail.
Before any change, search the existing dream notes for its id. Skip the change if the id is already there as applied, kept or undone. An undone id is never applied again.
keep <id> sets the status to kept. Nothing else changes.undo <id> reverses the change with its recorded undo data, then sets the status to undone and asks for a reason, which goes in the row.00-inbox/archive/. Undo of a move moves the file back. Undo of a timeline line removes only that line.## Run HH:MM section for new changes only. Never rewrite earlier rows.Nothing runs on a schedule until the user adds it. To run /dream nightly with cron, add this line with crontab -e:
30 2 * * * cd /path/to/repository && claude -p "/dream" --allowedTools "Read,Write,Edit,Bash" >> /path/to/dream.log 2>&1
Use a narrower --allowedTools list if the vault holds anything sensitive. On macOS, cron needs Full Disk Access, and a launchd job that runs the same command works as well. Scheduled runs stay in propose mode until the user has approved a first run by hand. Each morning the user reads the dream note, answers with keep or undo, and the next night's run uses those answers.
To stop, remove the cron line. The skill keeps no other state.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
vault-maintenance, note-taking, knowledge-management, obsidian
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: skills: Invalid input, repository: Invalid input: expected string, received object
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
49 skills in this plugin
/auto-researchDeep strategic research engine — decomposes questions into parallel research threads, spawns multiple agents, and synthesizes into actionable strategic analysis/best-of-nSelector stage before a verification gate - generate N candidates in parallel, pick the best with a pivot tournament of pairwise judgements, then gate the winner. For high-variance, non-mutating deliverables only/blog-publishWrite and publish a post to your own static blog end to end: content checklist (embedded links, optional TL;DR), per-post ASCII art, an agent-readable markdown twin, deploy, and social distribution. Use when you say "write a blog post", "publish this to my blog", or "push this post to socials".
Other plugins' skills for the same job