The problem
My Obsidian vault turned into a junk drawer: broken links, untagged notes, notes I could never find again. Cleaning it by hand never stuck.
The setup
Two plain Python scripts run one after the other every night at midnight. A scheduler (I use n8n on a small home server; cron works too) starts them.
- Tags and links (add-only). The first script reads each note’s folder and topic and adds the matching tags and a “Related” link to the right index note. It only ever adds lines; it never deletes or rewrites what you wrote.
- Health check. The second script looks for broken wikilinks, notes with no title, missing frontmatter and missing cover images. It fixes the safe things itself (a missing title, a missing cover image) and writes everything else, like broken links, into a report note for you to fix.
One real night
| Measure | Result |
|---|---|
| Notes touched | 18 |
| Small fixes | 40 (28 cover images, 12 title icons) |
| Broken links flagged for me | 8 |
| Run time | about 30 seconds |
| AI calls | 0 |
| Cost | $0 |
Build your own, step by step
- Write down your rules first: which folder means which tag, and which index note each folder links to. The scripts just apply these.
- Start with a dry run. Have both scripts print what they would change, and read that list for a week.
- Make the first script add-only. Append tags and links; never delete or rewrite a line.
- Fix only what’s safe in the health check, and put the rest in a report note you check once a week.
- Back up before the first real run, and keep the vault in sync or version control.
- Schedule it for a time you’re not editing (midnight works), with cron or n8n.
- Keep it free: no AI calls are needed for any of this.
Comment VAULT on the reel and the DM sends you straight back to this page.



