Dreaming
An overnight AI pass over a day's notes, capped and checked
A nightly job that asks a small AI model whether pairs of the day's notes are related, duplicated or in conflict, and leaves a short report by morning. The model has no tools and a hard cap, and any answer that does not quote the notes exactly is thrown away.
Problem
Related notes drift apart, duplicates pile up and two notes can disagree about the same fact. I wanted an overnight pass that finds these without giving a model free rein over my records while nobody watches.
Approach
Each night Dreaming pairs notes that look related and asks a small judge whether each pair is related, a duplicate or a contradiction. In v1 it changes no note unless I switch writes on, and then only two front matter fields. Everything else is a flag or a proposal in a morning report. It never deletes, renames, moves or sends anything.
Architecture
A launchd job starts it at 04:30. The judge is one tool-less Claude call per pair, on Haiku, with no MCP servers and a per-call spending cap. It is deliberately not a full managed agent run, which could still be going at 07:00. A night allows at most 30 calls and $1.50, usage is checked before every call, and pairs over the cap carry to the next night. The judge stops at 06:40 so the report lands before the morning job.
The judge's output is data, not instruction. Notes reach it fenced as data, and text in a note worded as an instruction is compared, not obeyed. Each verdict must quote one complete line from each note exactly, or it is thrown away. The code re-checks every quote against the file and rejects replies with unexpected keys. Live calls and writes are refused inside a managed agent, so only the scheduled job runs live.
What I built
The main script is 2,248 lines of Python with a 1,153-line self-test. With writes on, it makes at most 10 a night, each a compare-and-swap on the file's hash, logged before and after, and it skips notes someone else edited in the last 12 hours. Undo restores a field only if it still holds what Dreaming wrote, then freezes that rule for 7 days. The report is at most 12 lines plus 5 proposals, and one line of it reaches four other surfaces, including the daily email.
Results
Replayed against 90 obligations closed over two weeks, the proposed close rule would have made 0 of them. Matching my typed words in session logs to open items was right 12% of the time. So v1 reports rather than edits. The first scheduled night ran on time and reported 0 changes, 0 conflicts and 6 proposals. Writes stay off until a week of dry runs is reviewed.
What didn't work
Most of what a night reads produces nothing yet. On the test night, 239 of 326 files gathered had no output, and using them is a v2 decision.
Stack
- Python
- Claude Code
- Claude Haiku
- launchd
- git