Skip to content
FeaturesPricingBlogDownload

← All posts

YAML front matter for AI: metadata that helps models find the right note

YAML front matter for AI is a few fields at the top of a note, such as a summary, status and date, that let a model judge relevance before reading the note.

Diagram card on a light background showing a YAML front matter block with title and tags used to find and filter notes

YAML front matter for AI is a short block of fields at the top of a Markdown note, such as a one-line summary, a status, an updated date and a few tags, that lets a model or agent decide whether a note is relevant before it reads the rest. AI tools already work this way with their own files: Claude Code picks skills by their description field, and Cursor and GitHub Copilot decide which rules apply from front matter patterns. The same idea works for your notes, as long as the fields are few, accurate and written for the reader who has to choose.

For the syntax itself (the --- lines, quoting, lists), see the Markdown front matter guide. This post is about which fields help AI tools, how they use them, and the mistakes that make metadata worse than none.

How do AI tools use front matter today?

Several coding tools read front matter to decide what to load, and their documentation shows which fields matter. As checked in November 2026:

Tool File Fields it reads What they decide
Claude Code .claude/skills/<name>/SKILL.md description, when_to_use, name and others Whether Claude uses the skill for a request
Claude Code .claude/rules/*.md paths Which files make the rule load
Cursor .cursor/rules/*.mdc description, globs, alwaysApply Whether a rule applies, and when
GitHub Copilot .github/instructions/*.instructions.md applyTo Which files the instructions cover

The pattern across them is consistent. A short field, read first, decides whether the long body is worth loading. Claude Code's skills documentation states it directly: skill descriptions are loaded into context "so Claude knows what's available, but full skill content only loads when invoked." Cursor's rules work similarly in their "Apply Intelligently" mode, where the agent reads a rule's description to judge whether it is relevant; Cursor rules and Markdown docs covers the four modes.

Your notes can follow the same pattern even though no tool reads them by contract. An agent scanning a folder will read whatever is at the top of each file, and front matter is at the top.

Which front matter fields help a model find the right note?

Four or five fields cover most needs. Each one should answer a question the model would otherwise have to read the whole note to answer.

---
summary: Current refund rules for monthly and annual plans, and how to issue one.
status: current
updated: 2026-11-20
tags: [billing, support]
source: Support handbook section 4, approved 2026-11-18
---
Field Question it answers Example
summary What is this note about? One sentence, specific nouns
status Can I trust it? current, draft, superseded
updated How fresh is it? 2026-11-20
tags Which area does it belong to? Two to four, from a fixed list
source Where does the fact come from? A document, a person, a date

summary is the field to get right. Write it the way Claude Code's documentation asks skill descriptions to be written: what it covers and when it matters, with the key use case first. "Refund rules for monthly and annual plans, and how to issue one" helps a model choose. "Refunds" does not, and neither does a summary that repeats the title.

status: superseded is the one people skip, and it prevents the worst errors. A model that finds an old pricing note has no other way to know it was replaced. Add a line such as replaced_by: pricing.md and it can follow the pointer.

How do agents read front matter without reading every note?

By reading only the top of each file. Two common routes:

  • A filesystem server. The MCP filesystem server's read_text_file tool takes an optional head value, so an assistant can read the first ten lines of each note. With front matter there, that is enough to pick the few notes worth opening in full.
  • A coding agent with a shell. Claude Code and similar agents can run grep and head across the folder.

Front matter also makes plain searches precise, for you and for an agent:

# Notes marked current in the billing area
grep -l "status: current" $(grep -rl "tags: \[.*billing" notes/)

# Notes without an updated date from this year
grep -rL "updated: 2026" notes/ --include="*.md"

Neither of those works on prose. "This is still accurate as of last month" in the body is invisible to a search and ambiguous to a model.

What makes front matter worse than none?

Wrong or stale fields. A model trusts metadata because it looks official, so a note marked status: current that is two years old does more harm than one with no status at all.

  • Fields nobody maintains. Only add a field you will keep up to date. The front matter guide makes the same point: adding fields "for later" tends to leave them out of date.
  • Invalid YAML. One bad line can make a tool ignore the whole block. Claude Code's memory documentation says that if a rule's front matter does not parse, it ignores the front matter and loads the rule as if it had no paths, so a scoped rule becomes an always-on one.
  • Misspelled field names. The skills documentation notes that Claude Code ignores a field it does not recognize "without reporting an error." descripton: fails silently.
  • Long blocks. Ten fields of metadata on a 200-word note costs more to read than the note. Keep the block to a handful of lines.
  • Secrets. Front matter is part of the file. Anything in it goes wherever the file goes.

Does front matter replace a good first paragraph?

No. Front matter helps a tool choose a note; the first paragraph is what a reader, human or model, takes away from it. A note with a summary field and a first line that states the answer works for both. The same structure is the basis of an AI knowledge base built from Markdown files.

Tools that write their own notes have settled on this structure too. Claude Code's auto memory saves each memory as a Markdown file with a type field in its front matter, and records the write time in a modified field, so both you and Claude can see how current a memory is when it is read back.

Front matter in Noteline

Noteline, which we make, keeps front matter exactly as you type it: the editor shows the block at the top of the note with the two --- lines drawn as thin rules, and the file on disk keeps the YAML unchanged, so agents and other tools read it as written. Find in Folder (Cmd+Shift+F on a Mac, Ctrl+Shift+F on Windows and Linux) searches every note in the open folder, which is a quick way to list notes with status: draft or an old updated: date. In the desktop app, Word and PDF export use title, author and date for the document's title block and leave other fields out of the text.

Give your next idea a Markdown file.

Write a note, copy it into your prompt, and keep the original as a plain .md file.

Try desktop free for 14 days ↓Free on iPhone, iPad and Android →

Desktop: 14-day trial, then $9.99 once. Mobile apps: free. No account.

Keep reading

  • Markdown front matter
  • How to keep AI meeting notes as Markdown files you own
  • AI memory files: what your assistant should remember, kept in Markdown
  • An AI research workflow in Markdown: sources, summaries and claims

A Markdown note editor with everything you need

We’re listening

Tell us what you need or what gets in your way. If something isn’t working, write to us any time.

contact@noteline.io→

Product

  • Download
  • Pricing
  • Features
  • Changelog

Learn

  • Markdown syntax
  • Use cases
  • Blog

Compare

  • vs Obsidian
  • vs Notion

Support

  • Help
  • Support
  • Privacy
  • Terms

© 2026 Notelinecontact@noteline.io