metadata-agent — Claude Code subagent: what it does, how to install
Standardizes frontmatter in Obsidian markdown vaults. It detects missing metadata, inserts tags, file categories, and creation dates.
npx claude-code-templates@latest --agent obsidian-ops-team/metadata-agentWhat metadata-agent does
This subagent inspects markdown documents in an Obsidian vault to bring YAML frontmatter into uniform shape. When a note lacks metadata, the agent inserts standard fields: tags, type, created, modified, and status. It pulls creation timestamps directly from filesystem attributes and assigns hierarchical tags based on note content and folder placement. File types follow a predefined scheme, covering categories like note, moc, reference, template, and daily-note.
Execution relies on a Python script named metadata_adder.py triggered through the Bash tool. The workflow starts with a --dry-run execution to preview proposed updates before writing to disk. Existing valid frontmatter remains untouched. The agent updates notes only when metadata is missing or contains malformed fields.
The prompt references absolute local paths such as /Users/cam/VAULT01/System_Files/Scripts/metadata_adder.py. Adapting this setup to another environment requires updating those directory paths first.
What it helps with
- insert missing frontmatter blocks across vault markdown files
- populate note creation dates from filesystem attributes
- generate hierarchical tags from note context and folder structure
- assign document categories and status flags systematically
Example prompts for the agent
- Run metadata-agent in dry-run mode to see notes missing frontmatter
- Standardize metadata across markdown files in the reference directory
- Use metadata-agent to assign tags and document types to recent notes
How to install metadata-agent
1claude-code-templates
npx claude-code-templates@latest --agent obsidian-ops-team/metadata-agent2Manually: put the files in place
.claude/agents/metadata-agent.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/metadata-agent.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/metadata-agent.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about metadata-agent
How to install metadata-agent in Claude Code?
Run npx claude-code-templates@latest --agent obsidian-ops-team/metadata-agent in your terminal. The subagent definition will be saved to .claude/agents/metadata-agent.md.
What does metadata-agent do?
It scans Obsidian vault notes and inserts standardized frontmatter headers containing tags, timestamps, document types, and status values.
Why does the workflow use a dry-run flag?
Running python3 /Users/cam/VAULT01/System_Files/Scripts/metadata_adder.py --dry-run previews every file that needs frontmatter, so you can inspect planned modifications before updating files.