Note Router
Swift · Apple FoundationModels · On-Device LLM · macOS launchd · 2026
Capturing quick notes during back-to-back calls is easy, but filing and naming them properly is where friction creeps in. You end up with a folder root full of hastily named Markdown files—new.md, Untitled 1.md, notes.md—and broken wikilinks whenever you finally clean them up.
I built Note Router to handle the filing automatically in the background. Drop a plain .md file into the notes root from any editor, Finder, or the terminal and leave it alone. After it settles, Apple's on-device language model reads the note, moves it into the right client or subject subfolder (creating it if needed), renames the file to match its content, and rewrites any [[wikilinks]] across the workspace. Everything runs 100% locally on the Mac—no note content ever leaves the machine and no API key is needed.
The code and workflow are on GitHub at github.com/soundisspirit/Automation-Local-MacOS-LLM.
How it works
The entire automation is a single Swift file compiled with the macOS Command Line Tools and managed by launchd, requiring no external dependencies, no full Xcode install, and no specific note-taking app:
Step 1 — Watch the folder: An installer script compiles NoteRouter.swift and registers a launchd agent with WatchPaths and a 2-minute timer, watching only the root of the notes folder.
Step 2 — Wait until the note settles: A gate checks that the file has gone 5 minutes without edits and contains at least 80 characters of body text, while skipping index files, daily notes (YYYY-MM-DD.md), and seeded root files.
Step 3 — Classify with Apple FoundationModels: The router passes the note text and the catalog of existing subfolders to Apple's on-device model using a strict DynamicGenerationSchema that returns three fields: target folder, a concise 3–7 word title, and an isMeeting flag.
Step 4 — File, rename & heal wikilinks: Meeting notes are formatted as YYYY-MM-DD-meeting-topic.md and general notes as <Title>.md. After moving the file, the router scans the workspace and updates every [[Old name]], [[Old name|alias]], and [[Old name#heading]] link to the new filename.
Use cases: Zero-friction note capture, automatic per-client and per-subject folder organization, standardized meeting note naming, and self-healing Markdown knowledge bases.