Tag Curator
Tag Curator
Tags drift over time: #todo vs #todos, #project vs #projects, orphan tags used on
one note. This recipe is an agent that audits your taxonomy and proposes a cleanup, applying
only after you approve.
Setup
Optional: a
lint:schema inindex.md(Lettuce’s lint already flagsuntagged-noteandmissing-required-tag).Optional but recommended: a section in
AGENTS.mdlisting canonical tag names + nesting conventions, so the curator unifies toward your vocabulary.
Prompt
@claude Audit my tag taxonomy. Use
list_tagsthen look for:
Near-duplicates (
#todovs#todos, singular vs plural).Single-use tags that could be merged with something common or removed.
Tags that should be nested (e.g.,
#webnotes that should be#project/web).Findings already surfaced by
lint.Reply with a table of proposed changes. Don’t apply anything.
Tools the agent will use
| Tool | Why |
|---|---|
list_tags |
Get every tag in the vault with note counts. |
notes_by_tag(tag) |
Find every note carrying a near-duplicate, so the merge knows what to touch. |
lint |
Reuse the existing tag-typo / untagged findings rather than re-detecting them. |
To apply approved changes:
| patch_section(path, target_type: "frontmatter", target: "tags", op: "replace", content: …) | Rewrite a note’s tag list. |
| apply_edits(path, edits) | For inline #tag occurrences in the body. |
Trust + safety
Audit-first: the proposal is a table or a fresh note. Approve before any writes happen.
Each merge is one attributed edit per note. If a merge changes a tag that shouldn’t have moved, the timeline pane reverts it (per-note).
Consider a scoped, write-only-to-tags workflow by pairing this with
patch_section‘s frontmatter targeting — the agent can’t accidentally rewrite a note’s body.
Example output
| Action | From | To | Notes affected |
|---|---|---|---|
| Merge | #todos |
#todo |
4 |
| Nest | #web |
#project/web |
7 |
| Remove (single-use) | #prototype-q3 |
— | 1 |
Reply “Apply all” → agent calls patch_section per row, you see seven new entries in the
timeline pane, all revertible.