Three years of notes, 2,000 files, and the search box has become the only way in. You know there was a good note on pricing somewhere. You find four, none finished, one called "Untitled 7."
Most second brain advice is about capturing better. AI prompts for a second brain are more useful on the other side of the problem: cleaning up what you already have. This post gives you a way to measure the mess with a script, prompts that propose fixes in small batches, and rules so nothing gets deleted by accident. It works for Obsidian (a folder of Markdown files you can script against) and for Notion (via an export or a database view).
If you are still setting up capture, start with AI prompts for notes and a second brain, which covers processing new captures, linking and the weekly review. This post is for the backlog. For voice capture see voice-first note taking. The prompts here are untested templates; the script output below is real, but it ran on a tiny synthetic vault I generated, not on anyone's real notes.
How do I find out how messy my vault really is?
Measure before you ask a model anything. Four counts tell you where to start: orphans (nothing links to them), untitled notes, broken links, and very long notes. This script builds a small made-up vault of eight notes and audits it. Point the same logic at your own folder by replacing the setup block with your vault path.
import re, pathlib
link_re = re.compile(r"\[\[([^\]|#]+)")
names = {p.stem for p in root.glob("*.md")}
inbound = {n: 0 for n in names}
broken = []
for p in root.glob("*.md"):
for target in link_re.findall(p.read_text(encoding="utf-8")):
target = target.strip()
if target in names:
inbound[target] += 1
else:
broken.append((p.stem, target))
print("notes:", len(names))
print("orphans (no inbound links):", sorted(n for n, c in inbound.items() if c == 0))
print("untitled:", sorted(n for n in names if n.lower().startswith("untitled")))
print("broken links:", broken)
Here root is the vault folder. Output on the synthetic vault, run 2026-10-30:
notes: 8
orphans (no inbound links): ['Meeting 2026-09-03', 'Pricing thoughts', 'Reading list', 'Untitled', 'Untitled 1']
untitled: ['Untitled', 'Untitled 1']
broken links: [('Pricing thoughts', 'Pricing model')]
longest by characters: ('Meeting 2026-09-03', 4200)
Read the result with some skepticism. This is a simplified checker: it only looks at [[wikilinks]], ignores subfolders, aliases and embeds, and treats any note with no inbound link as an orphan. A daily note or a reference list can be a perfectly healthy orphan. The 'Pricing thoughts' broken link is the useful kind of finding: it points at a note that was planned and never written.
In Notion there is no folder to script against, so use a database view instead: sort by last edited, filter for an empty title or empty relation property, and count. The goal is the same, a short list of candidates rather than "everything."
What do I send the model, and in what order?
Work through one category at a time, in this order, because each step makes the next easier:
- Untitled and scrap notes. Fast wins, low risk.
- Oversized notes. Split these before linking.
- Duplicates and near-duplicates. Merge or cross-link.
- Orphans. Link them or archive them.
- Broken links. Write the missing note or remove the link.
Send 20 to 30 notes per batch, each with its filename, so the model's proposals can refer back to a file.
Prompt: rescue untitled and scrap notes
Below are notes I never titled. For each, return:
- filename (copied exactly)
- a proposed title, 3-8 words, specific enough to find via search
- verdict: KEEP, MERGE INTO <existing note title from my list>, or ARCHIVE
- one-line reason
My existing note titles (for MERGE targets only):
<titles>
[PASTE LIST]
</titles>
Rules: do not invent details. If a note is too short or vague to title,
verdict is ARCHIVE with reason "no recoverable content". Never propose DELETE.
<notes>
[PASTE: filename + content, separated by ---]
</notes>
The ban on DELETE is deliberate. Archive means moving to an Archive folder you can still search; delete is a decision you make later, separately.
Prompt: split an oversized note
Long notes bury the one idea you were searching for. Splitting works best when each piece can stand alone.
This note covers several topics. Propose a split into standalone notes.
For each new note give:
- title (a claim or specific topic, not "Misc")
- the exact text that moves into it, copied verbatim from the original
- one sentence on why a reader needs this piece alone
- [[links]] it should have to the other new notes
Then show what the original note should become: a short index that links to the
new notes. Do not rewrite or summarise the moved text; verbatim only.
NOTE:
[PASTE]
"Verbatim only" matters. Models like to improve text while moving it, and a cleanup should not quietly change what you wrote in 2023.
Prompt: merge or link duplicates
Here are two notes that may overlap.
Step 1: say whether they are (a) duplicates, (b) overlapping but with different
details, or (c) separate topics that just share words.
Step 2: for (a) or (b), show the merged note, and list every fact present in one
original and missing from the merged note (should be none).
Step 3: for (c), suggest a link sentence for each note pointing to the other.
NOTE A:
[PASTE]
NOTE B:
[PASTE]
Step 2's "list every fact that went missing" is a self-check you should still verify yourself by skimming both originals. Keep the originals in Archive for a month.
Prompt: orphans, link or let go
For each orphan note below, suggest up to 3 existing notes from my list that it
should link to, with a one-line reason for each link. If none are a real fit,
say "no good links" and judge whether the note is worth keeping.
Do not force connections. Weak links are worse than none.
MY NOTE TITLES:
[PASTE]
ORPHANS:
[PASTE: filename + first 600 characters of each]
Sending only the first 600 characters keeps the batch small and shows you roughly what the model could actually see. For larger vaults, you can use embeddings to shortlist candidate links before asking a model; that is beyond this post, but building a vector store shows the pieces.
A weekly maintenance routine that fits in 20 minutes
Big purges fail because they take a weekend. A small standing routine works better:
| Minute | Task |
|---|---|
| 0-3 | Re-run the audit. Note whether orphans and untitled counts went down |
| 3-8 | One batch of untitled notes through the rescue prompt |
| 8-15 | Review proposals; apply only the ones you agree with |
| 15-20 | Write one of the broken-link notes, or remove the link |
Track the counts in a note. A number that falls week after week is more motivating than a vague sense of order.
What goes wrong, and what to do about it
| Problem | Cause | Fix |
|---|---|---|
| Titles that sound good but are wrong | Note was too vague to title | Archive rule for unrecoverable notes |
| Details lost in a merge | Model smoothed the text | Verbatim-only rule; keep originals |
| Meaningless links | Model forced connections | "No good links" is an allowed answer |
| Notes touched that you did not send | Hand-run edits grow sloppy | Apply changes by hand, one batch at a time |
| Private data sent to a tool | Notes contain other people's details | Mask first; see below |
What not to automate or send
- Deletion. Archive, wait, then delete by hand.
- Notes about other people, health, money or credentials. Check your tool's data settings first; what not to paste into ChatGPT is a practical checklist. For notes that must stay private, run a local model instead.
- Bulk rewrites of your own writing. Your voice is part of why the notes are yours.
- Linking everything. A vault where every note links to every other note is just as hard to navigate as one with no links.
If you are deciding between tools for a team wiki rather than a personal vault, Notion AI vs Claude Projects compares them. More templates are in the prompt library.



